Table file data automatic updating method and device, equipment, and storage medium

By generating backup tables and automatically comparing update data, combining background color annotations and preset file collection management, the problem of cumbersome and errors in table file updates is solved, efficient automatic updates are achieved, and manual investment and errors are reduced.

CN118519975BActive Publication Date: 2024-11-05GUANGZHOU INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410672989.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-11-05
Estimated Expiration
2044-05-28

AI Technical Summary

Technical Problem

In table files involving data updates of multiple people, the prior art requires manual line-by-line proofreading, resulting in cumbersome, time-consuming and error-prone.

Method used

By generating the original file backup table, traverse the table files that need to be merged, compare each row of data, automatically update different data and use background color annotations, and manage update records in combination with preset file collections to achieve automatic update of table file data.

Benefits of technology

It improves the efficiency of table update work, reduces manual investment, reduces manual errors, and clearly displays the update situation through background color markings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118519975B_ABST
    Figure CN118519975B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of file data processing, and discloses a method and device, equipment, and storage medium for automatically updating table file data. The method generates an original file backup table according to an original first table file; traverses each row in a second table file to be merged as the current row, compares the current row data in the second table file with the corresponding row data in the first table file and the original file backup table; if the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is the same as the corresponding row data in the first table file, updates the current row data in the second table file to the corresponding row in the first table file, and marks the background color of the corresponding row data in the first table file, thereby realizing automatic updating of table file data, improving the efficiency of table updating work, reducing manual input, and reducing manual errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of file data processing, and in particular relates to a method and device, equipment and storage medium for automatically updating table file data. Background Art

[0002] In daily work, we often update table data to facilitate subsequent statistical analysis. When updating table data, we usually need to overwrite and replace the updated data in a certain row of the table. If there are a lot of data or people involved, we usually need to manually proofread the data in each table row to identify the rows that need to be updated. This kind of table update work is cumbersome, time-consuming, and prone to errors. Summary of the invention

[0003] The purpose of the present invention is to provide a method and device, equipment, and storage medium for automatically updating table file data, which can realize automatic updating of table file data, improve the efficiency of table updating work, reduce manual input, and reduce manual errors.

[0004] The first aspect of the present invention discloses a method for automatically updating table file data, comprising:

[0005] Generate an original file backup table according to the original first table file;

[0006] Traverse each row in the second table file to be merged as the current row, and compare the current row data in the second table file with the corresponding row data in the first table file and the original file backup table;

[0007] If the current row of data in the second table file is the same as the corresponding row of data in the original file backup table, then the next row of data is compared;

[0008] If the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is the same as the corresponding row data in the first table file, update the current row data in the second table file to the corresponding row in the first table file, and mark the corresponding row data in the first table file with the first background color.

[0009] In some embodiments, the method further comprises:

[0010] If the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is different from the corresponding row data in the first table file, the current row data in the second table file is updated to the corresponding row in the first table file, and the corresponding row data in the first table file is marked with a second background color, wherein the first background color and the second background color are different.

[0011] In some embodiments, after marking the corresponding row data in the first table file with the first background color, the method further includes:

[0012] Determine whether each map data structure in the preset file set has a key value that is the number of rows that need to be updated;

[0013] If it exists, add the file name of the second table file to the key value corresponding to the key value;

[0014] If it does not exist, insert a new map data structure into the preset file collection, the key value in the new map data structure is the number of rows, and the corresponding key value is the file name of the second table file.

[0015] In some embodiments, after marking the corresponding row data in the first table file with the second background color, the method further includes:

[0016] Determine whether each map data structure in the preset file set has a key value that is the number of rows that need to be updated;

[0017] If it exists, add the file name of the second table file to the key value corresponding to the key value;

[0018] If it does not exist, insert a new map data structure into the preset file collection, the key value in the new map data structure is the number of rows, and the corresponding key value is the file name of the second table file.

[0019] In some embodiments, the method further comprises:

[0020] After the comparison is completed, the first table file and the original file backup table are saved, and the map data structure of the preset file set is written into the merged update record text.

[0021] A second aspect of the present invention discloses a device for automatically updating table file data, comprising:

[0022] A generating unit, used for generating an original file backup table according to the original first table file;

[0023] A comparison unit is used to traverse each row in the second table file to be merged as the current row, and compare the current row data in the second table file with the corresponding row data in the first table file and the original file backup table; if the current row data in the second table file is the same as the corresponding row data in the original file backup table, then compare the data of the next row;

[0024] The first merging unit is used to update the current row data in the second table file to the corresponding row in the first table file, and mark the corresponding row data in the first table file with a first background color when it is found that the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is the same as the corresponding row data in the first table file.

[0025] In some embodiments, it also includes:

[0026] The second merging unit is used to update the current row data in the second table file to the corresponding row in the first table file, and mark the corresponding row data in the first table file with a second background color when it is found that the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is different from the corresponding row data in the first table file. The first background color and the second background color are different.

[0027] In some embodiments, it also includes:

[0028] A first judging unit is used to judge whether there is a key value of each map data structure in the preset file set with a row number that needs to be updated after the first merging unit marks the corresponding row data in the first table file with a first background color;

[0029] A first updating unit, configured to add the file name of the second table file to the key value corresponding to the key value when the first determining unit determines that the file exists;

[0030] The first insertion unit is used to insert a new map data structure into the preset file set when the first judgment unit determines that it does not exist, the key value in the new map data structure is the number of rows, and the corresponding key value is the file name of the second table file.

[0031] The third aspect of the present invention discloses an electronic device, comprising a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the automatic update method of table file data disclosed in the first aspect.

[0032] A fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the method for automatically updating table file data disclosed in the first aspect.

[0033] The beneficial effect of the present invention lies in that an original file backup table is generated according to an original first table file; each row in a second table file to be merged is traversed as the current row, and the current row data in the second table file is compared with the corresponding row data in the first table file and the original file backup table; if the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is the same as the corresponding row data in the first table file, the current row data in the second table file is updated to the corresponding row in the first table file, and the background color of the corresponding row data in the first table file is marked, thereby realizing automatic updating of table file data, improving the efficiency of table updating work, reducing manual input, and reducing manual errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The accompanying drawings herein show specific examples of the technical solutions described in the present invention, and together with the specific implementation methods, constitute a part of the specification, and are used to explain the technical solutions, principles and effects of the present invention.

[0035] Unless otherwise specified or defined, the same reference numerals in different drawings represent the same or similar technical features, and the same or similar technical features may also be represented by different reference numerals.

[0036] Figure 1 It is a flow chart of a method for automatically updating table file data disclosed in an embodiment of the present invention;

[0037] Figure 2 It is a structural schematic diagram of a device for automatically updating table file data disclosed in an embodiment of the present invention;

[0038] Figure 3 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present invention.

[0039] Description of reference numerals:

[0040] 201, generating unit; 202, comparing unit; 203, first merging unit; 301, memory; 302, processor. DETAILED DESCRIPTION

[0041] Unless otherwise specified or defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art. In the case of combining the technical solution of the present invention with realistic scenarios, all technical and scientific terms used herein may also have meanings corresponding to the purpose of implementing the technical solution of the present invention. The "first, second..." used herein is only used to distinguish the names and does not represent a specific quantity or order. The term "and / or" used herein includes any and all combinations of one or more related listed items.

[0042] It should be noted that when a component is considered to be "fixed to" another component, it can be directly fixed to the other component or there can be a central component; when an component is considered to be "connected to" another component, it can be directly connected to the other component or there can be a central component at the same time; when an component is considered to be "installed on" another component, it can be directly installed on the other component or there can be a central component at the same time. When an component is considered to be "set on" another component, it can be directly set on the other component or there can be a central component at the same time.

[0043] Unless otherwise specified or defined, the "said" and "the" used in this document refer to the technical features or technical contents mentioned or described before the corresponding position, and the technical features or technical contents may be the same as or similar to the technical features or technical contents mentioned therein. In addition, the terms "including" and "having" and any variations thereof used in this document are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.

[0044] The embodiment of the present invention discloses a method for automatically updating table file data, which can be implemented by computer programming. The execution subject of the method can be an electronic device such as a computer, a laptop computer, a tablet computer, or a table file data automatic updating device embedded in an electronic device, and the present invention is not limited to this. In order to facilitate the understanding of the present invention, the specific embodiments of the present invention will be described in more detail below with reference to the drawings of the specification.

[0045] like Figure 1 As shown, the table file data automatic update method includes the following steps 110 to 140:

[0046] 110. Generate an original file backup table based on the original first table file.

[0047] In an embodiment of the present invention, all files to be merged are compared with the original files one by one. Before the file comparison is performed, an original file backup table is generated to assist in data merging. When merging data, each file to be merged is opened in turn, and the table file data automatic update method provided by the present invention is executed for each file to be merged. The original file is defined as the first table file, and the file to be merged is defined as the second table file. The first table file, the second table file and the original file backup table can all be specifically Excel tables.

[0048] In the embodiment of the present invention, an empty preset file set list is also generated, and the preset file set list is used to store updated row data, and each row is stored in a map data structure, and the key value is the updated row number, and the corresponding key value is the file name from which the update comes. And a new file is generated, and the file name is merged update record, and its format is txt text format.

[0049] 120. Traverse each row in the second table file to be merged as the current row, and compare the current row data in the second table file with the corresponding row data in the first table file and the original file backup table.

[0050] Starting from the first row of the second table file, each row of the second table file is compared with the corresponding row data in the first table file and the original file backup table.

[0051] 130. If the current row of data in the second table file is the same as the corresponding row of data in the original file backup table, then perform data comparison on the next row.

[0052] 140. If the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is the same as the corresponding row data in the first table file, update the current row data in the second table file to the corresponding row in the first table file, and mark the corresponding row data in the first table file with the first background color.

[0053] Among them, the first background color can be set to green, indicating that the data has been updated and automatically confirmed to be correct.

[0054] Furthermore, after marking the corresponding row data in the first table file with the first background color, the following steps S11 to S13 (not shown) may be performed:

[0055] S11. Determine whether each map data structure in the preset file set has a key value corresponding to the number of rows that need to be updated; if so, execute step S12; if not, execute step S13.

[0056] S12. Add the file name of the second table file to the key value corresponding to the key value.

[0057] Among them, the method of updating the key value corresponding to the key value is specifically: add the file name of the second table file after the original key value, and the key value corresponding to the updated key value is: original key value + comma + file name of the second table file (that is, the file name from which the update comes).

[0058] S13. Insert a new map data structure into the preset file set. The key value in the new map data structure is the number of rows, and the corresponding key value is the file name of the second table file.

[0059] In some embodiments, if the comparison shows that the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is different from the corresponding row data in the first table file, the current row data in the second table file is updated to the corresponding row in the first table file, and the corresponding row data in the first table file is marked with a second background color, wherein the first background color and the second background color are different. For example, the second background color can be set to red, indicating that the data has been updated and multiple files have conflicts and need to be manually confirmed.

[0060] After marking the corresponding row data in the first table file with the second background color, steps S21 to S23 (not shown) may be performed:

[0061] S21. Determine whether each map data structure in the preset file set has a key value corresponding to the number of rows that need to be updated; if so, execute step S22; if not, execute step S23.

[0062] S22. If it exists, add the file name of the second table file to the key value corresponding to the key value.

[0063] S23. If it does not exist, insert a new map data structure into the preset file set, the key value in the new map data structure is the number of rows, and the corresponding key value is the file name of the second table file.

[0064] The specific implementation of steps S21 to S23 is the same as that of the above steps S11 to S13, and will not be described in detail here.

[0065] Finally, when all rows in the second table files to be merged have been traversed and all the second table files to be merged have been merged into the original first table files, it is determined that the comparison is completed.

[0066] After the comparison is completed, the first table file and the original file backup table are saved, and the map data structure of the preset file set is written into the merge update record. The merge update record is in txt format, which is convenient for data verification.

[0067] After the files are automatically merged, you only need to open the original first table file, and you can clearly know the data update status through the color background of the data in the first table file. If the background is green, it means that the data has been updated and automatically confirmed to be correct; if the background is red, it means that multiple data files have been modified and need to be manually confirmed, which can be found and confirmed manually by merging the update record .txt. If the background is unmarked and is white by default, it means that the data has not been updated and manual confirmation is required to determine whether it is true that there is no change or there is a missing feedback. It should be noted that the background color marking can be adjusted to other colors that the user is accustomed to, and the present invention does not specifically limit this.

[0068] In summary, by implementing the embodiments of the present invention, the table file data can be efficiently proofread through automatic updating of the table file, which greatly reduces the manual input, efficiently locates the problematic data, and reduces manual errors.

[0069] like Figure 2 As shown, the embodiment of the present invention discloses a device for automatically updating table file data, including a generating unit 201, a comparing unit 202, and a first merging unit 203, wherein:

[0070] A generating unit 201 is used to generate an original file backup table according to the original first table file;

[0071] The comparison unit 202 is used to traverse each row in the second table file to be merged as the current row, and compare the current row data in the second table file with the corresponding row data in the first table file and the original file backup table; if the current row data in the second table file is the same as the corresponding row data in the original file backup table, then compare the data of the next row;

[0072] The first merging unit 203 is used to update the current row data in the second table file to the corresponding row in the first table file, and mark the corresponding row data in the first table file with a first background color when it is found that the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is the same as the corresponding row data in the first table file.

[0073] As an optional embodiment, the above-mentioned automatic updating device for table file data also includes a second merging unit not shown in the figure, which is used to update the current row data in the second table file to the corresponding row in the first table file when it is compared that the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is different from the corresponding row data in the first table file. The corresponding row data in the first table file is marked with a second background color, wherein the first background color and the second background color are different.

[0074] As an optional implementation, the above-mentioned table file data automatic updating device further includes the following units not shown in the figure:

[0075] A first judging unit is used to judge whether there is a key value of each map data structure in the preset file set with the number of rows that need to be updated after the first merging unit 203 marks the corresponding row data in the first table file with the first background color;

[0076] A first updating unit, configured to add the file name of the second table file to the key value corresponding to the key value when the first judging unit judges that the file exists;

[0077] The first inserting unit is used to insert a new map data structure into the preset file set when the first judging unit judges that it does not exist, the key value in the new map data structure is the number of rows, and the corresponding key value is the file name of the second table file.

[0078] As an optional implementation, the above-mentioned table file data automatic updating device further includes the following units not shown in the figure:

[0079] A second judgment unit is used to judge whether there is a key value of each map data structure in the preset file set with the number of rows that need to be updated after the second merging unit marks the corresponding row data in the first table file with a second background color;

[0080] A second updating unit is used to add the file name of the second table file to the key value corresponding to the key value when the second judging unit judges that the file exists;

[0081] The second insertion unit is used to insert a new map data structure into the preset file set when the second judgment unit determines that it does not exist. The key value in the new map data structure is the number of rows, and the corresponding key value is the file name of the second table file.

[0082] As an optional implementation, the above-mentioned table file data automatic update device also includes the following recording unit (not shown), which is used to save the first table file and the original file backup table after the comparison is completed, and write the map data structure of the preset file set into the merged update record text.

[0083] like Figure 3 As shown, an embodiment of the present invention discloses an electronic device, including a memory 301 storing executable program codes and a processor 302 coupled to the memory 301;

[0084] The processor 302 calls the executable program code stored in the memory 301 to execute the table file data automatic update method described in the above embodiments.

[0085] An embodiment of the present invention further discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the method for automatically updating table file data described in the above embodiments.

