CN109447134B - Data merging method, device, computer equipment and storage medium - Google Patents
Data merging method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN109447134B CN109447134B CN201811184985.2A CN201811184985A CN109447134B CN 109447134 B CN109447134 B CN 109447134B CN 201811184985 A CN201811184985 A CN 201811184985A CN 109447134 B CN109447134 B CN 109447134B
- Authority
- CN
- China
- Prior art keywords
- sub
- matched
- value
- column
- matching
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 230000001172 regenerating effect Effects 0.000 claims abstract description 11
- 238000004590 computer program Methods 0.000 claims description 17
- 238000010586 diagram Methods 0.000 description 10
- 238000012545 processing Methods 0.000 description 6
- 230000006399 behavior Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003203 everyday effect Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 235000019800 disodium phosphate Nutrition 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/25—Fusion techniques
- G06F18/251—Fusion techniques of input or preprocessed data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/22—Matching criteria, e.g. proximity measures
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention discloses a data merging method, a data merging device, computer equipment and a storage medium. The method is applied to the field of data updating of big data. The method comprises the following steps: reading configuration parameters for merging the tables; reading the first sub-table and the second sub-table according to the path address of the first sub-table path and the path address of the second sub-table respectively; determining the row where the preset value of the first sub-table is located as a row to be matched; determining a value to be matched according to the column to be matched of the first sub-table and the row to be matched, and matching the value to be matched with the matching column of the second sub-table to determine a matching row; determining a value to be combined according to the to-be-combined parallel of the first sub-table and the to-be-matched row, and combining the value to be combined to a combining position corresponding to the matched row of a combining column of the second sub-table; and regenerating a total table according to the second sub table. By implementing the method of the embodiment of the invention, the data merging efficiency can be improved, the error rate can be reduced, and the manpower resources can be saved.
Description
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data merging method, a data merging device, a computer device, and a storage medium.
Background
With the development of information and technology, the information age has entered, and in the age covered by data, a new and increased amount of data is generated every day, and users need to process the new and increased amount of data every day. Excel is the most widely used tool for processing data today, and in processing data using Excel, it is often necessary to merge portions of the same content in multiple Excel files into the same Excel file. The existing operation mode is to manually open a plurality of Excel files, then copy and paste the content to be merged into the final merged Excel file. The operation mode is difficult to realize when a large amount of Excel files or a large amount of data are contained in the Excel files, and has low working efficiency, high error rate and waste of human resources.
Disclosure of Invention
The embodiment of the invention provides a data merging method, a data merging device, computer equipment and a storage medium, which aim to solve the problems of low efficiency, high error rate and waste of human resources of manual merging data.
In a first aspect, an embodiment of the present invention provides a data merging method, including: reading configuration parameters for merging tables, wherein the configuration parameters comprise: the method comprises the steps of setting a path address of a first sub-table and a path address of a second sub-table, wherein a preset value, a column to be matched and a column to be combined of the first sub-table are parallel, and a matching column and a combining column of the second sub-table are arranged; reading the first sub-table and the second sub-table according to the path address of the first sub-table and the path address of the second sub-table respectively; determining the row where the preset value of the first sub-table is located as a row to be matched; determining a value to be matched according to the column to be matched of the first sub-table and the row to be matched, and matching the value to be matched with the matching column of the second sub-table to determine a matching row; determining a value to be combined according to the to-be-combined parallel of the first sub-table and the to-be-matched row, and combining the value to be combined to a combining position corresponding to the matched row of a combining column of the second sub-table; and regenerating a total table according to the second sub table.
In a second aspect, an embodiment of the present invention further provides a data merging device, including: a first reading unit, configured to read configuration parameters for merging tables, where the configuration parameters include: the method comprises the steps of setting a path address of a first sub-table and a path address of a second sub-table, wherein a preset value, a column to be matched and a column to be combined of the first sub-table are parallel, and a matching column and a combining column of the second sub-table are arranged; the second reading unit is used for respectively reading the first sub-table and the second sub-table according to the path address of the first sub-table and the path address of the second sub-table; a first determining unit, configured to determine a row where a preset value of the first sub-table is located as a row to be matched; the matching unit is used for determining a value to be matched according to the column to be matched of the first sub-table and the row to be matched, and matching the value to be matched with the matching column of the second sub-table to determine a matching row; the merging unit is used for determining a value to be merged according to the to-be-merged parallel of the first sub-table and the to-be-matched row and merging the value to be merged into a merging position corresponding to the matched row of a merging column of the second sub-table; and the generating unit is used for regenerating the total table according to the second sub table.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the method when executing the computer program.
In a fourth aspect, embodiments of the present invention also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the above method.
The embodiment of the invention provides a data merging method, a data merging device, computer equipment and a storage medium. Wherein the method comprises the following steps: reading configuration parameters for merging the tables; reading the first sub-table and the second sub-table according to the path address of the first sub-table and the path address of the second sub-table respectively; determining the row where the preset value of the first sub-table is located as a row to be matched; determining a value to be matched according to the column to be matched of the first sub-table and the row to be matched, and matching the value to be matched with the matching column of the second sub-table to determine a matching row; determining a value to be combined according to the to-be-combined parallel of the first sub-table and the to-be-matched row, and combining the value to be combined to a combining position corresponding to the matched row of a combining column of the second sub-table; and regenerating a total table according to the second sub table. According to the embodiment of the invention, the first sub-table is combined with the second sub-table, so that the data combining efficiency can be improved, the error rate can be reduced, and the manpower resources can be saved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a data merging method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a sub-flow of a data merging method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a sub-flow of a data merging method according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a data merging method according to another embodiment of the present invention;
FIG. 5 is a schematic diagram of a sub-flow of a data merging method according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a data merging device according to an embodiment of the present invention;
FIG. 7 is a schematic block diagram of specific units of a data merging device according to an embodiment of the present invention;
fig. 8 is a schematic block diagram of a matching unit of the data merging device according to an embodiment of the present invention; and
Fig. 9 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Please refer to fig. 1, which is a schematic flowchart of a data merging method according to an embodiment of the present invention. The data merging method is applied to the terminal, and the actual application form is an Excel data matching tool, and is specifically applied to merging of Excel tables. Parameters for merging the tables are preset in an Excel data matching tool by a user, and the Excel data matching tool is executed to realize that a plurality of Excel sub-tables are merged to obtain a summary table.
Fig. 1 is a flow chart of a data merging method according to an embodiment of the present invention. As shown, the method includes the following steps S110-150.
S110, reading configuration parameters for merging the tables, wherein the configuration parameters comprise: the method comprises the steps of setting a path address of a first sub-table and a path address of a second sub-table, wherein a preset value, a column to be matched and a column to be combined of the first sub-table are parallel, and a matching column and a combining column of the second sub-table are arranged.
In one embodiment, the configuration parameters are parameter conditions for merging the tables that are pre-configured by the user. After setting configuration parameters in the Excel data matching tool, a user can combine multiple sub-tables into a total table by executing the Excel data matching tool.
S120, respectively reading the first sub-table and the second sub-table according to the path address of the first sub-table and the path address of the second sub-table.
In an embodiment, the configuration parameter includes a path address of a first sub-table and a path address of a second sub-table, the first sub-table is read according to the first path address in the configuration parameter, the second sub-table is read according to the second path address in the configuration parameter, wherein the first sub-table is used as a table to be combined, and the second sub-table is used as a combined table.
S130, determining the row where the preset value of the first sub-table is located as a row to be matched.
In one embodiment, the preset value is an identification of the data to be combined selected by the user, typically an identification of the data that is easily discernable by the user. For example, the user wants to combine the weights of Zhang three, lifour and Wang five, wherein the weight is the data to be combined, the name is the identification of the data, and Zhang three, lifour and Wang five are selected as the preset values.
In one embodiment, as shown in FIG. 2, the step S130 may include steps S131-S132.
S131, acquiring position information of a preset value of the first sub-table.
In an embodiment, the location information is specifically a number of rows and columns of a preset value, the preset value is searched in the record of the first sub-table according to the preset value, and the location information is obtained after the preset value is found. For example, the preset value is Zhang San, zhang San is searched in the first sub-table, position information of Zhang San is obtained after Zhang San is found, and the position information of Zhang San is column B and row 2.
S132, determining the row corresponding to the position information as a row to be matched.
In an embodiment, after the position information of the preset value is obtained, the row where the preset value is in the first sub-table is taken as the row to be matched, for example, the position information is the row B column 2, and then the row 2 is taken as the row to be matched of the first sub-table.
And S140, determining a value to be matched according to the column to be matched of the first sub-table and the row to be matched, and matching the value to be matched with the matching column of the second sub-table to determine a matching row.
In an embodiment, in order to match data with the second sub-table, a user needs to configure a column to be matched of the first sub-table and a matching column of the second sub-table to perform association matching in a parameter configuration process. Thus, the selected columns to be matched and the matching columns typically need to have an association to achieve matching. For example, the identification card number is selected as a column to be matched in the first sub-table, and the identification card number is also selected in the second sub-table to realize the matching.
In one embodiment, as shown in FIG. 3, the step S140 may include steps S141-S143.
S141, determining a value corresponding to a position where the column to be matched and the row to be matched of the first sub-table intersect as a value to be matched.
In an embodiment, after determining the row to be matched, a value corresponding to the intersection of the row to be matched is found as the value to be matched according to the column to be matched in the configuration parameter. For example, the last name of the behavior to be matched is Zhang three, the column to be matched is the ID card number, and then Zhang three is the value to be matched.
S142, searching a matching value which is the same as the value to be matched in a matching column of the second sub-table according to the value to be matched.
In an embodiment, after the value to be matched is obtained, searching the matching value identical to the value to be matched in the matching column of the second sub-table according to the value to be matched, and recording the position information of the matching value after the matching value is found. For example, the to-be-matched value is the identification card number of Zhang San, the matching column of the second sub-table is the identification card number, the identification card number which is the same as the identification card number of Zhang San is searched in the identification card number of the second sub-table, the identification card number is the matching value, and finally the position information of the identification card number is recorded.
S143, determining the row of the matching value as a matching row.
In an embodiment, after the location information of the matching value is recorded, the number of rows of the matching value is taken as a matching row, for example, the location information of the matching value is C column 3 rows, then the 3 rd row is determined as the matching row.
In one embodiment, as shown in FIG. 4. The step S142 further includes: s144.
S144, if the matching value is not found in the matching column of the second sub-table, a prompt message is generated.
In an embodiment, according to the to-be-matched value not finding the matching value identical to the to-be-matched value in the matching column of the second sub-table, it is indicated that the user may set the wrong configuration parameter, and the prompt message is generated. Specifically, the prompt message is a pop-up dialog box, and the dialog box specifically describes "unmatched success" to remind the user to reset the configuration parameters.
S150, determining a value to be combined according to the to-be-combined parallel of the first sub-table and the to-be-matched row, and combining the value to be combined to a combining position of a combining column of the second sub-table corresponding to the matched row.
In one embodiment, the data in the pending parallel of the first sub-table is used to merge into the second sub-table, and the merging column of the second sub-table is used to place the data in the pending parallel of the first sub-table. Thus, typically the column to be consolidated of the first sub-table is typically data that is not owned by the second sub-table, and the consolidated column of the second sub-table is typically a blank column, i.e., data that is not owned by the second sub-table is retrieved from the first sub-table and consolidated into the blank column of the second sub-table. It will be understood, of course, that the second co-ordinates may also be non-blank columns for which data to be acquired in the first sub-table is replaced with data co-ordinated in the second sub-table. In the configuration parameters, a user can select which columns of data to combine at will, so that the configuration can be flexible, and the operability is improved. For example, the first sub-table includes: name, ID card number, gender and height, the second sub-list comprises: name, ID card number, age and weight, the user only wants to merge the data of the gender column, then select the gender as the column to be merged, and select one column as the merging column in the blank column of the second sub-table, and merge the data of the gender column in the merging column of the second sub-table after executing merging. As shown in tables 1 and 2 and table 3.
Table 1:
Name of name | Identification card number | Sex (sex) | Height of body |
Zhang San (Zhang San) | 1234 | Man's body | 170 |
Liwu four-element bag | 5678 | Female | 160 |
Table 2:
Name of name | Identification card number | Age of | Weight of body | |
Zhang San (Zhang San) | 1234 | 40 | 70 | |
Liwu four-element bag | 5678 | 50 | 50 |
Table 3:
Name of name | Identification card number | Age of | Weight of body | Sex (sex) |
Zhang San (Zhang San) | 1234 | 40 | 70 | Man's body |
Liwu four-element bag | 5678 | 50 | 50 | Female |
Wherein, table 1 is a first sub-table, table 2 is a second sub-table, the gender column in table 1 is a column to be combined, the blank column in table 2 is a column to be combined, zhang three and Lisi are preset values, and the identification card numbers are a row to be matched and a matching row. Firstly, determining rows to be matched according to preset values Zhang III and Li IV, namely rows of Zhang III and Li IV in a table 1; then determining that the to-be-matched values are 1234 and 5678 respectively according to the crossing values of the to-be-matched line identification card number and the corresponding lines of Zhang III and Li IV; then matching the to-be-matched value with the matching column identity card number in the table 2 to find the same matching value 1234 and 5678, and determining the row where the matching value 1234 and 5678 are located as a matching row; determining that the to-be-combined values are male and female respectively according to the to-be-combined column gender of the table 1 and the intersecting value corresponding to the line where the to-be-matched line is located, and determining that the to-be-combined values are the combining positions according to the combining column of the table 2, namely the position where the blank column and the matched line intersect correspondingly; finally, the male and female to be combined values of table 1 are combined to the combining position of table 2, thereby completing the combination as shown in table 3.
In one embodiment, as shown in FIG. 5, the step S150 may include steps S151-S153.
S151, determining a value corresponding to a position where the to-be-combined parallel of the first sub-table is intersected with the to-be-matched row as a to-be-combined value.
S152, determining the position where the merging columns of the second sub-table intersect with the matching rows as a merging position.
S153, merging the values to be merged into the merging position.
In an embodiment, the value to be combined is data to be combined into the second sub-table, and after determining the row to be matched, the value corresponding to the intersection of the row to be matched and the row to be matched is determined as the value to be combined according to the parallel to be combined in the configuration parameter; then determining the merging position of the merging value, and determining the merging position according to the corresponding intersection position of the merging rows and the matching rows in the configuration parameters after determining the matching rows; and finally, merging the merging values in the first sub-table into the merging positions in the second sub-table.
S160, regenerating a total table according to the second sub table.
In one embodiment, after the merging is completed, the second sub-table after the merging is completed is stored as a regenerated total table to the designated path.
The embodiment of the invention discloses a data merging method, which is implemented by reading configuration parameters for merging tables; reading the first sub-table and the second sub-table according to the path address of the first sub-table and the path address of the second sub-table respectively; determining the row where the preset value of the first sub-table is located as a row to be matched; determining a value to be matched according to the column to be matched of the first sub-table and the row to be matched, and matching the value to be matched with the matching column of the second sub-table to determine a matching row; determining a value to be combined according to the to-be-combined parallel of the first sub-table and the to-be-matched row, and combining the value to be combined to a combining position corresponding to the matched row of a combining column of the second sub-table; and regenerating the total table according to the second sub table, so that the data merging efficiency can be improved, the error rate can be reduced, and the manpower resources can be saved.
Fig. 6 is a schematic block diagram of a data merging device 200 according to an embodiment of the present invention. As shown in fig. 6, the present invention further provides a data merging device 200 corresponding to the above data merging method. The data combining apparatus 200 includes a unit for performing the above-described data combining method, and may be configured in a desktop computer, a tablet computer, a portable computer, or the like. Specifically, referring to fig. 6, the data merging device 200 includes a first reading unit 210, a second reading unit 220, a first determining unit 230, a matching unit 240, a merging unit 250, and a generating unit 260.
A first reading unit 210, configured to read configuration parameters for merging tables, where the configuration parameters include: the method comprises the steps of setting a path address of a first sub-table and a path address of a second sub-table, wherein a preset value, a column to be matched and a column to be combined of the first sub-table are parallel, and a matching column and a combining column of the second sub-table are arranged.
In one embodiment, the configuration parameters are parameter conditions for merging the tables that are pre-configured by the user. After setting configuration parameters in the Excel data matching tool, a user can combine multiple sub-tables into a total table by executing the Excel data matching tool.
The second reading unit 220 is configured to read the first sub-table and the second sub-table according to the path address of the first sub-table and the path address of the second sub-table, respectively.
In an embodiment, the configuration parameter includes a path address of a first sub-table and a path address of a second sub-table, the first sub-table is read according to the first path address in the configuration parameter, the second sub-table is read according to the second path address in the configuration parameter, wherein the first sub-table is used as a table to be combined, and the second sub-table is used as a combined table.
A first determining unit 230, configured to determine a row where a preset value of the first sub-table is located as a row to be matched.
In one embodiment, the preset value is an identification of the data to be combined selected by the user, typically an identification of the data that is easily discernable by the user. For example, the user wants to combine the weights of Zhang three, lifour and Wang five, wherein the weight is the data to be combined, the name is the identification of the data, and Zhang three, lifour and Wang five are selected as the preset values.
In an embodiment, as shown in fig. 7, the first determining unit 230 may include a subunit: the acquisition unit 231 and the first determination subunit 232.
An obtaining unit 231, configured to obtain location information of a preset value of the first sub-table.
In an embodiment, the location information is specifically a number of rows and columns of a preset value, the preset value is searched in the record of the first sub-table according to the preset value, and the location information is obtained after the preset value is found. For example, the preset value is Zhang San, zhang San is searched in the first sub-table, position information of Zhang San is obtained after Zhang San is found, and the position information of Zhang San is column B and row 2.
A first determining subunit 232, configured to determine the row of the location information as a row to be matched.
In an embodiment, after the position information of the preset value is obtained, the row where the preset value is in the first sub-table is taken as the row to be matched, for example, the position information is the row B column 2, and then the row 2 is taken as the row to be matched of the first sub-table.
And a matching unit 240, configured to determine a value to be matched according to the column to be matched and the row to be matched of the first sub-table, and match the value to be matched with the matching column of the second sub-table to determine a matching row.
In an embodiment, in order to match data with the second sub-table, a user needs to configure a column to be matched of the first sub-table and a matching column of the second sub-table to perform association matching in a parameter configuration process. Thus, the selected columns to be matched and the matching columns typically need to have an association to achieve matching. For example, the identification card number is selected as a column to be matched in the first sub-table, and the identification card number is also selected in the second sub-table to realize the matching.
In one embodiment, as shown in fig. 7, the matching unit 240 may include the following subunits: a second determination subunit 241, a lookup unit 242, and a third determination subunit 243.
A second determining subunit 241, configured to determine a value corresponding to a position where the column to be matched and the row to be matched of the first sub-table intersect as a value to be matched.
In an embodiment, after determining the row to be matched, a value corresponding to the intersection of the row to be matched is found as the value to be matched according to the column to be matched in the configuration parameter. For example, the last name of the behavior to be matched is Zhang three, the column to be matched is the ID card number, and then Zhang three is the value to be matched.
And a searching unit 242, configured to search, according to the value to be matched, for a matching value that is the same as the value to be matched in a matching column of the second sub-table.
In an embodiment, after the value to be matched is obtained, searching the matching value identical to the value to be matched in the matching column of the second sub-table according to the value to be matched, and recording the position information of the matching value after the matching value is found. For example, the to-be-matched value is the identification card number of Zhang San, the matching column of the second sub-table is the identification card number, the identification card number which is the same as the identification card number of Zhang San is searched in the identification card number of the second sub-table, the identification card number is the matching value, and finally the position information of the identification card number is recorded.
A third determining subunit 243, configured to determine the row of the matching value as a matching row.
In an embodiment, after the location information of the matching value is recorded, the number of rows of the matching value is taken as a matching row, for example, the location information of the matching value is C column 3 rows, then the 3 rd row is determined as the matching row.
In one embodiment, as shown in fig. 8, the matching unit 240 further includes: a prompting unit 244.
A prompting unit 244, configured to generate a prompting message if no matching value is found in the matching columns of the second sub-table.
In an embodiment, according to the to-be-matched value not finding the matching value identical to the to-be-matched value in the matching column of the second sub-table, it is indicated that the user may set the wrong configuration parameter, and the prompt message is generated. Specifically, the prompt message is a pop-up dialog box, and the dialog box specifically describes "unmatched success" to remind the user to reset the configuration parameters.
And the merging unit 250 is configured to determine a value to be merged according to the to-be-merged parallel of the first sub-table and the to-be-matched line, and merge the value to be merged into a merging position corresponding to the matched line in a merging column of the second sub-table.
In one embodiment, the data in the pending parallel of the first sub-table is used to merge into the second sub-table, and the merging column of the second sub-table is used to place the data in the pending parallel of the first sub-table. Thus, typically the column to be consolidated of the first sub-table is typically data that is not owned by the second sub-table, and the consolidated column of the second sub-table is typically a blank column, i.e., data that is not owned by the second sub-table is retrieved from the first sub-table and consolidated into the blank column of the second sub-table. It will be understood, of course, that the second co-ordinates may also be non-blank columns for which data to be acquired in the first sub-table is replaced with data co-ordinated in the second sub-table. In the configuration parameters, a user can select which columns of data to combine at will, so that the configuration can be flexible, and the operability is improved. For example, the first sub-table includes: name, ID card number, gender and height, the second sub-list comprises: name, ID card number, age and weight, the user only wants to merge the data of the gender column, then select the gender as the column to be merged, and select one column as the merging column in the blank column of the second sub-table, and merge the data of the gender column in the merging column of the second sub-table after executing merging. As shown in tables 1 and 2 and table 3.
Table 1:
Name of name | Identification card number | Sex (sex) | Height of body |
Zhang San (Zhang San) | 1234 | Man's body | 170 |
Liwu four-element bag | 5678 | Female | 160 |
Table 2:
Name of name | Identification card number | Age of | Weight of body | |
Zhang San (Zhang San) | 1234 | 40 | 70 | |
Liwu four-element bag | 5678 | 50 | 50 |
Table 3:
Name of name | Identification card number | Age of | Weight of body | Sex (sex) |
Zhang San (Zhang San) | 1234 | 40 | 70 | Man's body |
Liwu four-element bag | 5678 | 50 | 50 | Female |
Wherein, table 1 is a first sub-table, table 2 is a second sub-table, the gender column in table 1 is a column to be combined, the blank column in table 2 is a column to be combined, zhang three and Lisi are preset values, and the identification card numbers are a row to be matched and a matching row. Firstly, determining rows to be matched according to preset values Zhang III and Li IV, namely rows of Zhang III and Li IV in a table 1; then determining that the to-be-matched values are 1234 and 5678 respectively according to the crossing values of the to-be-matched line identification card number and the corresponding lines of Zhang III and Li IV; then matching the to-be-matched value with the matching column identity card number in the table 2 to find the same matching value 1234 and 5678, and determining the row where the matching value 1234 and 5678 are located as a matching row; determining that the to-be-combined values are male and female respectively according to the to-be-combined column gender of the table 1 and the intersecting value corresponding to the line where the to-be-matched line is located, and determining that the to-be-combined values are the combining positions according to the combining column of the table 2, namely the position where the blank column and the matched line intersect correspondingly; finally, the male and female to be combined values of table 1 are combined to the combining position of table 2, thereby completing the combination as shown in table 3.
In one embodiment, as shown in fig. 7, the merging unit 250 may include the following subunits: a fourth determination subunit 251, a fifth determination subunit 252, and a merging subunit 253.
A fourth determining subunit 251, configured to determine, as a value to be combined, a value corresponding to a position where the to-be-combined side of the first sub-table intersects the to-be-matched line.
A fifth determining subunit 252 is configured to determine, as a merging position, a position where the merging column of the second sub-table intersects the matching row.
A merging subunit 253, configured to merge the values to be merged into the merging position.
In an embodiment, the value to be combined is data to be combined into the second sub-table, and after determining the row to be matched, the value corresponding to the intersection of the row to be matched and the row to be matched in the configuration parameter is determined as the value to be combined; then determining the merging position of the merging value, and determining the merging position according to the corresponding intersection position of the merging rows and the matching rows in the configuration parameters after determining the matching rows; and finally, merging the merging values in the first sub-table into the merging positions in the second sub-table.
And a generating unit 260, configured to regenerate the total table according to the second table.
In one embodiment, after the merging is completed, the second sub-table after the merging is completed is stored as a regenerated total table to the designated path.
The embodiment of the invention discloses a data merging device, which is used for reading configuration parameters for merging tables; reading the first sub-table and the second sub-table according to the path address of the first sub-table and the path address of the second sub-table respectively; determining the row where the preset value of the first sub-table is located as a row to be matched; determining a value to be matched according to the column to be matched of the first sub-table and the row to be matched, and matching the value to be matched with the matching column of the second sub-table to determine a matching row; determining a value to be combined according to the to-be-combined parallel of the first sub-table and the to-be-matched row, and combining the value to be combined to a combining position corresponding to the matched row of a combining column of the second sub-table; and regenerating the total table according to the second sub table, so that the data merging efficiency can be improved, the error rate can be reduced, and the manpower resources can be saved.
The above-described data merging means may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 9.
Referring to fig. 9, fig. 9 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a terminal, wherein the terminal may be a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like.
With reference to FIG. 9, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a data merge method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the non-volatile storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform a data merging method.
The network interface 505 is used for network communication with other devices. It will be appreciated by those skilled in the art that the architecture shown in fig. 9 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting of the computer device 500 to which the present inventive arrangements may be implemented, as a particular computer device 500 may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
Wherein the processor 502 is configured to execute a computer program 5032 stored in a memory to implement the steps of: reading configuration parameters for merging the tables; reading the first sub-table and the second sub-table according to the path address of the first sub-table and the path address of the second sub-table respectively; determining the row where the preset value of the first sub-table is located as a row to be matched; determining a value to be matched according to the column to be matched of the first sub-table and the row to be matched, and matching the value to be matched with the matching column of the second sub-table to determine a matching row; determining a value to be combined according to the to-be-combined parallel of the first sub-table and the to-be-matched row, and combining the value to be combined to a combining position corresponding to the matched row of a combining column of the second sub-table; and regenerating a total table according to the second sub table.
In an embodiment, when the step of determining the row where the preset value of the first sub-table is located as the row to be matched is implemented by the processor 502, the following steps are specifically implemented: acquiring position information of a preset value of the first sub-table; and determining the row corresponding to the position information as a row to be matched.
In an embodiment, when the step of determining the value to be matched according to the column to be matched and the row to be matched of the first sub-table and matching the value to be matched with the matching column of the second sub-table to determine the matched row, the processor 502 further implements the following steps: determining a value corresponding to a position where a column to be matched of the first sub-table intersects with the row to be matched as a value to be matched; searching a matching value which is the same as the value to be matched in a matching column of the second sub-table according to the value to be matched; and determining the row of the matching value as a matching row.
In an embodiment, when implementing the step of determining the value to be combined according to the combination of the first sub-table and the row to be matched and combining the value to be combined to the combining position corresponding to the matching row in the combining column of the second sub-table, the processor 502 further implements the following steps: determining a value corresponding to a position of the first sub-table, at which the to-be-combined parallel and the to-be-matched line intersect, as a to-be-combined value; determining a position where the merging columns of the second sub-table intersect with the matching rows as a merging position; and merging the values to be merged into the merging position.
In an embodiment, after implementing the step of searching the matching column of the second sub-table for the matching value identical to the value to be matched according to the value to be matched, the processor 502 further implements the following steps: and if the matching value is not found in the matching column of the second sub-table, generating a prompt message.
It should be appreciated that in embodiments of the present application, the Processor 502 may be a central processing unit (Central Processing Unit, CPU), the Processor 502 may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL processors, DSPs), application SPECIFIC INTEGRATED Circuits (ASICs), off-the-shelf Programmable gate arrays (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program comprises program instructions, and the computer program can be stored in a storage medium, which is a computer readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. The program instructions, when executed by the processor, cause the processor to perform the steps of: reading configuration parameters for merging the tables; reading the first sub-table and the second sub-table according to the path address of the first sub-table and the path address of the second sub-table respectively; determining the row where the preset value of the first sub-table is located as a row to be matched; determining a value to be matched according to the column to be matched of the first sub-table and the row to be matched, and matching the value to be matched with the matching column of the second sub-table to determine a matching row; determining a value to be combined according to the to-be-combined parallel of the first sub-table and the to-be-matched row, and combining the value to be combined to a combining position corresponding to the matched row of a combining column of the second sub-table; and regenerating a total table according to the second sub table.
In an embodiment, when the processor executes the program instruction to implement the step of determining the row where the preset value of the first sub-table is located as the row to be matched, the method specifically includes the following steps: acquiring position information of a preset value of the first sub-table; and determining the row corresponding to the position information as a row to be matched.
In an embodiment, when the processor executes the program instruction to implement the step of determining a value to be matched according to the column to be matched and the row to be matched of the first sub-table, and matching the value to be matched with the matching column of the second sub-table to determine a matched row, the method specifically includes the following steps: determining a value corresponding to a position where a column to be matched of the first sub-table intersects with the row to be matched as a value to be matched; searching a matching value which is the same as the value to be matched in a matching column of the second sub-table according to the value to be matched; and determining the row of the matching value as a matching row.
In an embodiment, when the processor executes the program instruction to implement the step of determining a value to be combined according to the to-be-combined row and the to-be-matched row of the first sub-table, and combining the value to be combined to a combining position corresponding to the matched row in a combining column of the second sub-table, the specific implementation steps include: determining a value corresponding to a position of the first sub-table, at which the to-be-combined parallel and the to-be-matched line intersect, as a to-be-combined value; determining a position where the merging columns of the second sub-table intersect with the matching rows as a merging position; and merging the values to be merged into the merging position.
In an embodiment, after executing the program instructions to implement the step of searching for a matching value identical to the value to be matched in the matching column of the second sub-table according to the value to be matched, the processor further implements the steps of: and if the matching value is not found in the matching column of the second sub-table, generating a prompt message.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.
Claims (5)
1. A method of data merging, comprising:
reading configuration parameters for merging tables, wherein the configuration parameters comprise: the method comprises the steps of setting a path address of a first sub-table and a path address of a second sub-table, wherein a preset value, a column to be matched and a column to be combined of the first sub-table are parallel, and a matching column and a combining column of the second sub-table are arranged;
reading the first sub-table and the second sub-table according to the path address of the first sub-table and the path address of the second sub-table respectively;
determining the row where the preset value of the first sub-table is located as a row to be matched;
Determining a value to be matched according to the column to be matched of the first sub-table and the row to be matched, and matching the value to be matched with the matching column of the second sub-table to determine a matching row;
determining a value to be combined according to the to-be-combined parallel of the first sub-table and the to-be-matched row, and combining the value to be combined to a combining position corresponding to the matched row of a combining column of the second sub-table;
Regenerating a summary table according to the second sub table;
the determining a value to be matched according to the column to be matched and the row to be matched of the first sub-table, and matching the value to be matched with the matching column of the second sub-table to determine a matching row, includes:
Determining a value corresponding to a position where a column to be matched of the first sub-table intersects with the row to be matched as a value to be matched;
searching a matching value which is the same as the value to be matched in a matching column of the second sub-table according to the value to be matched;
Determining the row of the matching value as a matching row;
after searching the matching value identical to the value to be matched in the matching column of the second sub-table according to the value to be matched, the method further comprises:
If no matching value is found in the matching column of the second sub-table, generating a prompt message;
The determining a value to be combined according to the parallel to be combined and the line to be matched of the first sub-table, and combining the value to be combined to a combining position corresponding to the matching line of a combining column of the second sub-table, includes:
Determining a value corresponding to a position of the first sub-table, at which the to-be-combined parallel and the to-be-matched line intersect, as a to-be-combined value;
determining a position where the merging columns of the second sub-table intersect with the matching rows as a merging position;
And merging the values to be merged into the merging position, wherein if the merging column is a non-blank column, the values to be merged obtained in the first sub-table are replaced by the data in the second sub-table.
2. The method for merging data according to claim 1, wherein determining the row in which the preset value of the first sub-table is located as the row to be matched includes:
acquiring position information of a preset value of the first sub-table;
and determining the row corresponding to the position information as a row to be matched.
3. A data merge device, comprising:
a first reading unit, configured to read configuration parameters for merging tables, where the configuration parameters include: the method comprises the steps of setting a path address of a first sub-table and a path address of a second sub-table, wherein a preset value, a column to be matched and a column to be combined of the first sub-table are parallel, and a matching column and a combining column of the second sub-table are arranged;
the second reading unit is used for respectively reading the first sub-table and the second sub-table according to the path address of the first sub-table and the path address of the second sub-table;
A first determining unit, configured to determine a row where a preset value of the first sub-table is located as a row to be matched;
The matching unit is used for determining a value to be matched according to the column to be matched of the first sub-table and the row to be matched, and matching the value to be matched with the matching column of the second sub-table to determine a matching row;
a second determining subunit, configured to determine, as a value to be matched, a value corresponding to a position where a column to be matched of the first sub-table intersects with the row to be matched;
the searching unit is used for searching the matching value which is the same as the value to be matched in the matching column of the second sub-table according to the value to be matched;
a third determining subunit, configured to determine that the line where the match value is located is a matching line;
The merging unit is used for determining a value to be merged according to the to-be-merged parallel of the first sub-table and the to-be-matched row and merging the value to be merged into a merging position corresponding to the matched row of a merging column of the second sub-table;
A generating unit for regenerating a summary table according to the second sub table;
The prompting unit is used for generating a prompting message if the matching value is not found in the matching column of the second sub-table;
A fourth determining subunit, configured to determine, as a value to be combined, a value corresponding to a position where the to-be-combined row of the first sub-table intersects the to-be-matched row;
a fifth determining subunit configured to determine, as a merging position, a position at which a merging column of the second sub-table intersects the matching row;
and the merging subunit is used for merging the values to be merged into the merging position, wherein if the merging column is a non-blank column, the values to be merged acquired in the first sub-table are replaced by the data in the second sub-table, which are merged.
4. A computer device, characterized in that it comprises a memory on which a computer program is stored and a processor which, when executing the computer program, implements the method according to any of claims 1-2.
5. A computer readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method according to any of claims 1-2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811184985.2A CN109447134B (en) | 2018-10-11 | 2018-10-11 | Data merging method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811184985.2A CN109447134B (en) | 2018-10-11 | 2018-10-11 | Data merging method, device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109447134A CN109447134A (en) | 2019-03-08 |
CN109447134B true CN109447134B (en) | 2024-07-02 |
Family
ID=65546204
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811184985.2A Active CN109447134B (en) | 2018-10-11 | 2018-10-11 | Data merging method, device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109447134B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113705175B (en) * | 2021-08-18 | 2024-02-23 | 厦门海迈科技股份有限公司 | Method, server and storage medium for simplifying rows and columns of electronic forms |
CN114186538A (en) * | 2021-12-03 | 2022-03-15 | 上海软素科技有限公司 | Data processing method and device, computer readable storage medium and electronic equipment |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8312366B2 (en) * | 2009-02-11 | 2012-11-13 | Microsoft Corporation | Displaying multiple row and column header areas in a summary table |
JP6132698B2 (en) * | 2013-07-31 | 2017-05-24 | 株式会社日立製作所 | Tabular multidimensional data conversion method and apparatus |
CN108153719A (en) * | 2016-12-02 | 2018-06-12 | 北京国双科技有限公司 | Merge the method and apparatus of electrical form |
-
2018
- 2018-10-11 CN CN201811184985.2A patent/CN109447134B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN109447134A (en) | 2019-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106933863B (en) | Data clearing method and device | |
CN107783861B (en) | Transaction rollback method, device, storage medium and computer equipment | |
CN109447134B (en) | Data merging method, device, computer equipment and storage medium | |
CN110674109A (en) | Data import method, system, computer device and computer readable storage medium | |
JP6331756B2 (en) | Test case generation program, test case generation method, and test case generation apparatus | |
US11106908B2 (en) | Techniques to determine document recognition errors | |
CN108073707B (en) | Financial business data updating method and device and computer readable storage medium | |
CN105117489B (en) | Database management method and device and electronic equipment | |
CN111199146B (en) | Test report generation method, device, computer equipment and storage medium | |
US9785724B2 (en) | Secondary queue for index process | |
JP4726889B2 (en) | Optimizing database access for record linking by tiling the space of record pairs | |
CN113272785B (en) | Method for mounting file system, terminal equipment and storage medium | |
WO2017071554A1 (en) | Upgrade method and device for account of designated platform | |
CN110674104A (en) | Feature combination screening method and device, computer equipment and storage medium | |
CN113305837B (en) | Method and device for determining deviation information of robot, processing equipment and medium | |
CN109918620B (en) | Policy information display method, device, computer equipment and storage medium | |
CN116050361A (en) | Data filling method and device for table, electronic equipment and storage medium | |
CN111061688B (en) | Statistical variable naming method, device, computer equipment and storage medium | |
CN116882408B (en) | Construction method and device of transformer graph model, computer equipment and storage medium | |
CN113190472B (en) | Method and device for quickly reconstructing NOMAP information of solid-state storage equipment, computer equipment and storage medium | |
WO2024193195A1 (en) | Hardware compatibility test method and apparatus, computing device cluster, and program product | |
CN110019288B (en) | Data operation method and device | |
US20240005235A1 (en) | Method and system for dynamically recommending commands for performing a product data management operation | |
CN109871215B (en) | Method and device for software release | |
CN111078714B (en) | Data processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant |