Data processing method, device, computer equipment and storage medium

By calculating the index of the item to be generated and quickly searching for the item to generate data, the problem of low data processing efficiency caused by Cartesian product operation is solved, and efficient report generation is achieved.

CN114676675BActive Publication Date: 2024-10-18KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210300046.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-25
Publication Date
2024-10-18
Estimated Expiration
2042-03-25

AI Technical Summary

Technical Problem

When existing data processing methods process big data, Cartesian product operations cause excessive time consumption, resulting in low data processing efficiency.

Method used

By obtaining the identifier of the item to be generated corresponding to the report to be generated, calculating the amount of generated data and the number of rows, and using index calculation to generate the row code to be generated, the target report can be quickly found and generated.

Benefits of technology

It improves the efficiency of data processing, simplifies index calculation, and reduces the time consumption of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114676675B_ABST
    Figure CN114676675B_ABST
Patent Text Reader

Abstract

The present application relates to a data processing method, device, and computer equipment, which are applicable to various scenarios involving reports, such as report generation in an ERP system. The method includes: determining the number of generated data types identified by the item to be generated and performing a row number calculation to obtain the total number of rows in the report; performing a generated data volume calculation based on the total number of rows in the report and the number of generated data types to obtain the generated data volume of the generated data type; obtaining the row code to be generated of the item to be generated, performing an index calculation based on the total number of rows in the report, the row code to be generated, and the generated data volume to obtain the index of the row code to be generated; determining the row generation data of the row code to be generated from the data based on the index of the row code to be generated, traversing the rows to be generated of the row code to be generated based on the item to be generated, and obtaining the item generation data of the item to be generated; generating a target report based on the item generation data of the item to be generated. The use of this method can improve the efficiency of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] With the development of computer technology, report data processing technology has emerged. Report data processing usually sorts and combines two or more sets of data in a certain order. The existing data processing uses Cartesian product to combine and sort multiple sets of data in ordered pairs. Cartesian product refers to the Cartesian product of two sets A and B, also known as direct product. The elements in A are the first elements and the elements in B are the second elements to form ordered pairs. The set composed of all such ordered pairs is called the Cartesian product of A and B, denoted as AxB. For example, assuming that set A = {a, b} and set B = {0, 1, 2}, the Cartesian product of the two sets is {(a, 0), (a, 1), (a, 2), (b, 0), (b, 1), (b, 2)}. However, when the amount of data is large, the Cartesian product operation takes too long, resulting in low data processing efficiency. Summary of the invention

[0003] Based on this, it is necessary to provide a data processing method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve data processing efficiency in response to the above technical problems.

[0004] In a first aspect, the present application provides a data processing method. The method comprises:

[0005] Obtaining an identifier of an item to be generated corresponding to the report to be generated, obtaining corresponding item data to be generated based on the identifier of the item to be generated, and determining the number of generated data types corresponding to the identifier of the item to be generated based on the data of the item to be generated;

[0006] Calculate the number of rows based on the number of generated data types corresponding to the item identifiers to be generated to obtain the total number of rows in the report, and calculate the amount of generated data based on the total number of rows in the report and the number of generated data types corresponding to the item identifiers to be generated to obtain the amount of generated data of the generated data types corresponding to the item identifiers to be generated;

[0007] Obtain the row code to be generated corresponding to the item identifier to be generated, perform index calculation based on the row code to be generated and the amount of generated data, and obtain the index of the item identifier to be generated corresponding to the row code to be generated;

[0008] Determine the item generation data from the to-be-generated item data corresponding to the to-be-generated item identification according to the to-be-generated item identification index;

[0009] A target report is generated based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data.

[0010] In one embodiment, index calculation is performed based on the row code to be generated and the amount of generated data to obtain the to-be-generated item identification index corresponding to the row code to be generated, including:

[0011] Traverse each to-be-generated item ID, and perform the following processing for the traversed to-be-generated item ID:

[0012] Determine the relative total number of rows based on the traversed identifiers of items to be generated;

[0013] An index calculation is performed based on the relative total number of rows, the row code to be generated and the amount of generated data corresponding to the traversed item identifier to be generated, to obtain an index of the item identifier to be generated corresponding to the row code to be generated.

[0014] In one embodiment, the to-be-generated item identifiers include a start item identifier and a non-start item identifier; and determining the relative total number of rows based on the traversed to-be-generated item identifiers includes:

[0015] When the traversed item identifier to be generated is the start item identifier, the total number of rows in the report is used as the relative total number of rows;

[0016] When the traversed item identifier to be generated is a non-starting item identifier, the amount of generated data corresponding to the previous item identifier to be generated of the traversed item identifier to be generated is taken as the relative total number of rows.

[0017] In one embodiment, the amount of generated data is calculated based on the total number of rows in the report and the number of generated data types corresponding to the to-be-generated item identifiers to obtain the amount of generated data of the generated data types corresponding to the to-be-generated item identifiers, including:

[0018] Calculate the ratio of the total number of rows in the report to the number of generated data types corresponding to the item identifier to be generated, and obtain the generated data volume of the generated data type corresponding to the item identifier to be generated;

[0019] Based on the relative total number of rows, the row code to be generated, and the amount of generated data corresponding to the traversed item identifier to be generated, an index of the item identifier to be generated corresponding to the row code to be generated is obtained, including:

[0020] Perform a remainder operation based on the relative total number of rows and the row code to be generated to obtain a remainder;

[0021] The ratio of the remainder to the amount of generated data corresponding to the traversed item identifier to be generated is calculated to obtain the item identifier index to be generated corresponding to the row code to be generated.

[0022] In one of the embodiments, the item identifiers to be generated include calculation item identifiers and non-calculation item identifiers;

[0023] The number of rows is calculated based on the number of generated data types corresponding to the item identifier to be generated, and the total number of rows in the report is obtained, including:

[0024] Get the number of generated data types corresponding to each non-calculated item identifier in the item identifier to be generated;

[0025] The total number of report rows is obtained by multiplying the number of generated data types corresponding to each non-calculated item identifier.

[0026] In one of the embodiments, the item identifiers to be generated include calculation item identifiers and non-calculation item identifiers;

[0027] Before generating the target report based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data, the method further includes:

[0028] Obtaining calculation item generation data corresponding to the calculation item identifier, the calculation item generation data including various sub-data;

[0029] Calculate each sub-data according to the preset operation rules to obtain the target calculation item generation data corresponding to the calculation item identifier;

[0030] Based on the non-calculation item generation data corresponding to the non-calculation item identifier and the target calculation item generation data corresponding to the calculation item identifier, the item generation data is obtained.

[0031] In one embodiment, generating a target report based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data includes:

[0032] The current cell to be filled in the target report is determined based on the to-be-generated item identifier corresponding to the item generation data and the to-be-generated row code corresponding to the item generation data, and the item generation data is filled into the current cell to be filled.

[0033] In a second aspect, the present application also provides a data processing device. The device comprises:

[0034] An acquisition module, used for acquiring an identifier of an item to be generated corresponding to the report to be generated, acquiring corresponding item data to be generated based on the identifier of the item to be generated, and determining the number of generated data types corresponding to the identifier of the item to be generated based on the data of the item to be generated;

[0035] A generated data volume calculation module is used to calculate the number of rows based on the number of generated data types corresponding to the item identifiers to be generated, to obtain the total number of rows in the report, and to calculate the generated data volume based on the total number of rows in the report and the number of generated data types corresponding to the item identifiers to be generated, to obtain the generated data volume of the generated data types corresponding to the item identifiers to be generated;

[0036] An index calculation module is used to obtain the row code to be generated corresponding to the item identifier to be generated, perform index calculation based on the row code to be generated and the amount of generated data, and obtain the index of the item identifier to be generated corresponding to the row code to be generated;

[0037] A generating module, used for determining row generation data corresponding to the row code to be generated from the item data to be generated based on the index corresponding to the row code to be generated, traversing the row to be generated corresponding to the row code to be generated based on the item identifier to be generated, and obtaining item generation data corresponding to the item identifier to be generated;

[0038] The report generation module is used to generate a target report based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data.

[0039] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0040] Obtaining an identifier of an item to be generated corresponding to the report to be generated, obtaining corresponding item data to be generated based on the identifier of the item to be generated, and determining the number of generated data types corresponding to the identifier of the item to be generated based on the data of the item to be generated;

[0041] Calculate the number of rows based on the number of generated data types corresponding to the item identifiers to be generated to obtain the total number of rows in the report, and calculate the amount of generated data based on the total number of rows in the report and the number of generated data types corresponding to the item identifiers to be generated to obtain the amount of generated data of the generated data types corresponding to the item identifiers to be generated;

[0042] Obtain the row code to be generated corresponding to the item identifier to be generated, perform index calculation based on the row code to be generated and the amount of generated data, and obtain the index of the item identifier to be generated corresponding to the row code to be generated;

[0043] Determine item generation data from the to-be-generated item data corresponding to the to-be-generated item identification according to the to-be-generated item identification index;

[0044] A target report is generated based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data.

[0045] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0046] Obtaining an identifier of an item to be generated corresponding to the report to be generated, obtaining corresponding item data to be generated based on the identifier of the item to be generated, and determining the number of generated data types corresponding to the identifier of the item to be generated based on the data of the item to be generated;

[0047] Calculate the number of rows based on the number of generated data types corresponding to the item identifiers to be generated to obtain the total number of rows in the report, and calculate the amount of generated data based on the total number of rows in the report and the number of generated data types corresponding to the item identifiers to be generated to obtain the amount of generated data of the generated data types corresponding to the item identifiers to be generated;

[0048] Obtain the row code to be generated corresponding to the item identifier to be generated, perform index calculation based on the row code to be generated and the amount of generated data, and obtain the index of the item identifier to be generated corresponding to the row code to be generated;

[0049] Determine item generation data from the to-be-generated item data corresponding to the to-be-generated item identification according to the to-be-generated item identification index;

[0050] A target report is generated based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data.

[0051] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0052] Obtaining an identifier of an item to be generated corresponding to the report to be generated, obtaining corresponding item data to be generated based on the identifier of the item to be generated, and determining the number of generated data types corresponding to the identifier of the item to be generated based on the data of the item to be generated;

[0053] Calculate the number of rows based on the number of generated data types corresponding to the item identifiers to be generated to obtain the total number of rows in the report, and calculate the amount of generated data based on the total number of rows in the report and the number of generated data types corresponding to the item identifiers to be generated to obtain the amount of generated data of the generated data types corresponding to the item identifiers to be generated;

[0054] Obtain the row code to be generated corresponding to the item identifier to be generated, perform index calculation based on the row code to be generated and the amount of generated data, and obtain the index of the item identifier to be generated corresponding to the row code to be generated;

[0055] Determine item generation data from the to-be-generated item data corresponding to the to-be-generated item identification according to the to-be-generated item identification index;

[0056] A target report is generated based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data.

[0057] The above-mentioned data processing method, device, computer equipment, storage medium and computer program product perform index calculation through the total number of report lines, the line code to be generated and the amount of generated data to obtain the index of the item identification to be generated corresponding to the line code to be generated, thereby obtaining the corresponding number of items to be generated in the generated item identification according to the index of the item identification to be generated, and searching for the corresponding item generation data, and generating a target report according to the item generation data, the item identification to be generated corresponding to the item generation data and the line code to be generated corresponding to the item generation data. By calculating the index corresponding to the item to be generated and quickly searching for the item generation data corresponding to the item identification to be generated according to the index, the target report can be quickly generated according to the found item generation data, that is, the efficiency of data processing is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] Figure 1 An application environment diagram of a data processing method in an embodiment;

[0059] Figure 2 is a flow chart of a data processing method in one embodiment;

[0060] Figure 3 A schematic diagram of a process for determining a relative total number of rows in one embodiment;

[0061] Figure 4 A schematic diagram of a flow chart of index calculation in one embodiment;

[0062] Figure 5 A schematic diagram of a process for obtaining target calculation item generation data in one embodiment;

[0063] Figure 6 A schematic diagram of a target report in an embodiment;

[0064] Figure 7 A schematic diagram of a cycle for generating a report in one embodiment;

[0065] Figure 8a A schematic diagram of a Cartesian cycle provided for related art;

[0066] Figure 8b A schematic diagram of a Cartesian cycle provided for related art;

[0067] Figure 8c A schematic diagram of a recursive scheme provided for the related art;

[0068] Figure 8d A schematic diagram of generating a target report in an embodiment;

[0069] Fig. 9 is a structural block diagram of a data processing device in one embodiment;

[0070] Fig.10is an internal structure diagram of a computer device in one embodiment;

[0071] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION

[0072] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0073] The embodiments of the present application can be applicable to various systems involving reports, including but not limited to enterprise resource planning (ERP) systems, production management systems, supply chain systems, personnel systems, financial systems, tax systems and audit systems.

[0074] The data processing method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown, the terminal 102 communicates with the server 104 through a network. The data storage system can store data that the server 104 needs to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The server 104 obtains the to-be-generated item identifier corresponding to the to-be-generated report sent by the terminal 102, obtains the corresponding to-be-generated item data based on the to-be-generated item identifier, and determines the number of generated data types corresponding to the to-be-generated item identifier based on the to-be-generated item data; the server 104 calculates the number of rows based on the number of generated data types corresponding to the to-be-generated item identifier to obtain the total number of rows in the report, calculates the amount of generated data based on the number of generated data types corresponding to the to-be-generated item identifier, and obtains the amount of generated data of the generated data type corresponding to the to-be-generated item identifier; the server 104 obtains the to-be-generated row code corresponding to the to-be-generated item identifier, performs index calculation based on the total number of rows in the report, the to-be-generated row code and the amount of generated data, and obtains the to-be-generated item identifier index corresponding to the to-be-generated row code; the server 104 determines the item generation data from the to-be-generated item data corresponding to the to-be-generated item identifier according to the to-be-generated item identifier index; the server 104 generates the target report based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data. The server 104 can return the target report to the terminal 102 and display the target report on the terminal 102. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented as an independent server or a server cluster composed of multiple servers. The embodiment of the present application can also be implemented locally on the terminal 102.

[0075] In one embodiment, Figure 2 As shown, a data processing method is provided, which is applied to Figure 1 The server in the example is used to illustrate the following steps:

[0076] Step 202 : obtaining an identifier of an item to be generated corresponding to the report to be generated, obtaining corresponding item data to be generated based on the identifier of the item to be generated, and determining the number of generated data types corresponding to the identifier of the item to be generated based on the data to be generated.

[0077] Among them, the report to be generated refers to the report to be generated that is generated by the terminal in response to the user's operation on report generation, including the identifier of the item to be generated selected by the user. The identifier of the item to be generated refers to the identifier of the report item in the report to be generated, and can be a column identifier in the report to be generated. The identifier of the item to be generated can be one or more. The data of the item to be generated refers to the data information corresponding to the identifier of the item to be generated pre-stored in the data storage system of the server. The generated data type refers to the type of the data of the item to be generated corresponding to the identifier of the item to be generated, the same data is of the same type, and different data is of different types. The number of generated data types refers to the number of types in the data of the item to be generated corresponding to the identifier of the item to be generated.

[0078] Specifically, the terminal generates a report to be generated in response to a user's click event on report generation, and sends the generated report to be generated to the server, and the server obtains an identifier of the item to be generated in the report to be generated; obtains corresponding data of the item to be generated in the data storage system according to the identifier of the item to be generated, and then determines the number of different data of the item to be generated according to the data in the item to be generated data, and obtains the number of generated data types.

[0079] Step 204, calculate the number of rows based on the number of generated data types corresponding to the item identifiers to be generated to obtain the total number of rows in the report, calculate the amount of generated data based on the total number of rows in the report and the number of generated data types corresponding to the item identifiers to be generated to obtain the amount of generated data corresponding to the generated data types corresponding to the item identifiers to be generated.

[0080] The total number of report rows refers to the total number of rows in the target report, which is used to calculate the index corresponding to the item identifier to be generated in the report to be generated. The amount of generated data refers to the number of occurrences of the same data corresponding to the generated data type, which is used as the index calculation parameter corresponding to the item identifier to be generated.

[0081] Specifically, the server calculates the total number of rows in the report based on the number of data types of items to be generated corresponding to the item identifiers to be generated, wherein the number of data types of items to be generated corresponding to different item identifiers to be generated is different, and there is at least one item identifier to be generated in the report to be generated. When there is only one item identifier to be generated, the number of data types of items to be generated corresponding to the item identifier to be generated is directly used as the total number of rows in the report, and when there are more than two item identifiers to be generated, the total number of rows in the report is obtained by calculating based on the number of data types of items to be generated corresponding to each item identifier to be generated. The server obtains the number of generated data types corresponding to the item identifiers to be generated in the report to be generated, and calculates the amount of generated data based on the total number of rows in the report and the number of generated data types corresponding to the item identifiers to be generated in the report to be generated, and obtains the amount of generated data of the generated data types corresponding to the item identifiers to be generated in the report to be generated.

[0082] Step 206, obtaining the row code to be generated corresponding to the item identifier to be generated, performing index calculation based on the row code to be generated and the amount of generated data, and obtaining the index of the item identifier to be generated corresponding to the row code to be generated.

[0083] The row code to be generated refers to the serial number of the row to be generated in the report to be generated. The index is a numerical value used to indicate the association between the data to be generated in the report to be generated and the item data to be generated, and the item identifier to be generated corresponding to the data to be generated in the report to be generated is consistent with the item identifier to be generated corresponding to the associated item data to be generated. The item identifier index to be generated refers to the index of the data corresponding to the row code to be generated and the item identifier to be generated in the report to be generated, and is used to determine the data corresponding to the item identifier to be generated.

[0084] Specifically, the server obtains the row code to be generated corresponding to the item identifier to be generated, and performs index calculation according to the row code to be generated and the amount of generated data, so as to obtain the index corresponding to the row code to be generated and the item identifier to be generated in the report to be generated. When there are multiple item identifiers to be generated in the report to be generated, the server can also perform index calculation according to each row code to be generated and the amount of generated data corresponding to each item identifier to be generated, so as to obtain the indexes corresponding to all the row codes to be generated and all the item identifiers to be generated in the report to be generated.

[0085] It is worth noting that, for each to-be-generated item identification index, it corresponds to a to-be-generated row code and to a to-be-generated item identification.

[0086] Step 208: determining the item generation data from the to-be-generated item data corresponding to the to-be-generated item identification according to the to-be-generated item identification index.

[0087] The item generation data refers to the data found in the item data to be generated according to the index. In the report to be generated, the item generation data corresponds to the item identifier to be generated and the row code to be generated.

[0088] Specifically, the server determines the item generation data from the item data to be generated corresponding to the item identifier to be generated according to the index of the item identifier to be generated. When there is only one item identifier to be generated in the report to be generated, each row code to be generated corresponding to the item identifier to be generated is obtained, and the corresponding data is searched and obtained from the data to be generated corresponding to the item identifier to be generated according to the index of the item identifier to be generated corresponding to each row code to be generated, so as to obtain the item generation data corresponding to the item identifier to be generated. When there are multiple item identifiers to be generated in the report to be generated, the server can traverse the index of the item identifier to be generated corresponding to each item identifier to be generated according to the row code to be generated, search for the corresponding data from the data to be generated corresponding to each item identifier to be generated, and obtain the item generation data of each item identifier to be generated corresponding to the row code to be generated. Then the server traverses the index of each item identifier to be generated corresponding to each row code to be generated, and obtains the item generation data corresponding to each item identifier to be generated. The server can also traverse the index of the item identifier to be generated corresponding to each row code to be generated according to the item identifier to be generated, and then traverse the index of each item identifier to be generated corresponding to each item identifier to be generated, and obtain the item generation data corresponding to each item identifier to be generated.

[0089] Step 210 : Generate a target report based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data.

[0090] The target report refers to a report generated based on item-generated data.

[0091] Specifically, the server generates a target report based on the correspondence between the item identifier to be generated corresponding to the item generation data, the row code to be generated corresponding to the item generation data, and the item generation data. The server may include cells to be filled. After calculating the index of a cell to be filled, the server may fill the cell to be filled with the item generation data found according to the index, until all cells to be filled are filled with the item generation data to obtain the target report. The server may also calculate the index of each cell to be filled, and fill each item generation data found according to each index into the corresponding cell to be filled at the same time to generate the target report. The server may then send the target report to the terminal for display.

[0092] The above data processing method performs index calculation through the total number of rows in the report, the row code to be generated and the amount of generated data, and obtains the index of the item identification to be generated corresponding to the row code to be generated, thereby obtaining the corresponding number of items to be generated in the generated item identification according to the index of the item identification to be generated, and searching for the corresponding item generation data, and generating a target report according to the item generation data, the item identification to be generated corresponding to the item generation data and the row code to be generated corresponding to the item generation data. By calculating the index corresponding to the item to be generated, and quickly searching for the item generation data corresponding to the item identification to be generated according to the index, the target report can be quickly generated through the found item generation data, that is, the efficiency of data processing is improved.

[0093] In one embodiment, step 206, performing index calculation based on the row code to be generated and the amount of generated data to obtain the to-be-generated item identification index corresponding to the row code to be generated, includes:

[0094] Traverse each to-be-generated item ID, and perform the following processing for the traversed to-be-generated item ID:

[0095] Determine the relative total number of rows based on the traversed identifiers of items to be generated;

[0096] An index calculation is performed based on the relative total number of rows, the row code to be generated and the amount of generated data corresponding to the traversed item identifier to be generated, to obtain an index of the item identifier to be generated corresponding to the row code to be generated.

[0097] The relative total number of rows is used to indicate the total number of rows corresponding to different to-be-generated item identifiers, and the relative total number of rows corresponding to different to-be-generated item identifiers is different. The relative total number of rows can be used as a calculation parameter for calculating the index corresponding to each to-be-generated item identifier.

[0098] Specifically, the relative total number of rows can be represented by the amount of generated data corresponding to each item identifier to be generated. The server traverses each item identifier to be generated, and determines the relative total number of rows corresponding to each item identifier to be generated from the amount of generated data corresponding to each item identifier to be generated according to the front-to-back order between each item identifier to be generated. Then the server traverses the relative total number of rows corresponding to each item identifier to be generated, the row code to be generated, and the amount of generated data to perform index calculation, and obtains the index of each item identifier to be generated corresponding to the row code to be generated.

[0099] In one embodiment, if Figure 3 As shown, a flow chart of determining a relative total number of rows is provided; the item identifier to be generated includes a starting item identifier and a non-starting item identifier; determining the relative total number of rows based on the traversed item identifiers to be generated includes:

[0100] Step 302, when the traversed item identifier to be generated is the start item identifier, the total number of rows in the report is used as the relative total number of rows;

[0101] Step 304: when the traversed item identifier to be generated is a non-starting item identifier, the amount of generated data corresponding to the previous item identifier to be generated of the traversed item identifier to be generated is taken as the relative total number of rows.

[0102] The start item ID refers to the first item ID to be generated in the report to be generated, and the non-start item ID refers to the item IDs to be generated other than the first item ID to be generated.

[0103] Specifically, when the server traverses each item identifier to be generated and determines the relative total number of rows, the amount of generated data corresponding to the item identifier to be generated is calculated and the calculation starts from the first item identifier to be generated, the total number of rows of the report corresponding to the first item identifier to be generated is used as the relative total number of rows corresponding to the first item identifier to be generated, and the relative total number of rows corresponding to the first item identifier to be generated and the number of generated data types corresponding to the first item identifier to be generated are used to calculate the amount of generated data, and the amount of generated data of the generated data type corresponding to the first item identifier to be generated is obtained, that is, the amount of generated data corresponding to the first item identifier to be generated. When the item identifier to be generated traversed by the server is a non-starting item identifier, the amount of generated data corresponding to the previous item identifier to be generated of the traversed item identifier to be generated is used as the relative total number of rows. For example, when the item identifier to be generated traversed is the second item identifier to be generated, the amount of generated data corresponding to the first item identifier to be generated is used as the relative total number of rows corresponding to the second item identifier to be generated, and the amount of generated data is calculated according to the relative total number of rows corresponding to the second item identifier to be generated and the number of generated data types, and the amount of generated data of the generated data type corresponding to the second item identifier to be generated is obtained, that is, the amount of generated data corresponding to the second item identifier to be generated. When the server calculates the amount of generated data corresponding to the third item identifier to be generated, the amount of generated data corresponding to the second item identifier to be generated is used as the relative total number of rows corresponding to the third item identifier to be generated, and the step of calculating the amount of generated data according to the relative total number of rows and the number of generated data types corresponding to the currently executed item identifier to be generated is repeated to obtain the amount of generated data corresponding to the currently executed item identifier to be generated. Similarly, by traversing each item identifier to be generated, the amount of generated data of the generated data types corresponding to each item identifier to be generated can be obtained.

[0104] The server performs index calculations corresponding to each item identifier to be generated, and uses the item identifier to be generated in progress as the current item identifier to be generated. The current row code to be generated corresponding to the current item identifier to be generated is obtained, and the relative total number of rows and the current row code to be generated are modulo calculated to obtain the remainder; then the ratio of the remainder to the amount of generated data corresponding to the current item identifier to be generated is calculated to obtain the index corresponding to the current item identifier to be generated and the current row code to be generated. Similarly, the indexes corresponding to each row code to be generated and each item identifier to be generated are obtained. The index corresponding to the last item identifier to be generated can be obtained by performing a modulo calculation on the row code to be generated and the data of the generated data type corresponding to the item identifier to be generated. In this embodiment, the total number of rows corresponding to the non-starting item identifier is obtained based on the total number of rows in the report, and then the index calculation is performed to obtain the index corresponding to the non-starting item identifier, which simplifies the index calculation of the non-starting item identifier, thereby improving the processing efficiency of the report data.

[0105] In one embodiment, if Figure 4 As shown, a schematic diagram of the process of index calculation is provided; step 204, based on the total number of report rows and the number of generated data types corresponding to the item identifier to be generated, the generated data volume is calculated to obtain the generated data volume of the generated data type corresponding to the item identifier to be generated, including:

[0106] Step 402, calculating the ratio of the total number of rows in the report to the number of generated data types corresponding to the item identifier to be generated, and obtaining the generated data volume of the generated data type corresponding to the item identifier to be generated;

[0107] Based on the relative total number of rows, the row code to be generated, and the amount of generated data corresponding to the traversed item identifier to be generated, an index of the item identifier to be generated corresponding to the row code to be generated is obtained, including:

[0108] Step 404, performing a remainder operation based on the relative total number of rows and the row code to be generated to obtain a remainder;

[0109] Step 406, calculate the ratio of the remainder to the amount of generated data corresponding to the traversed to-be-generated item identifier, and obtain the to-be-generated item identifier index corresponding to the to-be-generated row code.

[0110] Specifically, the server starts to traverse each item identifier to be generated, takes the total number of rows in the report as the relative total number of rows, and takes the amount of generated data corresponding to the previous item identifier to be generated of the traversed item identifier to be generated as the relative total number of rows. Calculate the ratio of the relative total number of rows to the number of generated data types corresponding to the item identifier to be generated, and obtain the amount of generated data of the generated data type corresponding to each item identifier to be generated. The server performs a modulo operation on the relative total number of rows and the row code to be generated to obtain a remainder. The row code to be generated can be sorted in ascending order starting from 0, and then calculate the ratio of the remainder to the amount of generated data to obtain the index corresponding to the row code to be generated. The index is used to indicate the number of data in the data to be generated corresponding to the item identifier to be generated. For example, if the total number of rows in the report is 8, the row code to be generated is 0, and the amount of generated data is 4, then the remainder is calculated to be 0, that is, 0%8; then the index corresponding to the row code to be generated of the starting item identifier is calculated to be 0, that is, 0 / 4. Then the index 0 represents the first data in the data to be generated corresponding to the starting item identifier, that is, the data of the first row corresponding to the starting item identifier in the report to be generated is the first data in the data to be generated corresponding to the starting item identifier, and the row code to be generated corresponding to the starting item identifier is 0, which means the first row corresponding to the starting item identifier. In addition, the amount of generated data corresponding to the starting item identifier is used to calculate the index of each row code to be generated corresponding to the non-starting item identifier, as the index calculation parameter corresponding to the non-starting item identifier, and then a remainder operation is performed according to the amount of generated data corresponding to the starting item identifier and the row code to be generated of the non-starting item identifier to obtain the remainder corresponding to the non-starting item identifier, and the ratio of the remainder corresponding to the non-starting item identifier to the amount of generated data is calculated to obtain the index corresponding to the non-starting item identifier and the row code to be generated. In this embodiment, the corresponding index value can be obtained by the remainder operation and index calculation, and the operation steps of the index calculation are simplified, thereby improving the processing efficiency of the report data.

[0111] In one of the embodiments, the item identifiers to be generated include calculation item identifiers and non-calculation item identifiers;

[0112] Step 204, calculating the number of rows based on the number of generated data types corresponding to the item identifiers to be generated, to obtain the total number of rows in the report, including:

[0113] Get the number of generated data types corresponding to each non-calculated item identifier in the item identifier to be generated;

[0114] The total number of report rows is obtained by multiplying the number of generated data types corresponding to each non-calculated item identifier.

[0115] Among them, the calculation item identifier refers to the item identifier to be generated that needs to be calculated to obtain the corresponding item generation data. The non-calculation item identifier refers to the item identifier to be generated that can obtain the corresponding item generation data without calculation, and is the item identifier to be generated corresponding to the item generation data that can be found in the item data to be generated.

[0116] Specifically, the server obtains the number of corresponding generated data types in the data storage system according to each non-computational item identifier in the item identifier to be generated. Then, the number of generated data types corresponding to each non-computational item identifier is multiplied to obtain the total number of rows in the report. For example, the non-computational item identifier is personnel, and the server obtains {Zhang San Li Si} in the data storage system according to the personnel, wherein Zhang San and Li Si are the generated data types corresponding to the non-computational item identifier as personnel, and Zhang San and Li Si are data of different name types, then the number of generated data types corresponding to the non-computational item identifier as personnel is 2. If there are 3 non-computational item identifiers, and the number of generated data types corresponding to each non-computational item identifier is 2, then the total number of rows in the report is 8, that is, 2^3 or 2*2*2. In this embodiment, the row number calculation can simplify the calculation steps compared to the Cartesian product operation, and improve the processing efficiency of the report data.

[0117] In one embodiment, Figure 5 As shown, a flow chart of obtaining target calculation item generation data is provided; the item identifier to be generated includes a calculation item identifier and a non-calculation item identifier; step 210, before generating a target report based on the item generation data, the item identifier to be generated corresponding to the item generation data, and the row code to be generated corresponding to the item generation data, further includes:

[0118] Step 502, obtaining the calculation item generation data corresponding to the calculation item identifier, where the calculation item generation data includes various sub-data;

[0119] Step 504, calculating each sub-data according to a preset operation rule to obtain target calculation item generation data corresponding to the calculation item identifier;

[0120] Step 506: Obtain the item generation data based on the non-calculation item generation data corresponding to the non-calculation item identifier and the target calculation item generation data corresponding to the calculation item identifier.

[0121] Among them, the calculation item identifier refers to the report item identifier in the report to be generated that needs to be calculated to obtain data, which can be a calculation item identifier such as amount, time, ratio, etc. The non-calculation item identifier refers to the report item identifier in the report to be generated that can obtain data without calculation, which can be a name item identifier such as personnel name, department name, expense name, etc. The calculation item generation data refers to the data information corresponding to the calculation item identifier, which is data pre-stored in the data storage system of the server. The calculation item generation data includes various sub-data. The sub-data can be data obtained according to different time periods. The preset operation rules are the operation rules for the sub-data, which can be user-defined. The non-calculation item generation data refers to the data that does not need to be calculated obtained from the item generation data according to the non-calculation item identifier, which can be the item generation data determined from the item data to be generated corresponding to the item identifier to be generated according to the index of the item identifier to be generated in step 208.

[0122] Specifically, the server can obtain the calculation item identification in the item identification to be generated, and use the non-calculation item generation data corresponding to the calculation item identification as the query condition to search for the calculation item generation data corresponding to the non-calculation item generation data in the data storage system, and the calculation item generation data includes various sub-data. Then the server calculates each sub-data according to the preset operation rules corresponding to the calculation item identification, and obtains the target calculation item generation data corresponding to the calculation item identification, and the target calculation item generation data corresponds to the non-calculation item generation data. Then the non-calculation item generation data corresponding to the non-calculation item identification and the target calculation item generation data corresponding to the calculation item identification are used as item generation data. The server can generate a target report based on the correspondence between the calculation item identification, the non-calculation item generation data and the target calculation item generation data.

[0123] In a specific embodiment, Figure 6 As shown, a target report diagram is provided, specifically:

[0124] The first line of the target report is the identification of the items to be generated, including non-calculated item identification and calculated item identification, among which personnel, projects, and expenses are non-calculated item identification; Zhang San, Li Si, A, B, electricity charges, water charges, etc. are non-calculated item generation data; Quarter 1, Quarter 2, Quarter 3, and Quarter 4 are calculated item identifications, which are used to calculate the total cost of each quarter. For example, the user presets the calculation rules for the above four quarters as summation operations. When the server performs the calculation for the calculated item identification as Quarter 1, it queries and obtains all the sub-data of Zhang San's electricity charges in Project A in the data storage system according to the query condition that the non-calculated item generation data corresponding to the non-calculated item identification is Zhang San's electricity charges in Project A, which can be the electricity charge values ​​from January to March. Then the server performs summation operations on the obtained electricity charge values ​​from January to March to obtain the corresponding target calculated item generation data for the non-calculated item identification as Zhang San's electricity charges in Project A.

[0125] In this embodiment, by querying and obtaining the corresponding calculated item generated data according to the non-calculated item generated data, and calculating the sub-data in the calculated item generated data according to the preset calculation rules, the target calculated item generated data is obtained, and then the target report is generated. And when the items of the report increase or decrease, the item generated data corresponding to the non-calculated item identifier can be arranged and the item generated data corresponding to the calculated item identifier can be calculated according to the dynamically changing report elements, so as to generate a new report. It can not only meet the user's custom design report calculation rules, but also quickly generate reports, thereby improving the efficiency of data processing and user experience.

[0126] In one embodiment, generating a target report based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data includes:

[0127] The current cell to be filled in the target report is determined based on the to-be-generated item identifier corresponding to the item generation data and the to-be-generated row code corresponding to the item generation data, and the item generation data is filled into the current cell to be filled.

[0128] The cells currently to be filled refer to the cells that currently need to be filled with data when filling the target report.

[0129] Specifically, a cell in the target report can be determined based on an item identifier to be generated and a row code to be generated. In each cell to be filled in the target report, the server determines the cell that currently needs to be filled with data based on the item identifier to be generated and the row code to be generated corresponding to the item generation data, and then fills the item generation data into the cell. Then, the server traverses each cell that needs to be filled with data based on the item identifier to be generated and the row code to be generated corresponding to each item generation data, and fills each item generation data into the corresponding cell to be filled, to obtain the target report. In this embodiment, by filling cells with item generation data, the target report can be quickly obtained, thereby improving data processing efficiency and user experience.

[0130] In a specific embodiment, Figure 7 As shown, a cycle diagram of report generation is provided;

[0131] Wherein, C1, C2, C3, ..., Cn, respectively, represent that the number of generated data types of the first non-calculated item identifier is C1, the number of generated data types of the second non-calculated item identifier is C2, and the number of generated data types of the nth non-calculated item identifier is Cn;

[0132] R=C1*C2*…*Cn represents the total number of rows in the report;

[0133] i represents the row code to be generated, j represents the number of inner loops, and n represents the number of non-calculation item identifiers;

[0134] RowCount represents the relative total number of rows. As a variable, RowCount = R means assigning the total number of rows of the report to the relative total number of rows;

[0135] N represents the amount of generated data corresponding to each generated data type in the current non-calculated item identifier;

[0136] Cj represents the number of generated data types of the current non-calculated item identifier;

[0137] k represents the index, and print("……") means outputting the corresponding data according to the index;

[0138] When the server detects the generation operation of the report to be generated, it obtains the non-calculated item identifier in the identifier of the item to be generated in the report to be generated, and obtains the corresponding data to be generated and the number of generated data types in the data storage system according to the non-calculated item identifier. The number of generated data types of the first non-calculated item identifier is C1, the number of generated data types of the second non-calculated item identifier is C2, and the number of generated data types of the nth non-calculated item identifier is Cn; then the total number of rows of the report is R = C1 * C2 *... * Cn, and the initial code i of the row to be generated is set to 0, the amount of generated data N of the initial non-calculated item identifier is 0, and the initial number of inner loop times j is 0; the server starts to loop: first, it judges the condition of i < R. When the condition i < R (the value of the initial code of the row to be generated is less than the total number of rows of the report) is satisfied, it enters the inner loop of calculating the indexes corresponding to each non-calculated item identifier of the first code of the row to be generated: assigns the total number of rows R of the report to the relative total number of rows RowCount; when the condition j < n (the current number of loop times is less than the number n of non-calculated item identifiers) is satisfied, it calculates the amount of generated data N, that is, N = R / the number of generated data types Cj of the current non-calculated item identifier; then it calculates the index corresponding to the current non-calculated item identifier. The calculated index k is the index corresponding to the code of the first row to be generated of the current non-calculated item identifier, that is, k = (i % RowCount) / N. At this time, the calculated index k is the index corresponding to the code of the first row to be generated of the first non-calculated item identifier, and RowCount = N means assigning the calculated amount of generated data N to the relative total number of rows RowCount;

[0139] After obtaining the index k, the server retrieves the corresponding item according to the index k to generate data, outputs the item generation data, and at the same time increments the inner loop count j by 1. The output item generation data is used to generate the target report; then calculates the index calculation of the next non-calculated item identifier in the first row. At this time, the relative total number of rows RowCount = N, and the calculated index k is the index corresponding to the first row to be generated with the code of the second non-calculated item identifier; when the loop no longer satisfies the condition j < n, it means that the output of the item generation data corresponding to the first row to be generated with the row code is completed. At this time, the first inner loop ends, and the row code i to be generated is incremented by 1. Then enter the outer loop and re-judge the condition i < R;

[0140] When the condition i < R is satisfied, the total number of rows R of the report is re-assigned to the relative total number of rows RowCount, that is, RowCount = R, which means that when calculating the index of the first non-calculated item identifier in the next row after a new line, the relative total number of rows required for calculating the index is the total number of rows of the report. And re-assign the generated data volume N of the non-calculated item identifier to 0, and the initial inner loop count j = 0. Then enter the inner loop for calculating the indexes corresponding to the non-calculated item identifiers of the next row code to be generated, and start calculating and outputting the item generation data corresponding to the non-calculated item identifiers of the next row code to be generated; when the calculation of the index corresponding to the last row code to be generated is completed and the corresponding item generation data is obtained, or the condition i < R is not satisfied, the loop ends, and the target report is obtained.

[0141] In this embodiment, only one large loop is required, that is, through the loop of the row code to be generated and the total number of rows of the report, the target report can be obtained, and during the loop process, the attributes of each row and column in the target report can be quickly bound, that is, attributes such as calculation item identifiers and non-calculation item identifiers. And it can also expand the item identifier to be generated, such as increasing or decreasing the item identifier to be generated, and then perform the loop calculation in this embodiment on the expanded data again, which can quickly and conveniently process the report data to obtain the expanded target report, not only improving the user experience, but also improving the efficiency of data processing.

[0142] For the convenience of understanding, taking the item identifier to be generated as the column identifier as an example, a comparison between the solutions provided by the related technology and the embodiments of the present application is provided. Among them, the related technology mainly provides two solutions, Cartesian loop and traditional recursion, for row and column filling.

[0143] For the Cartesian loop solution, due to the dynamic change of the number of rows and columns, the number of columns is uncertain and the number of elements in each column is uncertain. It is necessary to dynamically calculate all combinations of column elements, such as Figure 8a As shown, since the number of columns is not fixed, the expression in the code cannot be determined, making it difficult to construct the report and having poor performance. When calculating, it is necessary to continuously use for loops. For example, the result of the first for loop is used as the input for the second for loop, and the loop ends in turn, as Figure 8b Therefore, the Cartesian loop solution is not easy to implement, has poor performance, poor applicability, and low processing and expansion capabilities for subsequent calculation columns or data columns.

[0144] For traditional recursive solutions, the inheritance relationship between rows and columns is calculated first, and recursion is repeated from the highest level to the lowest level. During the recursive process, only one object value is taken at each node, and then the next node is recursed. When the recursion reaches the lowest level, the recorded value in the process is written to the result list. When the system recurses all nodes, the final recorded result is the row and column report style, and then it is printed out again in a loop, or the corresponding business logic is added to complete the calculation, such as Figure 8c The traditional recursive solution is implemented by traversal, which has poor applicability, requires multiple loops, and has poor performance.

[0145] In contrast, in the embodiment of the present application, by looping once, all row and column combination results can be determined by judging the data row. In this process, it is convenient to bind the attributes of each row and column, which is easy to expand and convenient for calculating and processing report data. In order to facilitate the technical effect of the embodiment of the present application, the code time consumption for filling rows and columns through different schemes for the same data is shown in Table 1.

[0146] Table 1

[0147] plan Data volume Performance (measured in time) Cartesian loop solution 100W 1 minute 31 seconds Traditional recursive solution 100W 1 minute 38 seconds Embodiments of the present application 100W 1 minute 28 seconds

[0148] In the field of data processing (especially the field of big data), technology has entered a mature stage, so a performance improvement of a few seconds often means a huge technological breakthrough. According to Table 1, it can be concluded that the data processing performance of the embodiment of the present application is better than the solution provided by the related technology. As the amount of data increases further, the performance gap between the embodiment of the present application and the solution provided by the related technology will further widen.

[0149] For ease of understanding, Figure 8d As shown, a schematic diagram of generating a target report based on an embodiment of the present application is provided;

[0150] When there are 3 item identifiers to be generated, the number of generated data types for each item identifier to be generated is 2, namely A{A1,A2}, B{B1,B2}, C{C1,C2}, then the total number of rows in the report is 2*2*2, which is 8; start the loop, when the loop reaches the 1st row and the 1st item identifier to be generated A, calculate the ratio of the total number of rows in the report to the number of generated data types, that is, 8 / 2, and get the data generation amount corresponding to A is 4, the row code to be generated in the 1st row is 0, then the index calculation formula corresponding to the 1st row of A is (0%8) / 4, the calculated index is equal to 0, and according to the index 0, the item generation data of the 1st row of A is A1. Then when looping to the second item identifier B to be generated in the first row, the data generation amount corresponding to A is taken as the relative total number of rows of B, and the index calculation corresponding to the first row of B is performed, the calculated index is equal to 0, and according to index 0, the item generation data of the first row of B is B1, and so on, the item generation data of the first row of C is C1, among which, the index of the last item identifier C to be generated can also be calculated by taking the modulo of the current row code to be generated and the number of generated data types; then the index calculation of the second row is performed until the item generation data corresponding to the row code to be generated of each item identifier to be generated is obtained, and the target report is generated.

[0151] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0152] Based on the same inventive concept, the embodiment of the present application also provides a data processing device for implementing the data processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more data processing device embodiments provided below can refer to the limitations on the data processing method above, and will not be repeated here.

[0153] In one embodiment, Fig. 9 As shown, a data processing device 900 is provided, including: an acquisition module 902, a generated data volume calculation module 904, an index calculation module 906, a generation module 908 and a report generation module 910, wherein:

[0154] An acquisition module, used for acquiring an identifier of an item to be generated corresponding to the report to be generated, acquiring corresponding item data to be generated based on the identifier of the item to be generated, and determining the number of generated data types corresponding to the identifier of the item to be generated based on the data of the item to be generated;

[0155] A generated data volume calculation module is used to calculate the number of rows based on the number of generated data types corresponding to the item identifiers to be generated, to obtain the total number of rows in the report, and to calculate the generated data volume based on the total number of rows in the report and the number of generated data types corresponding to the item identifiers to be generated, to obtain the generated data volume corresponding to the generated data types corresponding to the item identifiers to be generated;

[0156] An index calculation module is used to obtain the row code to be generated corresponding to the item identifier to be generated, perform index calculation based on the row code to be generated and the amount of generated data, and obtain the index of the item identifier to be generated corresponding to the row code to be generated;

[0157] A generating module, used for determining the item generation data from the to-be-generated item data corresponding to the to-be-generated item identification according to the to-be-generated item identification index;

[0158] The report generation module is used to generate a target report based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data.

[0159] In one embodiment, the index calculation module 906 includes:

[0160] Multiple index calculation units are used to traverse each item identifier to be generated, and perform the following processing on the traversed item identifier to be generated: determine the relative total number of rows based on the traversed item identifier to be generated; perform index calculation based on the relative total number of rows, the row code to be generated and the amount of generated data corresponding to the traversed item identifier to be generated, and obtain the item identifier index corresponding to the row code to be generated.

[0161] In one embodiment, the index calculation module 906 includes:

[0162] The relative total number of rows determining unit, when the traversed item identifier to be generated is the starting item identifier, takes the total number of rows of the report as the relative total number of rows; when the traversed item identifier to be generated is a non-starting item identifier, takes the amount of generated data corresponding to the previous item identifier to be generated of the traversed item identifier to be generated as the relative total number of rows.

[0163] In one embodiment, generating a data volume calculation module 904 includes:

[0164] The remainder calculation unit is used to calculate the ratio of the total number of rows in the report to the number of generated data types corresponding to the item identifier to be generated, so as to obtain the generated data volume of the generated data type corresponding to the item identifier to be generated; perform index calculation based on the relative total number of rows, the row code to be generated and the generated data volume corresponding to the traversed item identifier to be generated, so as to obtain the index of the item identifier to be generated corresponding to the row code to be generated, including: performing a remainder operation based on the relative total number of rows and the row code to be generated to obtain the remainder; calculate the ratio of the remainder to the generated data volume corresponding to the traversed item identifier to be generated, so as to obtain the index of the item identifier to be generated corresponding to the row code to be generated.

[0165] In one embodiment, generating a data volume calculation module 904 includes:

[0166] The product operation unit is used to obtain the number of generated data types corresponding to each non-calculated item identifier in the item identifier to be generated; perform a product operation based on the number of generated data types corresponding to each non-calculated item identifier to obtain the total number of rows in the report.

[0167] In one embodiment, the data processing device 900 further includes:

[0168] A data generation unit is used to obtain the calculation item generation data corresponding to the calculation item identifier, the calculation item generation data includes various sub-data; calculate each sub-data according to a preset operation rule to obtain the target calculation item generation data corresponding to the calculation item identifier; obtain the item generation data based on the non-calculation item generation data corresponding to the non-calculation item identifier and the target calculation item generation data corresponding to the calculation item identifier.

[0169] In one embodiment, the report generation module 910 includes:

[0170] The filling unit is used to determine the current cell to be filled in the target report based on the to-be-generated item identifier corresponding to the item generation data and the to-be-generated row code corresponding to the item generation data, and fill the item generation data into the current cell to be filled.

[0171] Each module in the above data processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.

[0172] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data to be generated, item identifiers to be generated, and sub-data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data processing method is implemented.

[0173] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a data processing method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0174] Those skilled in the art will understand that Figure 10-11The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0175] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0176] Obtain an identifier of an item to be generated corresponding to the report to be generated, obtain the corresponding item data to be generated based on the identifier of the item to be generated, and determine the number of generated data types corresponding to the identifier of the item to be generated based on the item data to be generated; calculate the number of rows based on the number of generated data types corresponding to the identifier of the item to be generated to obtain the total number of rows in the report, calculate the amount of generated data based on the total number of rows in the report and the number of generated data types corresponding to the identifier of the item to be generated, and obtain the amount of generated data of the generated data type corresponding to the identifier of the item to be generated; obtain a row code to be generated corresponding to the identifier of the item to be generated, perform index calculation based on the row code to be generated and the amount of generated data, and obtain an index of the identifier to be generated corresponding to the row code to be generated; determine the item generation data from the item data to be generated corresponding to the identifier of the item to be generated according to the index of the identifier of the item to be generated; generate a target report based on the item generation data, the identifier of the item to be generated corresponding to the item generation data, and the row code to be generated corresponding to the item generation data.

[0177] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0178] An index calculation is performed based on the row code to be generated and the amount of generated data to obtain an index of the item identifier to be generated corresponding to the row code to be generated, including: traversing each item identifier to be generated, and performing the following processing on the traversed item identifier to be generated: determining a relative total number of rows based on the traversed item identifier to be generated; performing an index calculation based on the relative total number of rows, the row code to be generated and the amount of generated data corresponding to the traversed item identifier to be generated, to obtain an index of the item identifier to be generated corresponding to the row code to be generated.

[0179] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0180] The item identifier to be generated includes a starting item identifier and a non-starting item identifier; the relative total number of rows is determined based on the traversed item identifier to be generated, including: when the traversed item identifier to be generated is a starting item identifier, the total number of rows in the report is used as the relative total number of rows; when the traversed item identifier to be generated is a non-starting item identifier, the amount of generated data corresponding to the previous item identifier to be generated of the traversed item identifier to be generated is used as the relative total number of rows.

[0181] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0182] The amount of generated data is calculated based on the total number of rows in the report and the number of generated data types corresponding to the item identifier to be generated, so as to obtain the amount of generated data of the generated data type corresponding to the item identifier to be generated, including: calculating the ratio of the total number of rows in the report to the number of generated data types corresponding to the item identifier to be generated, so as to obtain the amount of generated data of the generated data type corresponding to the item identifier to be generated; performing index calculation based on the relative total number of rows, the row code to be generated and the amount of generated data corresponding to the traversed item identifier to be generated, so as to obtain the index of the item identifier to be generated corresponding to the row code to be generated, including: performing a remainder operation based on the relative total number of rows and the row code to be generated, so as to obtain a remainder; calculating the ratio of the remainder to the amount of generated data corresponding to the traversed item identifier to be generated, so as to obtain the index of the item identifier to be generated corresponding to the row code to be generated.

[0183] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0184] The item identifiers to be generated include calculated item identifiers and non-calculated item identifiers; the number of rows is calculated based on the number of generated data types corresponding to the item identifiers to be generated to obtain the total number of rows in the report, including: obtaining the number of generated data types corresponding to each non-calculated item identifier in the item identifiers to be generated; and multiplying the number of generated data types corresponding to each non-calculated item identifier to obtain the total number of rows in the report.

[0185] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0186] The item identifier to be generated includes a calculated item identifier and a non-calculated item identifier; before generating the target report based on the item generation data, the item identifier to be generated corresponding to the item generation data and the row code to be generated corresponding to the item generation data, it also includes: obtaining the calculated item generation data corresponding to the calculated item identifier, the calculated item generation data including various sub-data; calculating each sub-data according to preset operation rules to obtain the target calculated item generation data corresponding to the calculated item identifier; obtaining the item generation data based on the non-calculated item generation data corresponding to the non-calculated item identifier and the target calculated item generation data corresponding to the calculated item identifier.

[0187] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0188] Generate a target report based on the item generation data, the item identifier to be generated corresponding to the item generation data, and the row code to be generated corresponding to the item generation data, including: determining the current cell to be filled in the target report based on the item identifier to be generated corresponding to the item generation data and the row code to be generated corresponding to the item generation data, and filling the item generation data into the current cell to be filled.

[0189] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0190] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above-mentioned method embodiments when executed by a processor. It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0191] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0192] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0193] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data processing method, characterized in that: The method comprises: Obtaining an identifier of an item to be generated corresponding to a report to be generated, obtaining corresponding item data to be generated based on the identifier of the item to be generated, and determining the number of generated data types corresponding to the identifier of the item to be generated based on the data of the item to be generated; Calculate the number of rows based on the number of generated data types corresponding to the item identifiers to be generated to obtain the total number of rows in the report, and calculate the amount of generated data based on the total number of rows in the report and the number of generated data types corresponding to the item identifiers to be generated to obtain the amount of generated data of the generated data types corresponding to the item identifiers to be generated; Obtaining a row code to be generated corresponding to the item identifier to be generated, performing index calculation based on the row code to be generated and the amount of generated data, and obtaining an index of the item identifier to be generated corresponding to the row code to be generated; Determine item generation data from the to-be-generated item data corresponding to the to-be-generated item identification according to the to-be-generated item identification index; A target report is generated based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data.

2. The method according to claim 1, characterized in that: The performing index calculation based on the row code to be generated and the amount of generated data to obtain the to-be-generated item identification index corresponding to the row code to be generated includes: Traverse each of the to-be-generated item identifiers, and perform the following processing on the traversed to-be-generated item identifiers: Determine the relative total number of rows based on the traversed item identifiers to be generated; An index calculation is performed based on the relative total number of rows, the row code to be generated and the amount of generated data corresponding to the traversed item identifier to be generated to obtain an index of the item identifier to be generated corresponding to the row code to be generated.

3. The method according to claim 2, characterized in that The identifiers of the items to be generated include the starting item identifiers and the non-starting item identifiers; and determining the relative total number of rows based on the traversed identifiers of the items to be generated includes: When the traversed item identifier to be generated is the start item identifier, the total number of rows in the report is used as the relative total number of rows; When the traversed item identifier to be generated is the non-starting item identifier, the amount of generated data corresponding to the previous item identifier to be generated of the traversed item identifier to be generated is taken as the relative total number of rows.

4. The method according to claim 2, characterized in that: The calculation of the amount of generated data based on the total number of rows of the report and the number of generated data types corresponding to the to-be-generated item identifiers to obtain the amount of generated data of the generated data type corresponding to the to-be-generated item identifiers includes: Calculating the ratio of the total number of rows in the report to the number of the generated data types corresponding to the to-be-generated item identifiers, to obtain the generated data volume of the generated data types corresponding to the to-be-generated item identifiers; The performing index calculation based on the relative total number of rows, the row code to be generated, and the amount of generated data corresponding to the traversed item identifier to be generated to obtain the item identifier to be generated index corresponding to the row code to be generated includes: Perform a remainder operation based on the relative total number of rows and the row code to be generated to obtain a remainder; The ratio of the remainder to the amount of generated data corresponding to the traversed item identifier to be generated is calculated to obtain an index of the item identifier to be generated corresponding to the row code to be generated.

5. The method according to any one of claims 1 to 4, characterized in that: The item identifiers to be generated include calculation item identifiers and non-calculation item identifiers; The calculating the number of rows based on the number of generated data types corresponding to the to-be-generated item identifiers to obtain the total number of rows in the report includes: Obtain the number of generated data types corresponding to each non-calculated item identifier in the item identifier to be generated; A product operation is performed based on the number of generated data types corresponding to each non-calculation item identifier to obtain the total number of rows in the report.

6. The method according to any one of claims 1 to 4, characterized in that: The item identifiers to be generated include calculation item identifiers and non-calculation item identifiers; Before generating a target report based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data, the method further includes: Acquire calculation item generation data corresponding to the calculation item identifier, wherein the calculation item generation data includes various sub-data; Calculate each sub-data according to a preset operation rule to obtain target calculation item generation data corresponding to the calculation item identifier; The item generation data is obtained based on the non-computational item generation data corresponding to the non-computational item identifier and the target calculation item generation data corresponding to the calculation item identifier.

7. The method according to any one of claims 1 to 4, characterized in that: The generating a target report based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data includes: The current cell to be filled in the target report is determined based on the to-be-generated item identifier corresponding to the item generation data and the to-be-generated row code corresponding to the item generation data, and the item generation data is filled into the current cell to be filled.

8. A data processing device, characterized in that: The device comprises: An acquisition module, configured to acquire an identifier of an item to be generated corresponding to a report to be generated, acquire corresponding item data to be generated based on the identifier of the item to be generated, and determine the number of generated data types corresponding to the identifier of the item to be generated based on the data of the item to be generated; A generated data volume calculation module, used to calculate the number of rows based on the number of generated data types corresponding to the to-be-generated item identifiers to obtain the total number of rows in the report, and to calculate the generated data volume based on the total number of rows in the report and the number of generated data types corresponding to the to-be-generated item identifiers to obtain the generated data volume of the generated data types corresponding to the to-be-generated item identifiers; An index calculation module, used to obtain the row code to be generated corresponding to the item identifier to be generated, perform index calculation based on the row code to be generated and the amount of generated data, and obtain the index of the item identifier to be generated corresponding to the row code to be generated; A generating module, configured to determine item generation data from the to-be-generated item data corresponding to the to-be-generated item identification according to the to-be-generated item identification index; The report generation module is used to generate a target report based on the item generation data, the to-be-generated item identifier corresponding to the item generation data, and the to-be-generated row code corresponding to the item generation data.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Data table correlation method and device

    CN103488657A

  • Method and devices of querying

    CN108205593A