[0086] The purpose of the above embodiments is to exemplarily reproduce and deduce the technical solution of the present invention, and to fully describe the technical solution, purpose and effect of the present invention. Its purpose is to make the public understand the disclosed content of the present invention more thoroughly and comprehensively, and it does not limit the scope of protection of the present invention.

[0087] The above embodiments are not exhaustive enumerations of the present invention, and there may be multiple other implementations not listed. Any replacement and improvement made without violating the concept of the present invention shall fall within the protection scope of the present invention.

Claims

1. A method for automatically updating table file data, characterized in that: include: Generate an original file backup table according to the original first table file; Traverse each row in the second table file to be merged as the current row, and compare the current row data in the second table file with the corresponding row data in the first table file and the original file backup table; If the current row of data in the second table file is the same as the corresponding row of data in the original file backup table, then the next row of data is compared; If the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is the same as the corresponding row data in the first table file, update the current row data in the second table file to the corresponding row in the first table file, and mark the corresponding row data in the first table file with the first background color.

2. The method for automatically updating table file data according to claim 1, characterized in that: The method further comprises: If the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is different from the corresponding row data in the first table file, the current row data in the second table file is updated to the corresponding row in the first table file, and the corresponding row data in the first table file is marked with a second background color, wherein the first background color and the second background color are different.

3. The method for automatically updating table file data according to claim 1, characterized in that: After marking the corresponding row data in the first table file with the first background color, the method further includes: Determine whether each map data structure in the preset file set has a key value that is the number of rows that need to be updated; If it exists, add the file name of the second table file to the key value corresponding to the key value; If it does not exist, insert a new map data structure into the preset file collection, the key value in the new map data structure is the number of rows, and the corresponding key value is the file name of the second table file.

4. The method for automatically updating table file data according to claim 2, characterized in that: After marking the corresponding row data in the first table file with the second background color, the method further includes: Determine whether each map data structure in the preset file set has a key value that is the number of rows that need to be updated; If it exists, add the file name of the second table file to the key value corresponding to the key value; If it does not exist, insert a new map data structure into the preset file collection, the key value in the new map data structure is the number of rows, and the corresponding key value is the file name of the second table file.

5. The method for automatically updating table file data according to claim 3 or 4, characterized in that: The method further comprises: After the comparison is completed, the first table file and the original file backup table are saved, and the map data structure of the preset file set is written into the merged update record text.

6. A device for automatically updating table file data, characterized in that: include: A generating unit, used for generating an original file backup table according to the original first table file; A comparison unit, used for traversing each row in the second table file to be merged as the current row, and comparing the current row data in the second table file with the corresponding row data in the first table file and the original file backup table; If the current row of data in the second table file is the same as the corresponding row of data in the original file backup table, then the next row of data is compared; The first merging unit is used to update the current row data in the second table file to the corresponding row in the first table file, and mark the corresponding row data in the first table file with a first background color when it is found that the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is the same as the corresponding row data in the first table file.

7. The automatic updating device for table file data according to claim 6, characterized in that: Also includes: The second merging unit is used to update the current row data in the second table file to the corresponding row in the first table file, and mark the corresponding row data in the first table file with a second background color when it is found that the current row data in the second table file is different from the corresponding row data in the original file backup table, and the corresponding row data in the original file backup table is different from the corresponding row data in the first table file. The first background color and the second background color are different.

8. The automatic updating device for table file data according to claim 6, characterized in that: Also includes: A first judging unit is used to judge whether there is a key value of each map data structure in the preset file set with a row number that needs to be updated after the first merging unit marks the corresponding row data in the first table file with a first background color; A first updating unit, configured to add the file name of the second table file to the key value corresponding to the key value when the first determining unit determines that the file exists; The first insertion unit is used to insert a new map data structure into the preset file set when the first judgment unit determines that it does not exist, the key value in the new map data structure is the number of rows, and the corresponding key value is the file name of the second table file.

9. An electronic device, characterized in that: It comprises a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the table file data automatic update method according to any one of claims 1 to 5.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute the method for automatically updating table file data according to any one of claims 1 to 5.