[go: up one dir, main page]

CN115130443B - Table data processing method and device, electronic equipment and storage medium - Google Patents

Table data processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115130443B
CN115130443B CN202210747008.9A CN202210747008A CN115130443B CN 115130443 B CN115130443 B CN 115130443B CN 202210747008 A CN202210747008 A CN 202210747008A CN 115130443 B CN115130443 B CN 115130443B
Authority
CN
China
Prior art keywords
data
data object
attribute
file
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210747008.9A
Other languages
Chinese (zh)
Other versions
CN115130443A (en
Inventor
张春钊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Feiniaoyu Information Technology Co ltd
Original Assignee
Feiniaoyu Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Feiniaoyu Information Technology Co ltd filed Critical Feiniaoyu Information Technology Co ltd
Priority to CN202210747008.9A priority Critical patent/CN115130443B/en
Publication of CN115130443A publication Critical patent/CN115130443A/en
Application granted granted Critical
Publication of CN115130443B publication Critical patent/CN115130443B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a table data processing method, a table data processing device, electronic equipment and a storage medium. The method comprises the following steps: acquiring a table file, determining a data model corresponding to the table file, and converting the data model to obtain a data object; annotating the attribute of each data object based on the corresponding column number of the data object in the table file; reading the table data in sequence based on the valid data starting line number, acquiring a value corresponding to the column sequence number in the table file according to the attribute of the data object in the reading process of the table data, and assigning a value to the attribute of the data object according to the value; and after all the table data are polled and read, obtaining a data object array, sequentially reading verification rules corresponding to the attributes of each data object in the data object array, and verifying the attributes of the data objects based on the verification rules. The method and the device simplify the table data processing operation, improve the table data processing efficiency and improve the data verification accuracy.

Description

Table data processing method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the field of computer technology, and in particular, to a method and device for processing table data, electronic equipment and a storage medium.
Background
With the development of information technology, a large amount of data is stored in the form of a table file (such as an excel file), and it has become a very popular requirement to import data in the table file into a system or export data in the system into the table file. Moreover, when importing data in a table file into a system, it is necessary to check the integrity and accuracy of the data.
In the prior art, when uploading, downloading and verifying data of a table file, a large number of codes are required to be written to read and verify the data under normal conditions, so that code development in the uploading and downloading process of the table file becomes tedious and repeated, validity verification of the data uploaded by the table file becomes cumbersome, maintenance cost of code development is high, and in addition, when the data in the table file is read, accuracy of data verification is poor. Therefore, the existing form file uploading, downloading and validity checking modes based on code development have the problems of complicated processing process, high maintenance cost, poor data checking accuracy and low form data processing efficiency.
Disclosure of Invention
In view of the above, the embodiments of the present disclosure provide a method, an apparatus, an electronic device, and a storage medium for processing data of a representative grid, so as to solve the problems of complicated processing procedure, high maintenance cost, poor accuracy of data verification, and low processing efficiency of data of a table in the prior art.
In a first aspect of an embodiment of the present disclosure, there is provided a table data processing method, including: acquiring a form file to be processed, determining a data model corresponding to the form file, and converting the data model to obtain a data object, wherein the data object comprises a plurality of objects corresponding to the form file; annotating the attribute of each data object based on the corresponding column number of the data object in the table file so as to mark the column number corresponding to the data object on the attribute of each data object; reading the table data in the table file in sequence based on a preset valid data start line number, acquiring a value corresponding to the column sequence number in the table file according to the attribute of the data object in the reading process of the table data, and assigning a value to the attribute of the data object according to the value; and after all the table data are polled and read, obtaining a data object array corresponding to the table file, sequentially reading verification rules corresponding to the attributes of each data object in the data object array, and verifying the attributes of the data objects based on the verification rules, wherein the verification rules are rules annotated on the attributes of each data object in advance.
In a second aspect of the embodiments of the present disclosure, there is provided a form data processing apparatus, including: the acquisition module is configured to acquire a form file to be processed and determine a data model corresponding to the form file, and convert the data model to obtain a data object, wherein the data object comprises a plurality of objects corresponding to the form file; the annotating module is configured to annotate the attribute of each data object based on the corresponding column serial number of the data object in the table file so as to mark the column serial number corresponding to the data object on the attribute of each data object; the reading module is configured to start line numbers based on preset effective data, sequentially read the table data in the table file, acquire the values corresponding to the column serial numbers in the table file according to the attributes of the data objects in the reading process of the table data, and assign the values to the attributes of the data objects according to the values; and the verification module is configured to obtain a data object array corresponding to the table file after all the table data are polled and read, and sequentially read a verification rule corresponding to the attribute of each data object in the data object array, and verify the attribute of the data object based on the verification rule, wherein the verification rule is a rule annotated on the attribute of each data object in advance.
In a third aspect of the disclosed embodiments, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above method when the processor executes the program.
In a fourth aspect of the disclosed embodiments, a computer-readable storage medium is provided, which stores a computer program which, when executed by a processor, implements the steps of the above-described method.
The above-mentioned at least one technical scheme that the embodiment of the disclosure adopted can reach following beneficial effect:
Converting the data model to obtain a data object by acquiring a form file to be processed and determining a data model corresponding to the form file, wherein the data object comprises a plurality of objects corresponding to the form file; annotating the attribute of each data object based on the corresponding column number of the data object in the table file so as to mark the column number corresponding to the data object on the attribute of each data object; reading the table data in the table file in sequence based on a preset valid data start line number, acquiring a value corresponding to the column sequence number in the table file according to the attribute of the data object in the reading process of the table data, and assigning a value to the attribute of the data object according to the value; and after all the table data are polled and read, obtaining a data object array corresponding to the table file, sequentially reading verification rules corresponding to the attributes of each data object in the data object array, and verifying the attributes of the data objects based on the verification rules, wherein the verification rules are rules annotated on the attributes of each data object in advance. The method and the device simplify the table data processing operation, reduce the maintenance cost, and improve the efficiency of table data processing and the accuracy of data verification.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings that are required for the embodiments or the description of the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings may be obtained according to these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a flow chart of a method for processing tabular data provided by an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a tabular data processing apparatus provided by an embodiment of the present disclosure;
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the disclosed embodiments. However, it will be apparent to one skilled in the art that the present disclosure may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present disclosure with unnecessary detail.
As described in the foregoing background, in the conventional method for uploading, downloading and verifying validity of a table file based on code development, when uploading, downloading or verifying validity of data needs to be performed on the table file, a large number of codes need to be written to process data in the table file, however, the code development process is tedious and repeated, and accuracy is poor when the data is read, such as space exists before and after the data, a formula is read from a column calculated by an excel formula instead of a value calculated by the formula, a date is read error, precision is lost to the excel digital type, and the like.
The following takes uploading, downloading and data validity verification of an excel file as an example to describe the problems of the existing form data processing mode based on code development in detail, and the specific contents are as follows:
1) When reading the data uploaded by the excel, the existing reading mode is to read the data of each row in the excel from top to bottom, and then sequentially read the data on each column from left to right. Thus, all the read data is converted to the required object class, and the uploaded excel file may have a header, but the header should not be read, so that when each row is read, consideration needs to be given to which row to start reading. However, in the existing form uploading method based on code development, header data cannot be distinguished, and thus misreading of data is easy to occur.
2) When downloading the data of an excel file, the existing downloading mode is to set a file template (such as an xml file template or an excel file template), then read the file template, and write the data to be downloaded into the file template row by row and column by code program. However, this data downloading method is very inefficient, and it is also necessary to separately develop codes for downloading for the form files of the unused form.
3) When verifying the validity of the data uploaded by excel, the current processing mode is to verify the validity of a column of data once the column of data is read. When illegal data is encountered, whether to continue verification or interrupt verification is required to be redeveloped according to service requirements. Therefore, the validity verification mode causes complicated and repeated validity verification operation, corresponding program codes need to be developed aiming at different verification rules, and the efficiency of data validity verification is reduced.
4) When error prompt is carried out on illegal data in data uploaded by excel, the current error prompt mode is that a developer is required to calculate which row and which column of data have problems, so that which data are manually prompted to have what errors. Therefore, the existing error prompt mode aiming at illegal data has the problems of complex operation, low manual checking accuracy and incapability of customizing error information.
In view of the above problems in the prior art, the present disclosure provides an improved table data processing method, where the present disclosure initializes a data object by defining a correspondence between a read row and an attribute column, and automatically performs conversion reading of data by pre-declaring the object, so as to shield a developer from an excel reading process; automatically writing the data to be downloaded into an excel template through a pre-declaration object, and carrying out data verification and accuracy prompt in a self-defined annotation mode so as to standardize and simplify the data verification process of excel; the method and the system can also enable developers to flexibly set the verification rules in an annotation mode, and allow the developers to customize error information. The method and the device can realize standard automatic downloading of the excel and pack and isolate the generated excel.
The following is a complete description of the technical scheme of the table data processing method provided by the embodiment of the disclosure with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a flowchart of a table data processing method according to an embodiment of the disclosure. The tabular data processing method of fig. 1 may be performed by a system server. As shown in fig. 1, the table data processing method specifically may include:
S101, acquiring a form file to be processed, determining a data model corresponding to the form file, and converting the data model to obtain a data object, wherein the data object comprises a plurality of objects corresponding to the form file;
s102, annotating the attribute of each data object based on the corresponding column number of the data object in the table file so as to mark the column number corresponding to the data object on the attribute of each data object;
s103, reading the table data in the table file in sequence based on the preset valid data start line number, acquiring a value corresponding to the column sequence number in the table file according to the attribute of the data object in the reading process of the table data, and assigning a value to the attribute of the data object according to the value;
S104, after all the table data are polled and read, a data object array corresponding to the table file is obtained, verification rules corresponding to the attributes of each data object in the data object array are sequentially read, and the attributes of the data objects are verified based on the verification rules, wherein the verification rules are rules annotated on the attributes of each data object in advance.
Specifically, in practical application, a business person inputs user information into excel, and then uploads the excel file to a background system, and in the background system, data in the excel file is processed by using the technical scheme of the present disclosure, so that data reading and validity verification (also called compliance verification) are realized, and finally a data object array conforming to a verification rule is obtained. Similarly, when downloading the data report and the excel file corresponding to the order in the background system, the data object can be defined, and the data object array can be initialized by annotating the column number and the title of the labeling object attribute.
According to the technical scheme provided by the embodiment of the disclosure, a data object is obtained by obtaining a form file to be processed and determining a data model corresponding to the form file, and the data model is converted, wherein the data object comprises a plurality of objects corresponding to the form file; annotating the attribute of each data object based on the corresponding column number of the data object in the table file so as to mark the column number corresponding to the data object on the attribute of each data object; reading the table data in the table file in sequence based on a preset valid data start line number, acquiring a value corresponding to the column sequence number in the table file according to the attribute of the data object in the reading process of the table data, and assigning a value to the attribute of the data object according to the value; and after all the table data are polled and read, obtaining a data object array corresponding to the table file, sequentially reading verification rules corresponding to the attributes of each data object in the data object array, and verifying the attributes of the data objects based on the verification rules, wherein the verification rules are rules annotated on the attributes of each data object in advance. The method and the device simplify the table data processing operation, reduce the maintenance cost, and improve the efficiency of table data processing and the accuracy of data verification.
In some embodiments, obtaining a table file to be processed and determining a data model corresponding to the table file, and converting the data model to obtain a data object includes: filling the acquired user information into a preset form file automatically, uploading the form file containing the user information to a system, receiving the form file by the system, determining a data model corresponding to the form file, and executing object extraction operation on the data model to obtain a data object.
Specifically, service personnel collect user information, input the user information into excel, upload the excel after inputting the user information to a system, and abstract the system to obtain a data object through a data model after receiving the excel. In practical applications, the data model may be considered as a data object setting, for example, assuming that a column in an excel file is a user ID and a row is a user name, the data model may be considered as a model formed by "id+user name", and the data object may be obtained by converting the data model into a code.
In some embodiments, annotating the attribute of each data object based on its corresponding column number in the table file, including: the column number of the data object in the table file is determined based on the predefined column number in the data model of the table file, the attribute of the data object is annotated according to the column number, the column number is marked in the attribute of the data object, and the column number is marked from 0.
Specifically, by defining a data object, that is, extracting a data model to obtain the data object, for each object attribute of the data object (that is, attribute of the data object), a column number corresponding to excel is marked on each object attribute by using a annotating mode, and marking is started from 0 when the column number is marked on the object attribute. In practical application, the object attribute refers to an attribute corresponding to each row and each column in the data object, for example, when the first column in the data object is a user name, then the object attribute includes a name, and each object attribute is annotated in advance to mark a column number of each object attribute.
In the following, in a specific embodiment, the content of an excel data model and the content of a converted data object are described, for example, when the content of an excel file in an uploading system is shown in table 1:
TABLE 1excel File content
After the system acquires the excel file, abstracting out a data object through a data model to obtain the content shown in the table 2:
table 2 content abstracted from the data model
In some embodiments, reading table data in a table file sequentially based on a preset valid data start line number, and acquiring a value corresponding to a column sequence number in the table file according to an attribute of a data object in a reading process of the table data, and assigning the attribute of the data object according to the value, wherein the method comprises the following steps: and when the line-level polling reading is carried out, obtaining a value in the table file corresponding to the column sequence number according to the column sequence number defined on the attribute of the data object in advance, and carrying out initialization operation on the attribute of the data object by utilizing the value corresponding to the column sequence number so as to assign the attribute of the data object.
Specifically, after the data model abstracts the data object and annotates the column sequence number of each object attribute in the data object, reading the data of excel according to the set valid data start line number, for example, in table 2 above, the valid data starts from line 2. In practical application, when an excel file stream is read, the line number is started by the set valid data start line number, and polling reading is started in a line-level mode.
Further, when performing row-level polling to read data, a column number defined for an attribute of each data object according to the foregoing embodiment is obtained from excel according to the column number, and the value on the column in excel is corresponding to the column number, so that the value of the attribute of the data object is initialized with the obtained value. For example, assuming that "Zhang Sano" is a value corresponding to the name attribute of the data object, after reading one excel, the first line is found to be "Zhang Sano", and the name attribute of the data object is assigned to "Zhang Sano".
In some embodiments, the method further comprises: when initializing the attribute of the data object, performing space removal operation on the value read from the table file so as to remove the front space and the rear space of the value, and taking the value calculated by the formula in the table file as an assignment.
Specifically, in the process of reading excel data through line-level polling, that is, in the process of initializing attribute values of data objects, the embodiment of the disclosure performs front-back space removal processing on values read from excel, so as to solve space information frequently recorded carelessly in an excel table, and avoid a series of technical problems. In addition, when initializing the attribute value of the data object, the value calculated by the formula is taken as the value calculated by the formula in excel, instead of reading the formula in excel.
In some embodiments, sequentially reading a verification rule corresponding to an attribute of each data object in the data object array, verifying the attribute of the data object based on the verification rule, including: and polling each data object in the data object array, sequentially reading the verification annotation on the attribute of each data object, acquiring the verification rule of each attribute according to the verification annotation, and carrying out compliance verification on the attribute of the data object by using the verification rule.
Specifically, a data object array may be obtained through the processing in the foregoing embodiment, where the data object array refers to a data set obtained after assignment, and is an array used in a computer program, and one array includes a plurality of rows of data. After the data object array is obtained, the validity of the data in the data object array is required to be verified (namely, compliance verification), and the data verification rules marked on the data object are read by polling each data object in the data object array in turn, namely, the verification comments on the attributes of the data object are read to obtain the verification rules of specific attributes, wherein each attribute is preset with one or more verification rules, any verification rule is not required to be set on the attributes, the verification rules default to be finished when the fault is encountered, and the verification can be continued when the fault is encountered.
The following describes the contents of several attribute verification rules provided in the present disclosure in connection with specific embodiments, and may include, for example, the following attribute verification rules:
The @ ExcelCellNotBlank cannot be null notes and an error message hint can be configured. Thus, when the annotated attribute does not meet the condition, the method comprises the following steps: the X row and the X column are used for prompting the configuration error information.
The @ ExcelCellDate date annotation, a date format may be configured. Because the date of excel has various types, such as character string type, custom type and date type; in daily development, various problems often occur due to reading of the date format. These problems are well masked with this annotation.
The minimum and maximum annotation of the @ ExcelCellMinMax value can be configured, and the minimum and maximum values and the personalized prompt information when the minimum and maximum values are not met can be configured.
The @ ExcelCellGroupNotBlank group cannot be empty for annotation, and the plurality of attributes in the same group are subject to the first attribute, if the first attribute value is not empty, the other attributes in the group cannot be empty; if the first attribute value is null, then the values of other attributes within the group may or may not be null.
Further, finally, after the attribute of each data object is verified by the verification rule, a normalized array conforming to the verification rule can be obtained.
The above embodiments describe the process of uploading excel in detail, and the embodiments of the present disclosure are also applicable to operations of downloading excel from a system, and compared with the process of uploading excel, the method of uploading excel also uses data objects, annotates attributes of the data objects to label column numbers and titles of the object attributes, and initializes the data object array. The following description of the excel download process is described in connection with specific embodiments, and may specifically include the following:
Step 1: predefining a data object, annotating a column sequence number and a title of the object attribute by annotation, and initializing a data object array;
step 2: setting a self-defined excel template path and a data starting line number, and in practical application, setting no excel template, and using the default template provided by the disclosure when no excel template is set;
Step 3: reading an excel template path, if a default template is not used;
Step 4: if the default template is used, generating a title line, wherein the title is the title set on the object attribute in the step 1;
step 5: polling the data object array in the step 1;
step 6: initializing an object attribute value into a corresponding column of an excel template according to a column sequence number of the object attribute;
step 7: and finishing polling, and finishing generating an excel download file stream.
It should be noted that, the embodiment of the disclosure not only can realize the uploading, downloading and data verification processing of a single excel file, but also is applicable to the processing of a plurality of excel files. In practical application, the table file in the embodiment of the disclosure is an excel file, and the table data is data corresponding to each column serial number in the excel file.
According to the technical scheme provided by the embodiment of the disclosure, the data object is initialized by defining the corresponding relation between the reading row and the attribute column, and the conversion reading of the data is automatically performed by pre-declaring the object, so that the excel reading process is shielded for the developer; automatically writing the data to be downloaded into an excel template through a pre-declaration object, and carrying out data verification and accuracy prompt in a self-defined annotation mode so as to standardize and simplify the data verification process of excel; the method and the system can also enable developers to flexibly set the verification rules in an annotation mode, and allow the developers to customize error information. The method and the device can realize standard automatic downloading of the excel and pack and isolate the generated excel.
The following are device embodiments of the present disclosure that may be used to perform method embodiments of the present disclosure. For details not disclosed in the embodiments of the apparatus of the present disclosure, please refer to the embodiments of the method of the present disclosure.
Fig. 2 is a schematic structural diagram of a table data processing apparatus according to an embodiment of the present disclosure. As shown in fig. 2, the form data processing apparatus includes:
The acquiring module 201 is configured to acquire a form file to be processed and determine a data model corresponding to the form file, and convert the data model to obtain a data object, where the data object includes a plurality of objects corresponding to the form file;
An annotating module 202 configured to annotate the attribute of each data object based on the column number corresponding to the data object in the table file, so as to mark the column number corresponding to the data object on the attribute of each data object;
The reading module 203 is configured to sequentially read the table data in the table file based on the preset valid data start line number, and obtain a value corresponding to the column sequence number in the table file according to the attribute of the data object in the reading process of the table data, and assign a value to the attribute of the data object according to the value;
The verification module 204 is configured to obtain a data object array corresponding to the table file after all the table data are completely polled and read, and sequentially read a verification rule corresponding to an attribute of each data object in the data object array, and verify the attribute of the data object based on the verification rule, wherein the verification rule is a rule annotated in advance on the attribute of each data object.
In some embodiments, the acquisition module 201 of fig. 2 automatically fills the acquired user information into a preset form file, uploads the form file containing the user information to the system, the system receives the form file, determines a data model corresponding to the form file, and performs an object extraction operation on the data model to obtain a data object.
In some embodiments, the annotation module 202 of FIG. 2 determines a column number of the data object in the table file based on a predefined column number in the data model of the table file, annotates the attribute of the data object according to the column number, annotates the column number in the attribute of the data object, and annotates the column number starting at 0.
In some embodiments, the reading module 203 of fig. 2 uses the valid data start line number as the start line number, sequentially polls and reads the table data in the table file in a line-level manner, and when performing line-level polling and reading, obtains a value in the table file corresponding to the column number according to the column number defined in advance on the attribute of the data object, and performs an initializing operation on the attribute of the data object by using the value corresponding to the column number so as to assign a value to the attribute of the data object.
In some embodiments, the reading module 203 of fig. 2 performs a space removing operation on the values read from the table file when initializing the attribute of the data object, so as to remove the spaces before and after the values, and takes the values calculated by the formula in the table file as the assigned values.
In some embodiments, the validation module 204 of FIG. 2 polls each data object within the array of data objects, sequentially reads the validation annotations on the attributes of each data object, obtains the validation rules for each attribute according to the validation annotations, and performs compliance validation on the attributes of the data objects using the validation rules.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic of each process, and should not constitute any limitation on the implementation process of the embodiments of the disclosure.
Fig. 3 is a schematic structural diagram of an electronic device 3 provided in an embodiment of the present disclosure. As shown in fig. 3, the electronic apparatus 3 of this embodiment includes: a processor 301, a memory 302 and a computer program 303 stored in the memory 302 and executable on the processor 301. The steps of the various method embodiments described above are implemented when the processor 301 executes the computer program 303. Or the processor 301 when executing the computer program 303 performs the functions of the modules/units in the above-described device embodiments.
Illustratively, the computer program 303 may be partitioned into one or more modules/units, which are stored in the memory 302 and executed by the processor 301 to complete the present disclosure. One or more of the modules/units may be a series of computer program instruction segments capable of performing a specific function for describing the execution of the computer program 303 in the electronic device 3.
The electronic device 3 may be an electronic device such as a desktop computer, a notebook computer, a palm computer, or a cloud server. The electronic device 3 may include, but is not limited to, a processor 301 and a memory 302. It will be appreciated by those skilled in the art that fig. 3 is merely an example of the electronic device 3 and does not constitute a limitation of the electronic device 3, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the electronic device may also include an input-output device, a network access device, a bus, etc.
The Processor 301 may be a central processing unit (Central Processing Unit, CPU) or other general purpose Processor, digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 302 may be an internal storage unit of the electronic device 3, for example, a hard disk or a memory of the electronic device 3. The memory 302 may also be an external storage device of the electronic device 3, for example, a plug-in hard disk provided on the electronic device 3, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD), or the like. Further, the memory 302 may also include both an internal storage unit and an external storage device of the electronic device 3. The memory 302 is used to store computer programs and other programs and data required by the electronic device. The memory 302 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
In the embodiments provided in the present disclosure, it should be understood that the disclosed apparatus/computer device and method may be implemented in other manners. For example, the apparatus/computer device embodiments described above are merely illustrative, e.g., the division of modules or elements is merely a logical functional division, and there may be additional divisions of actual implementations, multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present disclosure may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules/units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the present disclosure may implement all or part of the flow of the method of the above-described embodiments, or may be implemented by a computer program to instruct related hardware, and the computer program may be stored in a computer readable storage medium, where the computer program, when executed by a processor, may implement the steps of the method embodiments described above. The computer program may comprise computer program code, which may be in source code form, object code form, executable file or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the jurisdiction's jurisdiction and the patent practice, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals according to the jurisdiction and the patent practice.
The above embodiments are merely for illustrating the technical solution of the present disclosure, and are not limiting thereof; although the present disclosure has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the disclosure, and are intended to be included in the scope of the present disclosure.

Claims (9)

1. A form data processing method, comprising:
Acquiring a form file to be processed, determining a data model corresponding to the form file, and converting the data model to obtain a data object, wherein the data object comprises a plurality of objects corresponding to the form file;
annotating the attribute of each data object based on the corresponding column sequence number of the data object in the table file so as to mark the corresponding column sequence number of the data object on the attribute of each data object;
Reading the table data in the table file in sequence based on a preset valid data start line number, acquiring a value corresponding to the column sequence number in the table file according to the attribute of the data object in the reading process of the table data, and assigning a value to the attribute of the data object according to the value;
After all the table data are polled and read, a data object array corresponding to the table file is obtained, verification rules corresponding to the attributes of each data object in the data object array are sequentially read, and the attributes of the data objects are verified based on the verification rules, wherein the verification rules are rules annotated on the attributes of each data object in advance;
The method for reading the table data in the table file sequentially based on the preset valid data start line number, acquiring the value corresponding to the column sequence number in the table file according to the attribute of the data object in the reading process of the table data, and assigning the attribute of the data object according to the value comprises the following steps:
And sequentially polling and reading the table data in the table file in a row-level mode by taking the starting row number of the valid data as the starting row number, acquiring values in the table file corresponding to the column sequence numbers according to column sequence numbers defined on the attributes of the data objects in advance when performing row-level polling and reading, and initializing the attributes of the data objects by utilizing the values corresponding to the column sequence numbers so as to assign the attributes of the data objects, wherein the values on columns in the table file corresponding to the column sequence numbers are acquired from a table according to the column sequence numbers, so that the values of the attributes of the data objects are initialized by utilizing the acquired values.
2. The method according to claim 1, wherein the obtaining the table file to be processed and determining the data model corresponding to the table file, converting the data model to obtain the data object, includes:
Automatically filling the acquired user information into a preset form file, uploading the form file containing the user information to a system, receiving the form file by the system, determining a data model corresponding to the form file, and executing object extraction operation on the data model to obtain the data object.
3. The method of claim 1, wherein annotating the attribute of each of the data objects based on the corresponding column sequence number of the data object in the table file comprises:
And determining a column sequence number of the data object in the table file based on a predefined column sequence number in a data model of the table file, annotating the attribute of the data object according to the column sequence number, marking the column sequence number in the attribute of the data object, and marking the column sequence number from 0.
4. The method according to claim 1, wherein the method further comprises:
and when initializing the attribute of the data object, performing space removing operation on the value read from the table file so as to remove the front space and the rear space of the value, and taking the value calculated by the formula in the table file as an assignment.
5. The method of claim 1, wherein the sequentially reading the verification rule corresponding to the attribute of each data object in the data object array verifies the attribute of the data object based on the verification rule, and comprises:
Polling each data object in the data object array, sequentially reading verification comments on the attribute of each data object, acquiring a verification rule of each attribute according to the verification comments, and carrying out compliance verification on the attribute of the data object by using the verification rule.
6. The method according to any one of claims 1 to 5, wherein the table file is an excel file, and the table data is data corresponding to each column number in the excel file.
7. A form data processing apparatus, comprising:
the acquisition module is configured to acquire a form file to be processed, determine a data model corresponding to the form file, and convert the data model to obtain a data object, wherein the data object comprises a plurality of objects corresponding to the form file;
The annotating module is configured to annotate the attribute of each data object based on the corresponding column sequence number of the data object in the table file so as to mark the column sequence number corresponding to the data object on the attribute of each data object;
the reading module is configured to sequentially read the table data in the table file based on a preset valid data start line number, acquire a value corresponding to the column sequence number in the table file according to the attribute of the data object in the reading process of the table data, and assign a value to the attribute of the data object according to the value;
The verification module is configured to obtain a data object array corresponding to the table file after all the table data are completely polled and read, and sequentially read a verification rule corresponding to the attribute of each data object in the data object array, and verify the attribute of the data object based on the verification rule, wherein the verification rule is a rule annotated on the attribute of each data object in advance;
The reading module takes a valid data start line number as a start line number, sequentially polls and reads the table data in the table file in a line-level mode, obtains a value in the table file corresponding to a column sequence number according to a column sequence number defined on the attribute of the data object in advance when performing line-level polling and reading, and performs initialization operation on the attribute of the data object by using the value corresponding to the column sequence number so as to assign the attribute of the data object, wherein the value on the column in the table file corresponding to the column sequence number is obtained from the table according to the column sequence number, and thus the value of the attribute of the data object is initialized by using the obtained value.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of any one of claims 1 to 6 when the program is executed.
9. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method according to any one of claims 1 to 6.
CN202210747008.9A 2022-06-28 2022-06-28 Table data processing method and device, electronic equipment and storage medium Active CN115130443B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210747008.9A CN115130443B (en) 2022-06-28 2022-06-28 Table data processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210747008.9A CN115130443B (en) 2022-06-28 2022-06-28 Table data processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115130443A CN115130443A (en) 2022-09-30
CN115130443B true CN115130443B (en) 2024-10-18

Family

ID=83379862

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210747008.9A Active CN115130443B (en) 2022-06-28 2022-06-28 Table data processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115130443B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119576443A (en) * 2024-11-04 2025-03-07 浪潮卓数大数据产业发展有限公司 A method to generate data from unordered Excel based on Java

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110347999A (en) * 2019-07-17 2019-10-18 政采云有限公司 A kind of method and apparatus of list data verification

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7010779B2 (en) * 2001-08-16 2006-03-07 Knowledge Dynamics, Inc. Parser, code generator, and data calculation and transformation engine for spreadsheet calculations
JP4086253B1 (en) * 2006-12-27 2008-05-14 清 高木 XML document processing method and processing program
WO2010016148A1 (en) * 2008-08-08 2010-02-11 三菱電機株式会社 Three-dimensional cad model creating device and program
CN112541327A (en) * 2019-09-23 2021-03-23 北京国双科技有限公司 Data reading method and device, electronic equipment and storage medium
CN113239106B (en) * 2021-06-04 2023-12-19 平安科技(深圳)有限公司 Excel file export method and device, electronic equipment and storage medium
CN114153906A (en) * 2021-12-01 2022-03-08 北京联创新天科技有限公司 Excel exporting method, device, medium and equipment
CN114357943A (en) * 2021-12-03 2022-04-15 北京复兴华创技术有限公司 Universal efficient Excel reading processing method, tool, medium and equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110347999A (en) * 2019-07-17 2019-10-18 政采云有限公司 A kind of method and apparatus of list data verification

Also Published As

Publication number Publication date
CN115130443A (en) 2022-09-30

Similar Documents

Publication Publication Date Title
CN113239106B (en) Excel file export method and device, electronic equipment and storage medium
CN109359283B (en) Summarizing method of form data, terminal equipment and medium
CN111400387A (en) Conversion method and device for import and export data, terminal equipment and storage medium
WO2013112260A1 (en) Hierarchical information extraction using document segmentation and optical character recognition correction
CN111562965B (en) Page data verification method and device based on decision tree
CN105868171A (en) Checking method and device of Excel file
CN114090671A (en) Data import method and device, electronic equipment and storage medium
CN113158988A (en) Financial statement processing method and device and computer readable storage medium
CN109871229B (en) Code text management method, device, storage medium and terminal device
CN113434734A (en) Method, device, equipment and storage medium for generating file and reading file
CN115130443B (en) Table data processing method and device, electronic equipment and storage medium
CN112035355A (en) Data processing method, apparatus, computer equipment and storage medium
CN108241642A (en) File parsing method and device
CN108763084A (en) A kind of generation method of test case, device and electronic equipment
CN109324963B (en) Method for automatically testing profit result and terminal equipment
CN112286936B (en) A method, system and related equipment for reconciliation
CN115357494A (en) Automatic generation method and device of function coverage rate code
CN119474191A (en) Data import method, device, computer equipment and readable storage medium
CN109635524B (en) Audio digital watermark embedding method and terminal equipment
CN111241096A (en) Text extraction method, system, terminal and storage medium for EXCEL document
CN114334052B (en) System and method for generating first page of medical record, corresponding equipment and storage medium
CN114186536B (en) Method, system and storage medium for automatically analyzing and generating data record
CN116258123A (en) BOM file conversion method, device, equipment and storage medium
CN109446100B (en) Method and apparatus for managing script files of devices
CN113449487A (en) Formula identification method and device, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant