Data processing method and device, electronic equipment and storage medium
By analyzing and converting the table files and sorting the target entity objects using annotation information, the problem of insufficient data processing efficiency and universality in the existing technology is solved, and an efficient and general data processing process is achieved.
Patent Information
- Application Number
- CN202311594629.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-27
- Publication Date
- 2025-05-27
AI Technical Summary
In the business processing process, with the increase in the amount of data and the diversity of business types, it is difficult for the prior art to achieve the efficiency and universality of data processing. Especially when processing data in different table formats, multiple processing is required to be manually performed, which increases the workload.
By analyzing the obtained table file, the page objects in the file stream are obtained, and multiple target data are converted to generate target entity objects and annotation information, the entity objects are sorted based on the annotation information, and the target table is generated.
It realizes the universality and efficiency of data processing, and does not require different processing for different table files. It only needs to analyze the annotation information of the table files for sorting, reducing manual workload.
Smart Images

Figure CN120045556A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and in particular, to a data processing method, apparatus, electronic device, and storage medium. Background Art
[0002] With the advent of the information age, in the process of business processing by various enterprises, different businesses generate different data. Importing this data into the built data management system with the aid of computer devices has been widely integrated into all walks of life.
[0003] However, with the continuous increase in the types of businesses and the expanding business coverage area, the amount of data has become huge, and there is also a certain correlation between the data. Further, the table formats (Excel formats) used for statistical data in different businesses also vary. Based on this phenomenon, when processing data, it is necessary to perform different processes on each table file separately, which undoubtedly increases the manual workload. Summary of the Invention
[0004] This application provides a data processing method, apparatus, electronic device, and storage medium to improve the efficiency of data processing and achieve the generality of data processing.
[0005] In a first aspect, a data processing method is provided, including:
[0006] Parsing the obtained table file, and if a file stream of the table file is parsed, obtaining a page object from the file stream;
[0007] Converting multiple target data in the page object to obtain N target entity objects, and obtaining M entity attributes including annotation information in the N target entity objects; where the value of N is the same as the number of the multiple target data, and M is an integer greater than 0;
[0008] Sorting the N target entity objects according to the annotation information of each of the M entity attributes to obtain a target table.
[0009] In the embodiments of the present application, first, the obtained tabular file is parsed. If the file stream of the tabular file is parsed, then according to the entity objects in the file stream, the page object in the file stream is obtained; then, multiple target data in the page object are converted to obtain N target entity objects, and M entity attributes including annotation information are obtained from the N target entity objects; finally, according to the annotation information of each of the M entity attributes, the N target entity objects are sorted to obtain the target table; compared with the prior art, there is no need to perform different processing for different tabular files, and only the annotation information of the tabular file needs to be analyzed, and the columns in the table are sorted for the N target entity objects based on this annotation information, reducing the manual workload, thus improving the data processing efficiency and also realizing the generality of data processing.
[0010] In some embodiments of the present application, the method further includes:
[0011] If the file stream of the tabular file is not parsed, then a parsing failure message for prompting the failure of parsing the tabular file is output; wherein, the parsing failure message at least includes the exception reason for the failure of parsing the tabular file.
[0012] In this way, it is convenient for the user to take corresponding measures for processing.
[0013] In some embodiments of the present application, the sorting the N target entity objects according to the annotation information of each of the M entity attributes includes:
[0014] The page object is traversed in row mode. If the entity attribute to which the first target entity object among the N target entity objects belongs matches the first entity attribute among the M entity attributes, then according to the sequence value in the annotation information of the first entity attribute, the column where the first target entity object is located in the target table is determined.
[0015] In this way, based on the sequence values in the respective annotation information, each target entity object can be sorted one by one. When the number of rows of all data in this page object (page) is cycled through, the entire data processing process is completed, and a target table (data set) composed of entity objects one by one is obtained. Compared with the prior art, if it is directly set that the first column is the name and the second column is the age, then this data processing method can only read this set tabular file, and for other tabular files, it is convenient to rewrite the reading method. However, for this method in the embodiments of the present application, when reading other tabular files, the reading method also needs to be rewritten.
[0016] In some embodiments of the present application, before obtaining the page object from the file stream, it further includes:
[0017] Receive the file stream according to the set table file operation tool;
[0018] If the reception fails, output a reception failure message for prompting the failure of receiving the file stream; wherein, the reception failure message at least includes the abnormal reason for the failure of receiving the file stream.
[0019] In this way, it is prevented that the user accidentally modifies the suffix of the table file during the process of uploading the table file, resulting in the inability to perform subsequent processing.
[0020] In some embodiments of the present application, the parsing of the obtained table file includes:
[0021] In response to the user operation of selecting the import key on the user interface, obtain the table file;
[0022] Parse the table file according to the set table file operation tool.
[0023] In a second aspect, a data processing device is provided, including:
[0024] A parsing module, configured to parse the obtained table file, and if the file stream of the table file is parsed, obtain a page object from the file stream;
[0025] A conversion module, configured to convert multiple target data in the page object, convert to obtain N target entity objects, and obtain M entity attributes including annotation information in the N target entity objects; wherein, the value of N is the same as the number of the multiple target data, and M is an integer greater than 0;
[0026] A processing module, configured to sort the N target entity objects according to the annotation information of each of the M entity attributes to obtain a target table.
[0027] In some embodiments of the present application, the parsing module is further configured to:
[0028] If the file stream of the table file is not parsed, output a parsing failure message for prompting the failure of parsing the table file; wherein, the parsing failure message at least includes the abnormal reason for the failure of parsing the table file.
[0029] In some embodiments of the present application, the processing module is specifically configured to:
[0030] Traverse the page object in row mode. If the entity attribute to which the first target entity object among the N target entity objects belongs matches the first entity attribute among the M entity attributes, determine the column in the target table where the first target entity object is located according to the sequence value in the annotation information of the first entity attribute.
[0031] In some embodiments of the present application, the parsing module is further configured to:
[0032] Receive the file stream according to the set table file operation tool;
[0033] If the reception fails, output a reception failure message for prompting that the file stream reception fails; wherein, the reception failure message at least includes the exception reason for the file stream reception failure.
[0034] In some embodiments of the present application, the parsing module is specifically configured to:
[0035] In response to a user operation of selecting an import key in the user interface, obtain the table file;
[0036] Parse the table file according to the set table file operation tool.
[0037] In a third aspect, there is provided an electronic device, including:
[0038] A memory for storing a computer program; a processor for implementing the method steps described in any one of the first aspect when executing the computer program stored on the memory.
[0039] In a fourth aspect, there is provided a computer-readable storage medium, in which a computer program is stored, and the computer program implements the method steps described in any one of the first aspect when executed by a processor.
[0040] For the various aspects in the second aspect to the fourth aspect above and the possible technical effects that each aspect may achieve, please refer to the technical effects that can be achieved by the first aspect or various possible solutions in the first aspect described above, and details will not be repeated here. Description of the Drawings
[0041] Figure 1 It is a schematic diagram of the scenario applicable to the embodiments of the present application;
[0042] Figure 2 It is a flowchart of a data processing method provided by an embodiment of the present application;
[0043] Figure 3 It is a flowchart of a complete data processing method provided by an embodiment of the present application;
[0044] Figure 4 Schematic structural diagram of a data processing device provided by an embodiment of the present application;
[0045] Figure 5 Schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0046] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The specific operation methods in the method embodiments can also be applied to the device embodiments or system embodiments. It should be noted that in the description of the present application, "a plurality of" is understood as "at least two". "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The connection between A and B can represent: two situations where A is directly connected to B and A is connected to B through C. In addition, in the description of the present application, terms such as "first" and "second" are only used for the purpose of distinguishing descriptions, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order.
[0047] To better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application will be described below.
[0048] (1) A file stream is a data stream with an external storage file as the input / output object, and can be understood as a way to read data from a file or write data to a file.
[0049] (2) POI is a commonly used tool for a programming language to read tabular files, and provides three ways, namely HSSF, XSSF, and SXSSF, to operate tabular files. For example, use HSSF to open or create entity objects in a tabular file; for another example, use the entity object to return or create a Sheet object; for another example, use the Sheet object to return a row object, use the row object to obtain a column object, and use the column object to read and write.
[0050] Some simple introductions will be made below to the application scenarios applicable to the technical solutions of the embodiments of the present application. It should be noted that the application scenarios described below are only for illustrating the embodiments of the present application and not for limitation. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.
[0051] Figure 1 Schematic diagram of the application scenario applicable to the embodiments of the present application. As Figure 1As shown, this scenario mainly includes a terminal 10 and a server 11. Among them, information interaction can be carried out between the terminal 10 and the server 11 through a communication network, and the communication methods adopted by this communication network can include: wireless communication methods and wired communication methods.
[0052] In some scenarios, the terminal 10 can access the network through cellular mobile communication technology and communicate with the server 11. This cellular mobile communication technology can include fifth-generation mobile communication (5th Generation Mobile Networks, 5G) technology.
[0053] In some scenarios, the terminal 10 can access the network through short-range wireless communication methods and communicate with the server 11. This short-range wireless communication method can include wireless fidelity (Wi-Fi) technology.
[0054] The embodiments of the present application do not impose any restrictions on the number of the above devices. For example, Figure 1 As shown, only the terminal 10 and the server 11 are taken as examples for description. Next, a brief introduction to the above devices and their respective functions will be given.
[0055] The terminal 10 is a device that can provide voice and / or data connectivity to users, including: handheld terminal devices with wireless connection functions, in-vehicle terminal devices, etc.
[0056] In some scenarios, the terminal 10 includes but is not limited to: mobile phones, tablet computers, laptop computers, palm computers, mobile internet devices (MID), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminal devices in industrial control, wireless terminal devices in unmanned driving, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, or wireless terminal devices in smart homes, etc.
[0057] In addition, a client related to data processing can be installed on the terminal 10. This client can be software (such as APP, browser, etc.), or a web page, a small program, etc. In the embodiments of the present application, the terminal 10 can use the above client related to data processing and can perform information interaction related to data processing scenarios with the server 11.
[0058] Further, the server 11 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0059] Further, in the embodiment of the present application, the above-mentioned server 11 can be equipped with a data processing device corresponding to the above-mentioned terminal 10. This device adopts a general data processing method for processing various form files uploaded by the terminal 10.
[0060] To further illustrate the technical solutions provided in the embodiments of the present application, the following will be described in detail in combination with the accompanying drawings and specific implementation manners. Although the embodiments of the present application provide method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or non-creative labor. In steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided in the embodiments of the present application. When the method is actually processed or executed by the device, it can be executed in the order shown in the embodiments or drawings or executed concurrently.
[0061] Figure 2 It is a flowchart of a data processing method provided in an embodiment of the present application. This process can be executed by a data processing device, which can be implemented in software or in a combination of software and hardware. As Figure 2 shown, this process includes the following steps:
[0062] 201: Parse the obtained form file. If the file stream of the form file is parsed, obtain the page object from the file stream.
[0063] In some embodiments, parsing the obtained form file can specifically be: in response to a user operation of selecting an import key in the user interface, obtain the form file; parse the form file according to a set form file operation tool (for example, POI).
[0064] It should be noted that this user operation can be selecting the import key by mouse, or selecting the import key by hand or touch screen in a user interface with touch screen function, or selecting the import key through voice recognition function. The embodiments of the present application do not limit this here.
[0065] In some embodiments, if the file stream of the table file cannot be parsed, it indicates that the data reading from the table file fails, and a parsing failure message for prompting the failure of parsing the table file is output; wherein, the parsing failure message at least includes the exception reason for the failure of parsing the table file, and may also include information such as the format and name of the table file, so as to facilitate the user to take measures for processing.
[0066] In some other embodiments, before obtaining the page object from the file stream, it may further include: receiving the file stream according to a set table file operation tool (for example, HSSF in POI); if the reception fails, it indicates that the table file is not an Excel file, and a reception failure message for prompting the failure of receiving the file stream is output; wherein, the reception failure message at least includes the exception reason for the failure of receiving the file stream (for example, the suffix name of the table file is incorrect or the naming of the table file name is not standardized), and may also include information such as the name of the table file, so as to prevent the user from accidentally modifying the suffix of the table file during the process of uploading the table file, resulting in the inability to perform subsequent processing; if the reception is successful, proceed to 202 for subsequent processing.
[0067] 202: Convert multiple target data in the above page object, convert to obtain N target entity objects, and obtain M entity attributes including annotation information among the N target entity objects.
[0068] The value of N is the same as the number of multiple target data, and M is an integer greater than 0.
[0069] In this step, since each row in each page (sheet) in Excel is a piece of data, and different columns in each row represent different attributes of the data (such as age, gender, date of birth, class, grades, etc.), therefore, after obtaining the page object of the file stream, it is also necessary to convert multiple target data in the above page object, convert to obtain N target entity objects, and then obtain M entity attributes including annotation information among the N target entity objects, which is convenient for subsequent data sorting processing based on this.
[0070] In some embodiments, each annotation information can be flexibly modified, added, or deleted according to user needs. An annotation information (@ExcelNeed) at least includes the order value (order) of the entity attribute to which the target entity object belongs in the column of the target table, and may also include whether the entity attribute must be non-null.
[0071] 203: Sort the N target entity objects according to the annotation information of each of the above M entity attributes to obtain a target table.
[0072] In some embodiments, sorting the N target entity objects may be as follows: traversing the page object row by row. If the entity attribute to which the first target entity object among the N target entity objects belongs matches the first entity attribute among the M entity attributes, then according to the sequence value in the annotation information of the first entity attribute, determine the column in the target table where the first target entity object is located, and so on, until the entity attributes to which each of the N target entity objects belongs are all matched, and after sorting the arrangement of each target entity object in the target table, it indicates that the data import into the target table is successful. For example, if the entity attribute of the first target entity object is name, and during the matching process, if it is found that the sequence of name in the annotation information is 0, it means that the first target entity object should be located in the first column of the target table.
[0073] In this step, based on the sequence values in each annotation information, each target entity object can be sorted one by one. When the loop of the number of rows of all data in this page object (page) is completed, the entire data processing process is completed, and a target table (data set) composed of entity objects one by one is obtained. Compared with the prior art, if the first column is directly set as name and the second column is set as age, then this data processing method can only read this set table file, and when reading other table files, it is necessary to rewrite the reading method. However, in the embodiment of the present application, in the case of reading other table files, the reading method also needs to be rewritten.
[0074] In the embodiment of the present application, first, the obtained table file is parsed. If a file stream of the table file is parsed, then according to the entity objects in the file stream, the page object in the file stream is obtained; then, multiple target data in the page object are converted to obtain N target entity objects, and M entity attributes including annotation information among the N target entity objects are obtained; finally, according to the annotation information of each of the M entity attributes, the N target entity objects are sorted to obtain a target table. Compared with the prior art, there is no need to perform different processing for different table files. Only the annotation information of the table file needs to be analyzed, and based on this annotation information, the columns of the N target entity objects in the table are sorted, reducing the manual workload, thus improving the efficiency of data processing and also realizing the generality of data processing.
[0075] Based on the above Figure 2 shown process, Figure 3 is a flowchart of a complete data processing method provided by the embodiment of the present application. As Figure 3 shown, this process includes the following steps:
[0076] 301: In response to a user operation of selecting an import key in the user interface, obtain a table file.
[0077] 302: According to the set table file operation tool, parse the table file and determine whether the file stream of the table file is obtained. If so, go to 303; if not, output a parsing failure message for prompting the failure of parsing the table file.
[0078] 303: According to the table file operation tool, receive the file stream and determine whether the file stream is successfully received. If so, go to 304; if not, output a receiving failure message for prompting the failure of receiving the file stream.
[0079] 304: Obtain the page object from the file stream.
[0080] This step is similar to Figure 2 201 in it, and will not be described repeatedly here.
[0081] 305: Convert multiple target data in the page object, convert to obtain N target entity objects, and obtain M entity attributes including annotation information in the N target entity objects.
[0082] This step is similar to Figure 2 202 in it, and will not be described repeatedly here.
[0083] 306: According to the annotation information of each of the M entity attributes, sort the N target entity objects to obtain the target table.
[0084] This step is similar to Figure 2 203 in it, and will not be described repeatedly here.
[0085] Based on the same technical concept, an embodiment of the present application also provides a data processing device, which can implement the process of the above data processing method in the embodiment of the present application.
[0086] Figure 4 It is a schematic structural diagram of a data processing device provided by an embodiment of the present application. As Figure 4 shown, the device includes: a parsing module 401, a conversion module 402, and a processing module 403.
[0087] The parsing module 401 is used to parse the obtained table file. If the file stream of the table file is obtained, obtain the page object from the file stream;
[0088] The conversion module 402 is used to convert multiple target data in the page object, convert to obtain N target entity objects, and obtain M entity attributes including annotation information in the N target entity objects; wherein, the value of N is the same as the number of the multiple target data, and M is an integer greater than 0;
[0089] A processing module 403, configured to sort the N target entity objects according to the annotation information of each of the M entity attributes, so as to obtain a target table.
[0090] In some embodiments of the present application, the parsing module 403 is further configured to:
[0091] If the file stream of the table file is not parsed, output a parsing failure message for prompting the failure of parsing the table file; wherein, the parsing failure message at least includes the exception reason for the failure of parsing the table file.
[0092] In some embodiments of the present application, the parsing module 401 is further configured to:
[0093] Receive the file stream according to a set table file operation tool.
[0094] If the reception fails, output a reception failure message for prompting the failure of receiving the file stream; wherein, the reception failure message at least includes the exception reason for the failure of receiving the file stream.
[0095] In some embodiments of the present application, the parsing module 401 is specifically configured to:
[0096] In response to a user operation of selecting an import key on a user interface, obtain the table file.
[0097] Parse the table file according to the set table file operation tool.
[0098] In some embodiments of the present application, the processing module 403 is specifically configured to:
[0099] Traverse the page object in a row manner. If the entity attribute to which the first target entity object among the N target entity objects belongs matches the first entity attribute among the M entity attributes, determine the column where the first target entity object is located in the target table according to the sequence value in the annotation information of the first entity attribute.
[0100] It should be noted here that the above device provided in the embodiments of the present application can implement all the method steps in the above method embodiments, and can achieve the same technical effects. The same parts and beneficial effects as those in the method embodiments will not be specifically described in this embodiment.
[0101] Based on the same technical concept, an electronic device is further provided in the embodiments of the present application, and the electronic device can implement the functions of the foregoing data processing device.
[0102] Figure 5 It is a schematic structural diagram of the electronic device provided in the embodiments of the present application.
[0103] At least one processor 501 and a memory 502 connected to the at least one processor 501. In the embodiments of the present application, the specific connection medium between the processor 501 and the memory 502 is not limited. Figure 5 In the example, the processor 501 and the memory 502 are connected through a bus 500. The bus 500 is Figure 5 represented by a thick line in the figure. The connection manners between other components are only for illustrative purposes and are not to be construed as limiting. The bus 500 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 5 it is only represented by a thick line in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 501 can also be referred to as a controller, and the name is not limited.
[0104] In the embodiments of the present application, the memory 502 stores instructions executable by the at least one processor 501. By executing the instructions stored in the memory 502, the at least one processor 501 can execute a data processing method described above. The processor 501 can implement Figure 4 the functions of each module in the device shown.
[0105] Among them, the processor 501 is the control center of the device. It can connect various parts of the entire control device through various interfaces and lines. By running or executing the instructions stored in the memory 502 and calling the data stored in the memory 502, various functions of the device and process data, so as to monitor the device as a whole.
[0106] In a possible design, the processor 501 may include one or more processing units. The processor 501 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 can be implemented on the same chip, and in some embodiments, they can also be separately implemented on independent chips.
[0107] The processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit, a field programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of a data processing method disclosed in combination with the embodiments of the present application may be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0108] The memory 502, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The memory 502 may include at least one type of storage medium, for example, it may include flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disc, and so on. The memory 502 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 502 in the embodiments of the present application may also be a circuit or any other device capable of implementing a storage function, for storing program instructions and / or data.
[0109] By designing and programming the processor 501, the code corresponding to the data processing method introduced in the foregoing embodiments can be solidified into the chip, so that the chip can execute Figure 2 the data processing method of the embodiments shown. How to design and program the processor 501 is well-known to those skilled in the art and will not be elaborated here.
[0110] It should be noted here that the above-mentioned general electronic device provided in the embodiments of the present application can implement all the method steps implemented in the above method embodiments and can achieve the same technical effects. The same parts and beneficial effects as those in the method embodiments will not be specifically elaborated in this embodiment.
[0111] The embodiments of the present application also provide a computer-readable storage medium storing computer-executable instructions for causing a computer to execute a data processing method in the above embodiments.
[0112] The embodiments of the present application also provide a computer program product, which, when called by a computer, causes the computer to execute a data processing method in the above embodiments.
[0113] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0114] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0115] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means for implementing the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
[0116] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the specified functions in Figure 1 one flow or multiple flows and / or blocks Figure 1 one block or multiple blocks.
Claims
1. A data processing method, characterized in that, comprising: Parsing the obtained tabular file, and if the file stream of the tabular file is parsed, obtaining a page object from the file stream; Converting multiple target data in the page object to obtain N target entity objects, and obtaining M entity attributes including annotation information in the N target entity objects; wherein, the value of N is the same as the number of the multiple target data, and M is an integer greater than 0; Sorting the N target entity objects according to the annotation information of each of the M entity attributes to obtain a target table.
2. The method according to claim 1, characterized in that, the method further comprises: If the file stream of the tabular file is not parsed, outputting a parsing failure message for prompting the parsing failure of the tabular file; wherein, the parsing failure message at least includes the exception reason for the parsing failure of the tabular file.
3. The method according to claim 1, characterized in that, The sorting the N target entity objects according to the annotation information of each of the M entity attributes includes: Traversing the page object in a row manner, and if the entity attribute to which the first target entity object in the N target entity objects belongs matches the first entity attribute in the M entity attributes, determining the column where the first target entity object is located in the target table according to the sequence value in the annotation information of the first entity attribute.
4. The method according to claim 1, characterized in that, Before obtaining the page object from the file stream, further comprising: Receiving the file stream according to a set tabular file operation tool; If the reception fails, outputting a reception failure message for prompting the reception failure of the file stream; wherein, the reception failure message at least includes the exception reason for the reception failure of the file stream.
5. The method according to any one of claims 1-4, characterized in that, The parsing the obtained tabular file includes: Responding to a user operation of selecting an import key in a user interface to obtain the tabular file; Parsing the tabular file according to the set tabular file operation tool.
6. A data processing device, characterized in that, comprising: A parsing module for parsing the obtained tabular file, and if the file stream of the tabular file is parsed, obtaining a page object from the file stream; A conversion module for converting multiple target data in the page object to obtain N target entity objects, and obtaining M entity attributes including annotation information in the N target entity objects; wherein, the value of N is the same as the number of the multiple target data, and M is an integer greater than 0; A processing module for sorting the N target entity objects according to the annotation information of each of the M entity attributes to obtain a target table.
7. The device according to claim 6, characterized in that, the parsing module is further used for: If the file stream of the table file cannot be parsed, an analysis failure message for prompting the failure of parsing the table file is output; wherein, the analysis failure message at least includes the exception reason for the failure of parsing the table file.
8. The apparatus according to claim 6, wherein, the processing module is specifically configured to: Traverse the page object in a row manner. If the entity attribute to which the first target entity object among the N target entity objects belongs matches the first entity attribute among the M entity attributes, determine the column in the target table where the first target entity object is located according to the sequence value in the annotation information of the first entity attribute.
9. An electronic device, wherein, comprising: a memory for storing a computer program; a processor for implementing the method steps according to any one of claims 1-5 when executing the computer program stored on the memory.
10. A computer-readable storage medium, wherein, the computer-readable storage medium stores a computer program, and the computer program realizes the method steps according to any one of claims 1-5 when executed by a processor.