A data table generation method and related device
By presetting hierarchical division rules and sorting serial numbers, independent data columns are first filled, then associated data columns are filled, and sorted according to serial numbers, which solves the problem of low data filling efficiency in the existing technology and achieves more efficient data table generation. .
Patent Information
- Application Number
- CN202011519738.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-21
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-12-21
AI Technical Summary
When filling a data table in the existing technology, the independent data and associated data of cells need to be frequently determined, resulting in a large consumption of time and resources, especially inefficiency when filling in a large amount of independent data.
Determine the level and sorting sequence number of each business data through preset hierarchical division rules. First, fill in independent data columns to obtain the initial data record, then fill in the associated data columns based on the initial data record, and finally sort in ascending order according to the sorting sequence number to obtain the target table, reducing judgment. retrieval process.
It reduces the time and resource consumption of the data filling process, improves the data filling efficiency, simplifies the processing process, and reduces the complexity of development and maintenance.
Smart Images

Figure CN112528613B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing, and in particular to a data table generation method and related equipment. Background Art
[0002] In the prior art, filling data in an empty table is done by traversing each row of cells in turn. During the filling process, for each cell to be filled, it is necessary to determine whether the data of other cells can be used to fill the current cell, that is, to determine whether it is independent data that does not need to use the data of other cells, or whether it needs to use the associated data of other cells. If the cell to be filled is associated data, and the data of other cells related to it has not been filled, the cell to be filled needs to be skipped until all cells have been traversed and the data of other cells related to it have been filled, then the cell to be filled can be filled with data.
[0003] It can be seen that in the above filling process, each cell to be filled must go through a series of judgment and retrieval, which consumes time and resources. Moreover, when filling a large amount of independent data, using this method will also waste time and resources. Summary of the invention
[0004] An embodiment of the present application provides a data table generation method for reducing the time consumption and resource consumption of a data filling process.
[0005] A first implementation of the first aspect of the embodiments of the present application provides a method for generating a data table, including:
[0006] Obtaining a business data set and a table header area of a table to be filled with the business data set, wherein the business data set includes multiple business data, and the table header area includes independent data columns and associated data columns;
[0007] According to the preset hierarchical division rules, determine the level corresponding to each piece of the business data and the sorting sequence number of each piece of the business data;
[0008] Fill the cells corresponding to the independent data columns based on the business data to obtain initial data records corresponding to the business data;
[0009] Based on the independent data columns of each of the initial data records, fill in the cells corresponding to the associated data columns of each of the initial data records to obtain a complete data record corresponding to each of the initial data records;
[0010] Each complete data record is sorted in ascending order according to the sorting sequence number to obtain a target table.
[0011] In combination with the first implementation of the first aspect of the embodiments of the present application, the second implementation of the first aspect of the embodiments of the present application includes:
[0012] Divide the business data corresponding to the same level into the same group to obtain multiple level groups;
[0013] Based on the business data of each of the hierarchical groups, cells corresponding to the independent data columns of the business data of each hierarchical group are synchronously filled to obtain initial data records corresponding to the business data in each of the hierarchical groups.
[0014] In combination with the first implementation of the first aspect of the embodiments of the present application, the third implementation of the first aspect of the embodiments of the present application includes:
[0015] If the associated data column in the initial data record has a preset associated operation rule, determining a target cell corresponding to the associated operation rule among cells of a plurality of the initial data records, wherein the target cell corresponds to a cell of the independent data column;
[0016] The target cell is operated according to the association operation rule, and the operation result is filled into the cell corresponding to the associated data column of the initial data record to obtain a complete data record corresponding to the initial data record.
[0017] In combination with the first implementation of the first aspect of the embodiments of the present application, the fourth implementation of the first aspect of the embodiments of the present application includes:
[0018] According to the hierarchical division rule, determine the upper level sorting sequence number corresponding to each piece of the business data and the hierarchical category of the level corresponding to the business data, wherein different hierarchical categories have a preset search order;
[0019] According to the sorting rule corresponding to the hierarchical category, each of the complete data records is sorted in ascending order according to the sorting sequence number to obtain a target table.
[0020] In combination with the fourth implementation of the first aspect of the embodiments of the present application, the fifth implementation of the first aspect of the embodiments of the present application includes:
[0021] Determine the preset initial sorting sequence number as the current sorting sequence number, and determine the preset first position as the current position;
[0022] Arrange the complete data records with the same sorting number as the current sorting number at the current position, and search for complete data records with an upper-level sorting number equal to the current sorting number and a sorting number less than the current sorting number plus 1 from the complete data records corresponding to different hierarchical categories in the order of searching for the complete data records at different hierarchical categories, and sort the found complete data records in the positions subsequent to the current position;
[0023] Add 1 to the current sorting number as a new current sorting number, and use the position after the subsequent position as the new current position;
[0024] If the new current sorting sequence number is less than or equal to the maximum sorting sequence number of the business data, return to execute the step of arranging the complete data records with the same sorting sequence number as the new current sorting sequence number at the new current position;
[0025] If the new current sorting sequence number is greater than the maximum sorting sequence number of the business data, the ascending sorting is completed and the target table is obtained.
[0026] In combination with the fifth implementation of the first aspect of the embodiments of the present application, the sixth implementation of the first aspect of the embodiments of the present application includes: the hierarchical categories include subclasses and follow-up classes, and the search order of the subclasses takes precedence over the search order of the follow-up classes.
[0027] A first implementation of the second aspect of the embodiments of the present application provides a data table generation method, including:
[0028] Obtaining a business data set and a table header area of a table into which the business data set is to be filled; wherein the business data set includes multiple business data, and the table header area includes independent data columns and associated data columns;
[0029] Fill the cells corresponding to the independent data columns based on the business data to obtain data records corresponding to the business data;
[0030] Perform the following filling steps on the cells corresponding to the associated data columns of each of the data records to obtain the target table:
[0031] If the associated data column in the data record has a preset association operation rule, determining a target cell corresponding to the association operation rule among cells of a plurality of the data records, wherein the target cell corresponds to a cell of the independent data column;
[0032] The target cell is operated according to the association operation rule, and the operation result is filled into the cell corresponding to the associated data column of the data record.
[0033] A first implementation of the third aspect of the embodiments of the present application provides a data table generating device, including:
[0034] A first acquisition unit, configured to obtain a business data set and a header area of a table into which the business data set is to be filled, wherein the business data set includes a plurality of business data, and the header area includes an independent data column and an associated data column;
[0035] A determination unit, configured to determine the level corresponding to each piece of the business data and the sorting sequence number of each piece of the business data according to a preset level division rule;
[0036] A second acquisition unit, configured to fill in cells corresponding to the independent data columns based on the business data to obtain initial data records corresponding to the business data;
[0037] A third acquisition unit, configured to fill in cells corresponding to associated data columns of each of the initial data records based on independent data columns of each of the initial data records, to obtain complete data records corresponding to each of the initial data records;
[0038] The fourth acquisition unit is used to sort the complete data records in ascending order according to the sorting sequence number to obtain a target table.
[0039] In combination with the first implementation of the third aspect of the embodiment of the present application, the second implementation of the third aspect of the embodiment of the present application, the second acquisition unit includes:
[0040] A first acquisition subunit is used to divide the business data corresponding to the same level into the same group to obtain multiple level groups;
[0041] The second acquisition subunit is used to synchronously fill the cells corresponding to the independent data columns of the business data of each hierarchical group based on the business data of each hierarchical group, so as to obtain the initial data records corresponding to the business data in each hierarchical group.
[0042] In combination with the first implementation of the third aspect of the embodiment of the present application, in the third implementation of the third aspect of the embodiment of the present application, the third acquisition unit includes:
[0043] A first determining subunit is configured to determine, if the associated data column in the initial data record has a preset associated operation rule, a target cell corresponding to the associated operation rule among cells of a plurality of the initial data records, wherein the target cell corresponds to a cell of the independent data column;
[0044] The third acquisition subunit is used to operate the target cell according to the association operation rule, and fill the operation result into the cell corresponding to the associated data column of the initial data record to obtain the complete data record corresponding to the initial data record.
[0045] In combination with the first implementation of the third aspect of the embodiments of the present application, in the fourth implementation of the third aspect of the embodiments of the present application, the fourth acquisition unit includes:
[0046] A second determination subunit is used to determine the upper level sorting sequence number corresponding to each piece of the business data and the level category of the level corresponding to the business data according to the level division rule, wherein different level categories have a preset search order;
[0047] The fourth acquisition subunit is used to sort the complete data records in ascending order according to the sorting sequence number according to the sorting rule corresponding to the hierarchical category to obtain a target table.
[0048] In combination with the fourth implementation of the third aspect of the embodiment of the present application, the fifth implementation of the third aspect of the embodiment of the present application, the fourth acquisition subunit includes:
[0049] A first determination module, used to determine a preset initial sorting sequence number as a current sorting sequence number, and determine a preset first position as a current position;
[0050] A sorting module is used to arrange the complete data records with the same sorting sequence number as the current sorting sequence number at the current position, and search for the complete data records corresponding to the different hierarchical categories in the order of searching for the complete data records with the upper-level sorting sequence number equal to the current sorting sequence number and the sorting sequence number less than the current sorting sequence number plus 1, and sort the found complete data records in the subsequent positions of the current position in sequence;
[0051] A second determining module is used to add 1 to the current sorting number as a new current sorting number, and to use the position after the subsequent position as a new current position;
[0052] A return module, configured to return to the step of arranging the complete data records with the same sorting number as the new current sorting number at the new current position if the new current sorting number is less than or equal to the maximum sorting number of the business data;
[0053] The acquisition module is used to complete the ascending sorting and obtain the target table if the new current sorting sequence number is greater than the maximum sorting sequence number of the business data.
[0054] In combination with the fifth implementation of the third aspect of the embodiments of the present application, the sixth implementation of the third aspect of the embodiments of the present application includes: the hierarchical categories include subclasses and follow-up classes, and the search order of the subclasses takes precedence over the search order of the follow-up classes.
[0055] In a fourth aspect of the embodiments of the present application, a data table production device is provided, comprising:
[0056] A first acquisition unit, configured to obtain a business data set and a table header area of a table to be filled with the business data set, wherein the business data set includes a plurality of business data, and the table header area includes an independent data column and an associated data column;
[0057] A second acquisition unit, configured to fill in cells corresponding to the independent data columns based on the business data to obtain data records corresponding to the business data;
[0058] The third acquisition unit is used to perform the following filling steps on the cells corresponding to the associated data columns of each of the data records to obtain a target table:
[0059] If the associated data column in the data record has a preset association operation rule, determining a target cell corresponding to the association operation rule among cells of a plurality of the data records, wherein the target cell corresponds to a cell of the independent data column;
[0060] The target cell is operated according to the association operation rule, and the operation result is filled into the cell corresponding to the associated data column of the data record.
[0061] According to a sixth aspect of the embodiments of the present application, a computer-readable storage medium is provided, comprising instructions, which, when executed on a computer, enable the computer to execute any one of the implementations of the first or second aspects described above.
[0062] According to a seventh aspect of the embodiments of the present application, a computer program product is provided, wherein when the computer program product is executed on a computer, the computer executes any one of the methods described in the first aspect.
[0063] According to an eighth aspect of the embodiments of the present application, a data table generating device includes:
[0064] CPU, memory, input and output interface, wired or wireless network interface, power supply;
[0065] The memory is a short-term storage memory or a persistent storage memory;
[0066] The central processing unit is configured to communicate with the memory, and to call instruction operations in the memory on the data table generating device to execute any one of the implementations of the first aspect or the second aspect.
[0067] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0068] After obtaining a business data set containing business data and a table header area containing independent data columns and associated data columns, the present invention determines the level and sorting number corresponding to each business data according to a preset hierarchical division rule, and fills in the cells corresponding to the independent data columns based on each business data to obtain an initial data record corresponding to each business data, and then fills in the cells corresponding to the associated data columns of each initial data record based on the independent data columns of each initial data record to obtain a complete data record corresponding to the initial data record, and finally sorts each complete data record in ascending order according to the sorting number to obtain a target table. Compared with the prior art, the present invention can first fill in the cells of the independent data columns based on each business data to obtain the initial data record, and then fill in the cells of the associated data columns of the initial data record based on the independent data columns of the initial data record to obtain the complete data record. There is no need to go through a series of judgments and retrievals to fill a cell as in the prior art, thereby reducing time and resource consumption. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A flow chart of a method for generating a data table in an embodiment of the present application;
[0070] Figure 2 This is another flowchart of the data table generation method in the embodiment of the present application;
[0071] Figure 3 This is another flowchart of the data table generation method in the embodiment of the present application;
[0072] Figure 4 This is another flowchart of the data table generation method in the embodiment of the present application;
[0073] Figure 5 This is another flowchart of the data table generation method in the embodiment of the present application;
[0074] Figure 6 A flow chart of a method for generating a data table in an embodiment of the present application;
[0075] Figure 7 This is a structural schematic diagram of a data table generating device in an embodiment of the present application;
[0076] Figure 8 This is a structural schematic diagram of a data table generating device in an embodiment of the present application;
[0077] Fig. 9 A structural schematic diagram of a data table generating device in an embodiment of the present application. DETAILED DESCRIPTION
[0078] An embodiment of the present application provides a data table generation method for reducing the time consumption and resource consumption of a data filling process.
[0079] See also Figure 1 , the present application embodiment provides a data table generation method, including:
[0080] This embodiment is used to fill the acquired business data set into a table containing a header area with the data in the business data set and perform sorting processing to obtain an arranged target table, wherein the header area contains independent data columns and associated data columns, the data under the independent data columns can be directly obtained from the business data set, and the data under the associated data columns are obtained based on the data under the independent data columns.
[0081] 101. Obtain a business data set and a table header area of a table into which the business data set is to be filled, wherein the business data set includes multiple business data, and the table header area includes independent data columns and associated data columns.
[0082] Get the business data set and the header area of the table, where the business data set contains multiple business data, and the header area contains independent data columns and associated data columns, where each business data has an independent data column and an associated data column, and the data to be filled in the independent data column corresponding to each business data can be directly obtained from the data set, while the associated data column corresponding to each business data is obtained based on the data logic operation after the independent data column is filled.
[0083] 102. Determine the level corresponding to each piece of the business data and the sorting sequence number of each piece of the business data according to a preset level division rule.
[0084] A preset hierarchical division rule for determining the hierarchy and sorting number of each piece of business data is obtained, and the hierarchy and sorting number corresponding to each piece of business data under the plurality of pieces of business data are determined according to the preset hierarchical division rule. The sorting number of each piece of business data is used in step 105 to arrange the complete data records corresponding to each piece of business data according to the size of the sorting number.
[0085] Exemplarily, for three pieces of business data, such as business data A, business data B, and business data C, it is determined that business data A is at the first level and its sorting number is 1, business data B is at the third level and its sorting number is 3, and business data C is at the third level and its sorting number is 2.
[0086] 103. Fill cells corresponding to the independent data columns based on the respective pieces of business data to obtain initial data records corresponding to the respective pieces of business data.
[0087] Based on each piece of business data, data is simultaneously filled into the cells of the independent data column corresponding to each piece of business data, thereby obtaining an initial data record corresponding to each piece of business data, wherein initial data records with the same level can be in adjacent positions in the table, and the sorting numbers of the initial data records in the same level are incremented sequentially.
[0088] It should be noted that each initial data record also includes independent data columns and associated data columns. In this step, only the independent data columns of the initial data record are filled with data, while the associated data columns are not yet filled.
[0089] Exemplarily, for three business data, such as business data A, business data B, and business data C, there is the same header area, which contains the same multiple header contents for the three business data, such as three header contents a, b, and c. For each business data, the multiple header contents can be divided into independent data columns and associated data columns associated with each business data. Therefore, for each business data, there may be the same or different independent data columns and the same or different associated data columns. For example, for business data A, its independent data column is the header content of a, and the header contents b and c are the associated data columns of business data A; for business data B, its independent data column is the header content of b, and its associated data column is the header content of c; for business data C, its independent data column is the header content of c, and its associated data column is the header content of a and b. When executing this step, for business data A, the cells under the header content with the independent data column of business data A as a are filled in to form the initial data record A corresponding to business data A; for business data B, the cells under the header content with the independent data column of business data B as b are filled in to form the initial data record B corresponding to business data B; for business data C, the cells under the header content with the independent data column of business data C as c are filled in to form the initial data record C corresponding to business data C.
[0090] 104. Fill cells corresponding to associated data columns of each of the initial data records based on independent data columns of each of the initial data records to obtain complete data records corresponding to each of the initial data records.
[0091] After obtaining multiple initial data records, based on the independent data columns of each initial data record, fill the cells under the associated data columns of each initial data record with data, and the data is determined by the data of the cells under the independent data columns of each initial data record, thereby completing the filling of the associated data columns of the initial data records to obtain complete data records.
[0092] It should be noted that the data associated with the cells under the associated data column is determined based on the data associated with the cells under the independent data column. It can be seen from steps 103 and 104 that this embodiment first fills the cells of the independent data column of each business data with data, which directly comes from the business data set, and then fills the associated data column of each business data with data obtained by calculation based on the data filled in the cells of the independent data column, which is different from the judgment retrieval when filling cells in the prior art.
[0093] Exemplarily, taking 3 pieces of business data as the description object, when executing this step, for the initial data record A, the cells under the header content whose associated data columns are b and c of the initial data record A are filled, and the initial data record A thus forms a complete data record A; for the initial data record B, the cells under the header content whose associated data columns are a and c of the initial data record B are filled, and the initial data record B thus forms a complete data record B; for the initial data record C, the cells under the header content whose associated data columns are a and b of the initial data record C are filled, and the initial data record C thus forms a complete data record C.
[0094] 105. Sort the complete data records in ascending order according to the sorting sequence number to obtain a target table.
[0095] Sort each complete data record in ascending order according to the sorting sequence number to obtain the target table.
[0096] Exemplarily, taking 3 pieces of business data as the description object, when executing this step, business data A with sorting number 1, business data B with sorting number 3, and business data C with sorting number 2 are sorted in ascending order of sorting numbers, and a target table consisting of complete data record A, complete data record C, and complete data record B can be obtained in order.
[0097] It should be noted that step 104 and step 105 can be performed alternately, that is, complete data records can be obtained while sorting is performed to obtain the target table.
[0098] In the present embodiment, the formation of the target table is based on sorting complete data records, wherein the formation of the complete data record is based on the data of the independent data columns of the initial data record through logical operations, and therefore the initial data record is the basis for obtaining the complete data record, that is, in the present embodiment, the initial data records are first uniformly formed, and then the complete data records are uniformly formed based on the data of the initial data records. In the present embodiment, the respective formation of the initial data records and the complete data records increases relative independence and weakens correlation in the processing sequence. It is precisely based on the increase in relative independence and the weakening of correlation in the processing sequence that, compared with the prior art, the time consumption and resource consumption of the filling process are reduced, and the subsequent content addition and maintenance are easier for developers to handle based on the reduction of constraints.
[0099] based on Figure 1 Further, the following embodiment is a detailed description of step 103, please refer to Figure 2 , this embodiment includes:
[0100] 201. Divide the business data corresponding to the same level into the same group to obtain multiple level groups.
[0101] After determining the levels of the multiple business data, the business data of the same level are divided into the same group, thereby obtaining multiple level groups, wherein the number of business data in different level groups is different.
[0102] 202. Based on the business data of each of the hierarchical groups, synchronously fill in cells corresponding to independent data columns of the business data of each hierarchical group to obtain initial data records corresponding to the business data in each of the hierarchical groups.
[0103] After determining the business data divided by hierarchical groups, each hierarchical group synchronously fills data into the cells of the independent data column under the hierarchical group. The data comes from the business data, thereby obtaining the initial data record of the business data under the corresponding hierarchical group.
[0104] based on Figure 1 The following embodiment is a description of step 104, please refer to Figure 3 include:
[0105] 301. If the associated data column in the initial data record has a preset associated operation rule, determine a target cell corresponding to the associated operation rule among cells of a plurality of the initial data records, wherein the target cell corresponds to a cell of the independent data column.
[0106] If the associated data of the initial data record has a preset associated operation rule, then a target cell corresponding to the associated operation rule is determined in the cells of multiple initial data records, and the target cell corresponds to a cell of an independent data column. The associated operation rule is a logical operation on the cell data of multiple initial data records to obtain an operation result.
[0107] Exemplarily, for three pieces of business data, such as business data A, business data B, and business data C, there is a same header area, and the area contains the same multiple header contents for the three pieces of business data, such as three header contents a, b, and c. For each piece of business data, the multiple header contents can be divided into independent data columns and associated data columns associated with each piece of business data. Therefore, for each piece of business data, there may be the same or different independent data columns and the same or different associated data columns. For business data A, its independent data column is the header content of a, and the header contents b and c are the associated data columns of business data A. The header contents b and c are the associated data columns of business data A. The two associated data columns of c each have associated operation rules related to business data A; for business data B, its independent data column is the header content of b, and its associated data column is the header content of c, and the associated data column of header content c has associated operation rules related to business data B; for business data C, its independent data column is the header content of c, and its associated data column is the header content of a and b, and the two associated data columns of header content a and b each have associated operation rules related to business data C. It can be seen that for business data A and business data B, both have the same associated data column c but have corresponding different associated operation rules.
[0108] 302. Perform operation on the target cell according to the association operation rule, and fill the operation result into the cell corresponding to the associated data column of the initial data record to obtain a complete data record corresponding to the initial data record.
[0109] After determining the target cell, a logical operation is performed on the target cell according to the association operation rule, and the result of the logical operation is filled into the cell corresponding to the associated data column of the initial data record, so that the initial data record becomes a complete data record.
[0110] based on Figure 1 Further, the following embodiment is a detailed description of step 105, please refer to Figure 4 , this embodiment includes:
[0111] 401. According to the hierarchical division rule, determine the parent sorting number corresponding to each piece of the business data and the hierarchical category of the hierarchy corresponding to the business data, wherein different hierarchical categories have a preset search order.
[0112] According to the hierarchical division rules, the parent sorting number and hierarchical category of each business data are determined, wherein the parent sorting number represents the sorting association between each business data, and the hierarchical category represents the preset search order for sorting.
[0113] It should be noted that the superior sorting sequence number and hierarchical category of the business data are determined based on the hierarchical division rules. The hierarchical category is used to describe the relationship between the business data of each level. This relationship can be transferred to the corresponding initial data record and complete data record, and the preset search order for sorting is formed through this relationship. It should be pointed out that not all business data at any level have a relationship. The existence of the relationship depends on the actual situation and is not limited here. The superior sorting sequence number of the business data can also be transferred to the corresponding initial data record and complete data record. It should be pointed out that the business data may not have an superior sorting sequence number, and the same is true for the corresponding initial data record and complete data record. Whether the business data has an superior sorting sequence number depends on the actual situation and is not limited here.
[0114] 402. According to the sorting rule corresponding to the hierarchical category, each of the complete data records is sorted in ascending order according to the sorting sequence number to obtain a target table.
[0115] After determining the hierarchical category, each complete data record is sorted in ascending order according to the sorting sequence number according to the sorting rule corresponding to the hierarchical category to obtain the target table.
[0116] Further, based on Figure 4 The following embodiment is a detailed description of step 402. Figure 5 ,include:
[0117] 501. Determine a preset initial sorting sequence number as the current sorting sequence number, and determine a preset first position as the current position.
[0118] The preset initial sorting number is determined as the current sorting number, and the preset first position is determined as the current position, wherein the initial sorting number and the first position can be preset according to actual conditions, and are not specifically limited here.
[0119] 502. Arrange the complete data records whose sorting numbers are the same as the current sorting number at the current position, and search for complete data records whose upper-level sorting numbers are equal to the current sorting number and whose sorting numbers are less than the current sorting number plus 1 from the complete data records corresponding to different hierarchical categories in the order of searching of different hierarchical categories, and sort the found complete data records in sequence at positions subsequent to the current position.
[0120] After determining the current sorting number and the current position, using the current sorting number as a guide, obtain the complete data record whose sorting number is the same as the current sorting number, and arrange the complete data record at the current position. Then, according to the order of searching in different hierarchical categories, search for the complete data record whose parent sorting number is equal to the current sorting number, and the sorting number of the complete data record is less than the result of adding 1 to the current sorting number. Finally, sort the found complete data records in sequence in the subsequent positions of the current position.
[0121] It should be noted that the hierarchical categories are divided into subclasses and follower classes, and the search order of subclasses takes precedence over the search order of follower classes. Therefore, in the search process, the complete data record of the subclass is searched first, and then the complete data record of the follower class is searched, wherein the upper-level sorting sequence number corresponding to the complete data record of the subclass and the complete data record of the follower class is the same as the current sorting sequence number, and the sorting sequence number corresponding to the complete data record of the subclass and the complete data record of the follower class is less than the result of the current sorting sequence number plus 1. It should be pointed out that the complete data record of the subclass has a parent-child relationship with the corresponding complete data record with the current sorting sequence number, wherein the corresponding complete data record with the current sorting sequence number is the complete data record of the parent class, and similarly, the complete data record of the follower class has a follower relationship with the corresponding complete data record with the current sorting sequence number, wherein the corresponding complete data record with the current sorting sequence number is the complete data record to be followed. When there are multiple complete data records of subclasses and / or follower classes in this step, first sort the complete data records of all subclasses, and then sort the complete data records of all follower classes. When sorting the complete data records of all subclasses, sort them in ascending order based on the sorting sequence numbers of the complete data records of all subclasses, and when sorting the complete data records of all follower classes, sort them in ascending order based on the sorting sequence numbers of the complete data records of all follower classes.
[0122] 503. Add 1 to the current sorting number as a new current sorting number, and use the position after the subsequent position as a new current position.
[0123] After sorting the complete data records associated with the current sorting sequence number, the current sorting sequence number is increased by 1 as the new current sorting sequence number, and the position after the subsequent position is used as the new current position.
[0124] 504. If the new current sorting sequence number is less than or equal to the maximum sorting sequence number of the business data, return to execute the step of arranging the complete data records having the same sorting sequence number as the new current sorting sequence number at the new current position.
[0125] Determine whether the new current sorting number is less than or equal to the maximum sorting number of the business data. If so, return to execute the step of arranging the complete data records with the same sorting number as the new current sorting number at the new current position, that is, step 502.
[0126] 505. If the new current sorting sequence number is greater than the maximum sorting sequence number of the business data, the ascending sorting is completed and the target table is obtained.
[0127] Determine whether the new current sorting number is less than or equal to the maximum sorting number of the business data. If not, that is, determine that the new current sorting number is greater than the maximum sorting number of the business data, then complete the ascending sort and obtain the final target table.
[0128] See also Figure 6 , the present application embodiment provides another data table generation method, including:
[0129] 601. Obtain a business data set and a header area of a table into which the business data set is to be filled, wherein the business data set includes multiple business data, and the header area includes independent data columns and associated data columns.
[0130] This step is similar to step 101 and will not be described in detail here.
[0131] 602. Fill cells corresponding to the independent data columns based on the respective pieces of business data to obtain data records corresponding to the respective pieces of business data.
[0132] After acquiring each piece of business data, fill in the cells corresponding to the independent data columns of the table to obtain the data records corresponding to each piece of business data, wherein the arrangement of each data record is determined by the table. In this embodiment, only the independent data columns and the associated data columns need to be filled to obtain the target table.
[0133] 603. Perform the following filling steps on the cells corresponding to the associated data columns of each of the data records to obtain a target table.
[0134] 604. If the associated data column in the data record has a preset associated operation rule, determine a target cell corresponding to the associated operation rule among cells of a plurality of the data records, wherein the target cell corresponds to a cell of the independent data column.
[0135] This step is similar to step 301 and will not be described in detail here.
[0136] 605. Perform operation on the target cell according to the association operation rule, and fill the operation result into the cell corresponding to the associated data column of the data record.
[0137] This step is similar to step 302 and will not be described in detail here.
[0138] Furthermore, this embodiment includes a data table generating device and a structure diagram, please refer to Figure 7 ,include:
[0139] A first acquisition unit 701 is used to obtain a business data set and a header area of a table to be filled with the business data set, wherein the business data set includes multiple business data, and the header area includes independent data columns and associated data columns;
[0140] The determining unit 702 is used to determine the level corresponding to each piece of the business data and the sorting sequence number of each piece of the business data according to a preset level division rule;
[0141] A second acquisition unit 703 is used to fill in the cells corresponding to the independent data columns based on the business data to obtain initial data records corresponding to the business data;
[0142] A third acquisition unit 704 is used to fill the cells corresponding to the associated data columns of each of the initial data records based on the independent data columns of each of the initial data records, so as to obtain the complete data records corresponding to each of the initial data records;
[0143] The fourth acquisition unit 705 is used to sort the complete data records in ascending order according to the sorting sequence number to obtain a target table.
[0144] In one implementation, the second obtaining unit 703 includes:
[0145] A first acquisition subunit is used to divide the business data corresponding to the same level into the same group to obtain multiple level groups;
[0146] The second acquisition subunit is used to synchronously fill the cells corresponding to the independent data columns of the business data of each hierarchical group based on the business data of each hierarchical group, so as to obtain the initial data records corresponding to the business data in each hierarchical group.
[0147] In one implementation, the third obtaining unit 704 includes:
[0148] A first determining subunit is configured to determine, if the associated data column in the initial data record has a preset associated operation rule, a target cell corresponding to the associated operation rule among cells of a plurality of the initial data records, wherein the target cell corresponds to a cell of the independent data column;
[0149] The third acquisition subunit is used to operate the target cell according to the association operation rule, and fill the operation result into the cell corresponding to the associated data column of the initial data record to obtain the complete data record corresponding to the initial data record.
[0150] In one implementation, the fourth obtaining unit 705 includes:
[0151] A second determination subunit is used to determine the upper level sorting sequence number corresponding to each piece of the business data and the level category of the level corresponding to the business data according to the level division rule, wherein different level categories have a preset search order;
[0152] The fourth acquisition subunit is used to sort the complete data records in ascending order according to the sorting sequence number according to the sorting rule corresponding to the hierarchical category to obtain a target table.
[0153] In one implementation, the fourth obtaining subunit includes:
[0154] A first determination module, used to determine a preset initial sorting sequence number as a current sorting sequence number, and determine a preset first position as a current position;
[0155] A sorting module is used to arrange the complete data records with the same sorting sequence number as the current sorting sequence number at the current position, and search for the complete data records corresponding to the different hierarchical categories in the order of searching for the complete data records with the upper-level sorting sequence number equal to the current sorting sequence number and the sorting sequence number less than the current sorting sequence number plus 1, and sort the found complete data records in the subsequent positions of the current position in sequence;
[0156] A second determining module is used to add 1 to the current sorting number as a new current sorting number, and to use the position after the subsequent position as a new current position;
[0157] A return module, configured to return to the step of arranging the complete data records with the same sorting number as the new current sorting number at the new current position if the new current sorting number is less than or equal to the maximum sorting number of the business data;
[0158] The acquisition module is used to complete the ascending sorting and obtain the target table if the new current sorting sequence number is greater than the maximum sorting sequence number of the business data.
[0159] In one implementation, the data table generating device includes: the hierarchical category includes a sub-category and a following category, and the search order of the sub-category takes precedence over the search order of the following category.
[0160] This embodiment includes a data table generating device and a structure diagram, see Figure 8 ,include:
[0161] A first acquisition unit 801 is used to obtain a business data set and a table header area of a table to be filled with the business data set, wherein the business data set includes multiple business data, and the table header area includes independent data columns and associated data columns;
[0162] A second acquisition unit 802 is used to fill the cells corresponding to the independent data columns based on the business data to obtain data records corresponding to the business data;
[0163] The third acquisition unit 803 is used to perform the following filling steps on the cells corresponding to the associated data columns of each data record to obtain a target table:
[0164] If the associated data column in the data record has a preset association operation rule, determining a target cell corresponding to the association operation rule among cells of a plurality of the data records, wherein the target cell corresponds to a cell of the independent data column;
[0165] The target cell is operated according to the association operation rule, and the operation result is filled into the cell corresponding to the associated data column of the data record.
[0166] Fig. 9 It is another structural diagram of the data table generating device provided in an embodiment of the present application. The data table generating device 901 may include one or more central processing units (CPU) 902 and a memory 906. The memory 906 stores one or more application programs or data.
[0167] The memory 906 may be a volatile storage or a persistent storage. The program stored in the memory 906 may include one or more modules, each of which may include a series of instruction operations in the data table generating device 901. Furthermore, the central processing unit 902 may be configured to communicate with the memory 906 and execute a series of instruction operations in the memory 906 on the data table generating device 901.
[0168] The data table generating device 901 may also include one or more power supplies 903, one or more wired or wireless network interfaces 904, one or more input and output interfaces 905, and / or one or more operating systems, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0169] The data table generating device 901 can execute the aforementioned Figures 1 to 6 The operations in any of the embodiments shown in the figures will not be described in detail here.
[0170] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0171] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0172] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0173] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0174] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, read-only memory), random access memory (RAM, random access memory), disk or optical disk and other media that can store program code.
Claims
1. A data table generation method, characterized in that: include: Obtaining a business data set and a table header area of a table to be filled with the business data set, wherein the business data set includes multiple business data, and the table header area includes independent data columns and associated data columns; According to the preset hierarchical division rules, determine the level corresponding to each piece of the business data and the sorting sequence number of each piece of the business data; Fill the cells corresponding to the independent data columns based on the business data to obtain initial data records corresponding to the business data; Based on the independent data columns of each of the initial data records, fill in the cells corresponding to the associated data columns of each of the initial data records to obtain a complete data record corresponding to each of the initial data records; Sort each of the complete data records in ascending order according to the sorting sequence number to obtain a target table; The method of filling the cells corresponding to the associated data columns of each of the initial data records based on the independent data columns of each of the initial data records to obtain the complete data records corresponding to each of the initial data records includes: if the associated data columns in the initial data records have a preset associated operation rule, determining the target cells corresponding to the associated operation rule in the cells of multiple initial data records, wherein the target cells correspond to the cells of the independent data columns; and performing an operation on the target cells according to the associated operation rule, and filling the operation results into the cells corresponding to the associated data columns of the initial data records to obtain the complete data records corresponding to the initial data records.
2. The data table generation method according to claim 1, characterized in that: Filling cells corresponding to the independent data columns based on the business data to obtain initial data records corresponding to the business data includes: Divide the business data corresponding to the same level into the same group to obtain multiple level groups; Based on the business data of each of the hierarchical groups, cells corresponding to the independent data columns of the business data of each hierarchical group are synchronously filled to obtain initial data records corresponding to the business data in each of the hierarchical groups.
3. The data table generation method according to claim 1, characterized in that: The complete data records are sorted in ascending order according to the sorting sequence number to obtain a target table, including: According to the hierarchical division rule, determine the upper level sorting sequence number corresponding to each piece of the business data and the hierarchical category of the level corresponding to the business data, wherein different hierarchical categories have a preset search order; According to the sorting rule corresponding to the hierarchical category, each of the complete data records is sorted in ascending order according to the sorting sequence number to obtain a target table.
4. The data table generation method according to claim 3, characterized in that: According to the sorting rule corresponding to the hierarchical category, each of the complete data records is sorted in ascending order according to the sorting sequence number to obtain a target table, including: Determine the preset initial sorting sequence number as the current sorting sequence number, and determine the preset first position as the current position; Arrange the complete data records with the same sorting sequence number as the current sorting sequence number at the current position, and search for complete data records with an upper-level sorting sequence number equal to the current sorting sequence number and a sorting sequence number less than the current sorting sequence number plus 1 from the complete data records corresponding to different hierarchical categories in the order of searching for the complete data records at different hierarchical categories, and sort the found complete data records in the positions subsequent to the current position; Add 1 to the current sorting number as a new current sorting number, and use the position after the subsequent position as the new current position; If the new current sorting sequence number is less than or equal to the maximum sorting sequence number of the business data, return to execute the step of arranging the complete data records with the same sorting sequence number as the new current sorting sequence number at the new current position; If the new current sorting sequence number is greater than the maximum sorting sequence number of the business data, the ascending sorting is completed and the target table is obtained.
5. The data table generation method according to claim 4, characterized in that: include: The hierarchical category includes a sub-category and a following class, and the search order of the sub-category takes precedence over the search order of the following class.
6. A data table generation method, characterized in that: include: Obtaining a business data set and a table header area of a table to be filled with the business data set, wherein the business data set includes multiple business data, and the table header area includes independent data columns and associated data columns; Fill the cells corresponding to the independent data columns based on the business data to obtain data records corresponding to the business data; Perform the following filling steps on the cells corresponding to the associated data columns of each of the data records to obtain the target table: If the associated data column in the data record has a preset association operation rule, determining a target cell corresponding to the association operation rule among cells of a plurality of the data records, wherein the target cell corresponds to a cell of the independent data column; The target cell is operated according to the association operation rule, and the operation result is filled into the cell corresponding to the associated data column of the data record.
7. A data table generating device, characterized in that: include: A first acquisition unit, configured to obtain a business data set and a header area of a table into which the business data set is to be filled, wherein the business data set includes a plurality of business data, and the header area includes an independent data column and an associated data column; A determination unit, configured to determine the level corresponding to each piece of the business data and the sorting sequence number of each piece of the business data according to a preset level division rule; A second acquisition unit, configured to fill in cells corresponding to the independent data columns based on the business data to obtain initial data records corresponding to the business data; A third acquisition unit, configured to fill in cells corresponding to associated data columns of each of the initial data records based on independent data columns of each of the initial data records, to obtain complete data records corresponding to each of the initial data records; A fourth acquisition unit, used for sorting the complete data records in ascending order according to the sorting sequence number to obtain a target table; The third acquisition unit includes: a first determination subunit, which is used to determine the target cell corresponding to the association operation rule among the cells of multiple initial data records if the associated data column in the initial data record has a preset association operation rule, wherein the target cell corresponds to the cell of the independent data column; and a third acquisition subunit, which is used to operate the target cell according to the association operation rule, and fill the operation result into the cell corresponding to the associated data column of the initial data record to obtain a complete data record corresponding to the initial data record.
8. A data table generating device, characterized in that: include: CPU, memory, input and output interface, wired or wireless network interface, power supply; The memory is a short-term storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory, and to call instructions in the memory on the data table generating device to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on a computer, the computer is enabled to execute the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that When the computer program product is executed on a computer, the computer executes the method according to any one of claims 1 to 6.
