Data difference comparison method, device, medium and product

By automatically identifying and storing identical data through iterative comparison, the problem of manually sorting data for comparison in Excel files is solved, achieving efficient data difference location and comparison.

CN113051882BActive Publication Date: 2025-01-14INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110445589.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-23
Publication Date
2025-01-14
Estimated Expiration
2041-04-23

AI Technical Summary

Technical Problem

Existing technologies require manual sorting when comparing data differences in Excel files, which is complex, time-consuming, and labor-intensive. In particular, when the data is sorted in different ways, it is easy to mark the same data as different.

Method used

This paper provides a data difference comparison method that automatically identifies and stores identical data by iterating through the comparison, deletes data in the second data list, and centrally stores the remaining data, thus achieving data difference comparison without the need for manual sorting beforehand.

Benefits of technology

It improves data processing and comparison efficiency, quickly locates differences in file data, simplifies the operation process, and reduces manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113051882B_ABST
    Figure CN113051882B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data difference comparison method, which belongs to the field of big data technology. The data difference comparison method is used to compare the data in the first data list and the second data list, and includes the following steps: sequentially read the data in the second data list as the data to be compared; traverse and compare each data to be compared read in sequence with the data in the first data list; when it is determined that there is data in the first data list that is identical to the data to be compared, store the data to be compared in a position corresponding to the position of the identical data in the first data list, and delete the data to be compared in the second data list; after all the data in the second data list are traversed and compared with the data in the first data list, centrally store the remaining data in the second data list. The method can realize data difference comparison without manual sorting in advance, which improves the efficiency of data processing and comparison.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, in particular to the field of big data technology, and more specifically to a data difference comparison method, device, medium and product. Background Art

[0002] In the daily use of OFFICE, Excel is often used to process data, and it is often necessary to compare the differences between the contents of two Excel files. If the data in the two Excel files are arranged in descending or ascending order, you only need to copy and paste the data in the two Excel files into the left and right windows of the relevant software for data difference comparison, and the difference parts of the data in the two Excel files will be highlighted. The sorting results are as follows: Figure 1 shown.

[0003] However, in many scenarios, there is no absolute uniform requirement for the order of data generation in Excel files. If the data in two Excel files are sorted differently, you can generally sort the data in the Excel files in descending or ascending order first, and then compare the data in the two Excel files, which can also show the differences between the data in the two Excel files.

[0004] by Figure 2 and Figure 3 The data sorting process in is used as an example to illustrate the above process:

[0005] like Figure 2 As shown in the figure, the left window is the data in Sheet A, and the right window is the data in Sheet B. Some of the same data in the two are in different order. If you directly copy and paste them into the left and right windows of the data difference comparison software for comparison, some of the same data will be directly highlighted as differences because the same data cannot be automatically arranged in the same row, such as Figure 2 The "Water Margin" in the data exists in both sheets, but the order in the two sheets is different. This results in "Water Margin" being marked as difference data after comparison using relevant data difference comparison software.

[0006] like Figure 3 As shown, if the operator manually sorts the data in the above two sheets, and then pastes the sorted data into the left and right windows of the relevant software for data difference comparison to compare the data differences, the same data in the left and right windows will no longer be highlighted, and only the data difference part will be highlighted.

[0007] For the above situation where the same data is marked as different, there is another solution, such as Figure 4As shown, the two file paths are input into the specified location of the relevant software for data difference comparison. At this time, the left and right windows will automatically sort the data. Due to the automatic sorting, only the different parts of the data will be displayed after the difference comparison.

[0008] The above two methods for solving the problem of marking the same data to be compared as differences not only require the operator to have certain computer knowledge, but also the ascending or descending operation will disrupt the original position of the rows where the original data in the left and right windows are located. Moreover, if the amount of data is too large, it will cause certain difficulties in marking the relevant difference information based on the original data in the Excel table, which is also time-consuming and laborious. Summary of the invention

[0009] In view of the above-mentioned defects in the prior art, the present disclosure provides a data difference comparison method, device, medium and product, which can realize data difference comparison without manual sorting in advance, so as to solve the problems that the existing data comparison method is difficult to operate, time-consuming and labor-intensive.

[0010] According to a first aspect of the present disclosure, a data difference comparison method is provided for performing a difference comparison on data in a first data list and a second data list, the data difference comparison method comprising the following steps:

[0011] Read the data in the second data list in sequence as data to be compared;

[0012] Performing a traversal comparison on each of the to-be-compared data read in sequence with the data in the first data list;

[0013] When it is determined that the first data list contains data identical to the data to be compared, the data to be compared is stored in a position corresponding to the position of the identical data in the first data list, and the data to be compared in the second data list is deleted;

[0014] After all the data in the second data list are traversed and compared with the data in the first data list, the remaining data in the second data list are centrally stored.

[0015] According to an embodiment of the present disclosure, before sequentially reading the data in the second data list as the data to be compared, the data difference comparison method further includes: receiving the first data list and the second data list, the first data list and the second data list containing one or more data.

[0016] According to an embodiment of the present disclosure, the data in the first data list and the second data list are arranged in rows or columns.

[0017] According to an embodiment of the present disclosure, sequentially reading the data in the second data list as the data to be compared specifically includes: sequentially reading the data in the second data list as the data to be compared according to the arrangement of the data in the second data list.

[0018] According to an embodiment of the present disclosure, the second data list includes a row of data or a column of data, and the sequentially reading of the data in the second data list as the data to be compared specifically includes: reading the data in sequence starting from the first row or the first column of the row of data or the column of data in accordance with the arrangement of rows or columns as the data to be compared.

[0019] According to an embodiment of the present disclosure, the traversal comparison of each of the data to be compared read in sequence with the data in the first data list specifically includes: traversal comparison of each of the data to be compared read in sequence with the data in the first data list according to the arrangement of the data in the first data list.

[0020] According to an embodiment of the present disclosure, the first data list includes a row of data or a column of data, and the traversal comparison of each of the data to be compared that is read in sequence with the data in the first data list specifically includes: starting from the first row or the first column of the first data list, the traversal comparison of each of the data to be compared that is read in sequence with the data in the first data list is performed in the order of rows or columns.

[0021] According to an embodiment of the present disclosure, the data difference comparison method further includes: when it is determined that there is no data identical to the data to be compared in the first data list, continuing to execute the step of sequentially reading the data in the second data list.

[0022] According to an embodiment of the present disclosure, the step of sequentially reading the data in the second data list as the data to be compared specifically includes: identifying the number of data in the second data list, recorded as the maximum number of data in the second data list N, where N≥1; setting a data reading sequence number n, and setting an initial value of n to 1; judging whether the data reading sequence number n is less than or equal to N, and when judging that the data reading sequence number n is less than or equal to N, reading the nth data in the second data list as the data to be compared, and executing the step of traversing and comparing the data to be compared with the data in the first data list; and when judging that the data reading sequence number n is greater than N, executing the step of centrally storing the remaining data in the second data list.

[0023] According to an embodiment of the present disclosure, when determining that there is data identical to the data to be compared in the first data list, storing the data to be compared in a position corresponding to the position of the identical data in the first data list, and deleting the data to be compared in the second data list specifically includes:

[0024] Determine whether there is data in the first data list that is identical to the data to be compared;

[0025] When it is determined that the first data list contains data identical to the data to be compared, the data to be compared is stored in a position corresponding to the position of the identical data in the first data list, the data to be compared in the second data list is deleted, and the following steps are performed; when it is determined that the first data list does not contain data identical to the data to be compared, the following steps are continued;

[0026] The data reading sequence number n is increased by 1, and the step of determining whether the data reading sequence number n is less than or equal to N is continued.

[0027] According to an embodiment of the present disclosure, before traversing and comparing each of the data to be compared read in sequence with the data in the first data list, the method further includes: reserving a third data list with the same data arrangement as the first data list, and the third data list is empty in an initial state.

[0028] According to an embodiment of the present disclosure, storing the data to be compared in a position corresponding to the position of the same data in the first data list specifically includes: storing the data to be compared in a corresponding position in the third data list corresponding to the position of the same data in the first data list.

[0029] According to an embodiment of the present disclosure, the first data list includes a row of data or a column of data, and the third data list includes blank rows with the same number of rows or blank columns with the same number of columns as the first data list; storing the data to be compared in a corresponding position in the third data list corresponding to the position of the same data in the first data list specifically includes: storing the data to be compared in the same row or column as the same data in the first data list.

[0030] According to an embodiment of the present disclosure, the centrally storing the remaining data in the second data list specifically includes: storing the remaining data in the second data list after the third data list.

[0031] According to an embodiment of the present disclosure, the data difference comparison method further includes: marking the remaining data in the second data list after the first data list.

[0032] According to an embodiment of the present disclosure, the data difference comparison method further includes: marking the data in the position in the first data list corresponding to the position in the third data list where the data is empty after the third data list.

[0033] According to an embodiment of the present disclosure, the first data list and the third data list include row data or column data, and marking the data in the positions in the first data list corresponding to the positions in the third data list where the data is empty after the third data list specifically includes: marking the data in the rows or columns in the first data list corresponding to the rows or columns in the third data list where the data is empty after the third data list.

[0034] A second aspect of the present disclosure provides a data difference comparison device for performing a difference comparison between data in a first data list and a second data list, the data difference comparison device comprising:

[0035] A reading module, used for sequentially reading the data in the second data list as data to be compared;

[0036] A comparison module, used for traversing and comparing each of the to-be-compared data read in sequence with the data in the first data list;

[0037] an execution module, configured to, when determining that data identical to the data to be compared exists in the first data list, store the data to be compared in a position corresponding to the position of the identical data in the first data list, and delete the data to be compared in the second data list; and

[0038] The storage module is used to centrally store the remaining data in the second data list after all the data in the second data list are traversed and compared with the data in the first data list.

[0039] A third aspect of the present disclosure provides an electronic device, including:

[0040] one or more processors;

[0041] a storage device for storing one or more programs,

[0042] When the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned data difference comparison method.

[0043] A fourth aspect of the present disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned data difference comparison method.

[0044] A fifth aspect of the present disclosure provides a computer program product, including a computer program, and when the computer program is executed by a processor, the computer program implements the above-mentioned data difference comparison method.

[0045] Compared with the prior art, the data difference comparison method provided by the present disclosure can realize data difference comparison without manual sorting in advance, and quickly locates the difference parts of two file data by traversal comparison, thereby improving the efficiency of data processing and comparison. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0047] Figure 1 A schematic diagram of the difference comparison results of data arranged in a fixed manner in the prior art is shown schematically;

[0048] Figure 2 A schematic diagram of the difference comparison results of data arranged in different ways in the prior art is shown schematically;

[0049] Figure 3 The schematic diagram shows the difference comparison result of the data manually arranged in the prior art;

[0050] Figure 4 A schematic diagram of the difference comparison result of data automatically arranged in the prior art is shown schematically;

[0051] Figure 5 A flowchart of a data difference comparison method according to an embodiment of the present disclosure is schematically shown;

[0052] Figure 6 A flowchart schematically illustrates a detailed method for comparing data differences according to an embodiment of the present disclosure;

[0053] Figure 7 A schematic diagram schematically shows a reserved third data list according to an embodiment of the present disclosure;

[0054] Figure 8 A schematic diagram schematically shows a schematic diagram of storing data in a third data list after traversal comparison according to an embodiment of the present disclosure;

[0055] Fig. 9 A schematic diagram schematically shows a schematic diagram of storing the remaining data after traversal comparison according to an embodiment of the present disclosure;

[0056] Fig.10 A schematic diagram schematically shows a comparison of two data tables by exchanging their positions according to an embodiment of the present disclosure;

[0057] Fig.11 A structural block diagram of a data difference comparison device according to an embodiment of the present disclosure is schematically shown;

[0058] Fig.12 A block diagram of an electronic device suitable for implementing a data difference comparison method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0059] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0060] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0061] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0062] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0063] The embodiments of the present disclosure provide a data difference comparison method, device, medium and product. The data difference comparison method is used to compare the data in the first data list and the second data list, and the method includes the following steps: sequentially read the data in the second data list as the data to be compared; traverse and compare each of the data to be compared read in sequence with the data in the first data list; when it is determined that there is data in the first data list that is identical to the data to be compared, store the data to be compared in a position corresponding to the position of the identical data in the first data list, and delete the data to be compared in the second data list; after traversing and comparing all the data in the second data list with the data in the first data list, centrally store the remaining data in the second data list.

[0064] Compared with the prior art, the data difference comparison method provided by the present disclosure can realize data difference comparison without manual sorting in advance, and quickly locates the difference parts of two file data by traversal comparison, thereby improving data processing and comparison efficiency.

[0065] The following will be passed Figure 5-Figure 12 A data difference comparison method, device, medium and product according to an embodiment of the present disclosure are described in detail.

[0066] Figure 5 and Figure 6 A flowchart of a data difference comparison method according to an embodiment of the present disclosure is schematically shown, wherein Figure 6 The flowchart in Figure 5 The embodiments provided by the present disclosure are described with the aid of two flowcharts.

[0067] like Figure 5 and Figure 6 As shown, this embodiment provides a data difference comparison method, which is used to compare the differences between the data in the first data list and the data in the second data list. The method includes operations S101 to S105, which are specifically as follows.

[0068] In operation S101 , a first data list and a second data list are received, wherein the first data list and the second data list include one or more data.

[0069] The data in the first data list and the second data list are arranged in rows or columns.

[0070] More specifically, the first data list and the second data list may be Excel data tables.

[0071] See also Figure 6As shown in operation S1011, the operation S101 further includes: reserving a third data list with the same data arrangement as the first data list, and the third data list is empty in an initial state. Of course, the step of reserving the third data list with the same data arrangement as the first data list can be completed as long as it is performed before the step of performing traversal comparison is performed, and it is not necessarily limited to the operation S101 or S1011.

[0072] More specifically, when the first data list includes a row of data or a column of data, the third data list includes blank rows or columns having the same number of rows or columns as those of the first data list.

[0073] More specifically, when the first data list is an Excel data table, the third data list also has the same number of blank rows or columns as the first data list. In addition, the second data list is also an Excel data table.

[0074] More specifically, when the first data list, the second data list and the third data list are all Excel data tables, receiving the first data list and the second data list, and reserving the third data list with the same data arrangement as the first data list, specifically includes: pasting the data in the first data list in the left window of the Excel data table, reserving the same number of blank rows on the right side of the left window as the third data list, and pasting the data in the second data list in another Excel data table.

[0075] like Figure 7 As shown, taking the first data list, the second data list and the third data list as Excel data tables as an example, the data of the first data list (such as Sheet A) is pasted into the left window, and the right window automatically recognizes and reserves the same number of blank rows as the third data list.

[0076] In operation S102, data in the second data list are read in sequence as data to be compared.

[0077] The sequentially reading the data in the second data list as the data to be compared specifically includes: sequentially reading the data in the second data list as the data to be compared according to the arrangement of the data in the second data list. Of course, the data in the second data list can also be sequentially read as the data to be compared in other ways, as long as all the data in the second data list can be read.

[0078] In order to read all the data in the second data list in sequence and compare them with the data in the first data list, more specifically, Figure 6As shown, sequentially reading the data in the second data list as the data to be compared specifically includes:

[0079] In operation S1021, the number of data in the second data list is identified, recorded as the maximum number N of data in the second data list, where N≥1;

[0080] Specifically, when the second data list is an Excel data table, the maximum number of rows or columns of data in the Excel data table is identified as the N.

[0081] In operation S1022, a data reading sequence number n is set, and an initial value of n is set to 1;

[0082] In operation S1023, it is determined whether the data reading sequence number n is less than or equal to N. When it is determined that the data reading sequence number n is less than or equal to N, operation S1024 is performed; when it is determined that the data reading sequence number n is greater than N, the following operation S105 is performed;

[0083] In operation S1024, the nth data in the second data list is read as the data to be compared, and the following operation S103 is performed.

[0084] More specifically, when the second data list includes a row of data or a column of data, data is read sequentially from the first row or the first column of the row of data or the column of data according to the arrangement of rows or columns. More specifically, when the second data list is an Excel data table, data is read sequentially from the first row or the first column of the Excel data table.

[0085] In operation S103, each of the to-be-compared data read in sequence is traversed and compared with the data in the first data list.

[0086] The traversing and comparing each of the to-be-compared data read in sequence with the data in the first data list specifically includes: traversing and comparing each of the to-be-compared data read in sequence with the data in the first data list according to the arrangement of the data in the first data list.

[0087] When the first data list is a row of data or a column of data, the traversal comparison of each of the data to be compared that is read in sequence with the data in the first data list specifically includes: starting from the first row or the first column of the first data list, the traversal comparison of each of the data to be compared that is read in sequence with the data in the first data list in the order of rows or columns.

[0088] When both the first data list and the second data list are Excel data tables, the nth data in the second data list is compared with the data in the first data list in the order of rows or columns.

[0089] In operation S104, when it is determined that the first data list contains data identical to the data to be compared, the data to be compared is stored in a position corresponding to the position of the identical data in the first data list, and the data to be compared in the second data list is deleted.

[0090] The operation S104 further includes: when it is determined that there is no data identical to the data to be compared in the first data list, continuing to perform the step of sequentially reading the data in the second data list in the operation S102.

[0091] More specifically, the operation 104 includes the following steps.

[0092] In operation S1041 , it is determined whether there is data in the first data list that is the same as the data to be compared.

[0093] Specifically, when both the first data list and the second data list are Excel data tables, it is determined whether there is data in the first data list that is the same as the nth data in the second data list.

[0094] In operation S1042, when it is determined that the data identical to the data to be compared exists in the first data list, the data to be compared is stored in a position corresponding to the position of the identical data in the first data list, the data to be compared in the second data list is deleted, and the following operation S1043 is performed; when it is determined that the data identical to the data to be compared does not exist in the first data list, the following operation S1043 is continued to be performed.

[0095] Specifically, storing the data to be compared in a position corresponding to the position of the identical data in the first data list specifically includes: storing the data to be compared in a corresponding position in the third data list corresponding to the position of the identical data in the first data list.

[0096] More specifically, when the first data list is a row of data or a column of data, the third data list is a blank row with the same number of rows or a blank column with the same number of columns as the first data list. Further, storing the data to be compared in a position corresponding to the position of the same data in the first data list specifically includes: storing the data to be compared in the same row or the same column in the third data list that is the same row or column as the same data in the first data list, specifically, storing the data to be compared in the nth row or the nth column in the third data list.

[0097] More specifically, when the first data list is an Excel data table, the third data list also has the same number of blank rows or columns as the first data list. Further, storing the data to be compared in a position corresponding to the position of the same data in the first data list specifically includes: storing the data to be compared in the same row or column in the third data list, specifically, storing the data to be compared in the nth row or column in the Excel data table of the third data list.

[0098] like Figure 8 As shown, taking the first data list, the second data list and the third data list as Excel data tables as an example, the present disclosure will automatically identify the number of rows in the second data list (e.g. Sheet B). Take the first row of data in Sheet B and compare it with all the data in the left window, i.e. the first data list (i.e. Sheet A). If the left window is found to have the same data, replace the corresponding blank in the right window, i.e. the third data list, with the data, and delete the row of data in Sheet B. Otherwise, directly take the next row of data in Sheet B and compare it again until all the data in Sheet B is traversed.

[0099] More specifically, when the first data list and the second data list are a row or a column of data, deleting the to-be-compared data in the second data list specifically includes: deleting the nth row or the nth column of data in the second data list.

[0100] In operation S1043, the data reading sequence number n is increased by 1, and the step of determining whether the data reading sequence number n is less than or equal to N is continued.

[0101] In operation 105, after all the data in the second data list are traversed and compared with the data in the first data list, the remaining data in the second data list are centrally stored.

[0102] The centrally storing the remaining data in the second data list specifically includes:

[0103] In operation S1051, it is determined whether the second data list still contains remaining data. If it still contains remaining data, operation S1052 is performed. If it does not contain remaining data, the entire data difference comparison process ends.

[0104] In operation S1052, the remaining data is stored, and the entire data difference comparison process ends;

[0105] The centralized storage of the remaining data in the second data list specifically includes: storing the remaining data in the second data list after the third data list. More specifically, when the third data list is row data or column data, storing the remaining data after the row data or column data.

[0106] like Fig. 9 As shown, taking the first data list, the second data list and the third data list as an example, if Sheet B, i.e. the second data list, still has remaining data, the remaining data can be directly placed after the originally reserved blank, i.e. the third data list, as shown in Fig. 9 As shown, place "Strange Stories from a Chinese Studio" after the reserved space.

[0107] The data difference comparison method further includes:

[0108] The remaining data in the second data list is marked after the first data list. Specifically, when the first data list is row data or column data, the remaining data in the second data list is stored after the row data or column data.

[0109] The data difference comparison method further includes:

[0110] The data in the position in the first data list corresponding to the position in the third data list where the data is empty is marked after the third data list. Furthermore, when the first data list and the third data list are row data or column data, the data in the position in the first data list corresponding to the position in the third data list where the data is empty is marked after the third data list, specifically: the data in the row or column in the first data list corresponding to the row or column in the third data list where the data is empty is marked after the third data list.

[0111] like Fig.10As shown, taking the first data list, the second data list and the third data list as Excel data tables, the difference between the first data list in the original Excel, i.e. Sheet A, and the second data list can be marked on the original data according to the need and the final comparison result. Conversely, if it is necessary to mark the original data in the second data list, i.e. Sheet B, the data in Sheet B and Sheet A can be swapped and placed in the left and right windows respectively.

[0112] A data difference comparison method provided by the embodiment of the present disclosure can realize data difference comparison without manual sorting in advance, and quickly locate the difference part of two file data by traversal comparison, thereby improving data processing and comparison efficiency.

[0113] Based on the above Figure 5 , Figure 6 The present disclosure also provides a data difference comparison device. Fig.11 The device is described in detail.

[0114] Fig.11 The structure block diagram of a data difference comparison device according to an embodiment of the present disclosure is schematically shown.

[0115] like Fig.11 As shown, this embodiment provides a data difference comparison device 1100 , and the device 1100 includes a receiving module 1101 , a reading module 1102 , a comparing module 1103 , an executing module 1104 and a storing module 1105 .

[0116] The receiving module 1101 is configured to receive a first data list and a second data list, wherein the first data list and the second data list contain one or more data.

[0117] In one embodiment, the receiving module 1101 may be used to execute the operation S101 described above, which will not be described in detail herein.

[0118] The reading module 1102 is used to sequentially read the data in the second data list as data to be compared.

[0119] In one embodiment, the reading module 1102 may be used to execute the operation S102 described above, which will not be described in detail herein.

[0120] The comparison module 1103 is used to perform traversal comparison between each of the to-be-compared data read in sequence and the data in the first data list.

[0121] In one embodiment, the comparison module 1103 may be used to perform the operation S103 described above, which will not be described in detail herein.

[0122] The execution module 1104 is used to store the data to be compared in a position corresponding to the position of the identical data in the first data list when it is determined that the data to be compared exists in the first data list, and delete the data to be compared in the second data list.

[0123] In one embodiment, the execution module 1104 may be used to execute the operation S104 described above, which will not be described in detail herein.

[0124] The storage module 1105 is used to centrally store the remaining data in the second data list after all the data in the second data list are traversed and compared with the data in the first data list.

[0125] In one embodiment, the storage module 1105 may be used to execute the operation S105 described above, which will not be described in detail herein.

[0126] Based on the above Fig.11 The embodiment of the present disclosure shown provides a data difference comparison device, which can implement data difference comparison without manual sorting in advance, and quickly locate the difference part of two file data by traversal comparison, thereby improving data processing and comparison efficiency.

[0127] Fig.12 A block diagram of an electronic device suitable for implementing a data difference comparison method according to an embodiment of the present disclosure is schematically shown.

[0128] like Fig.12 As shown, the electronic device 1200 according to an embodiment of the present disclosure includes a processor 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage part 1208 into a random access memory (RAM) 1203. The processor 1201 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1201 may also include an onboard memory for caching purposes. The processor 1201 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0129] In RAM 1203, various programs and data required for the operation of electronic device 1200 are stored. Processor 1201, ROM 1202 and RAM 1203 are connected to each other via bus 1204. Processor 1201 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 1202 and / or RAM 1203. It should be noted that the program can also be stored in one or more memories other than ROM 1202 and RAM 1203. Processor 1201 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0130] According to an embodiment of the present disclosure, the electronic device 1200 may further include an input / output (I / O) interface 1205, which is also connected to the bus 1204. The electronic device 1200 may further include one or more of the following components connected to the I / O interface 1205: an input portion 1206 including a keyboard, a mouse, etc.; an output portion 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1208 including a hard disk, etc.; and a communication portion 1209 including a network interface card such as a LAN card, a modem, etc. The communication portion 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed, so that a computer program read therefrom is installed into the storage portion 1208 as needed.

[0131] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0132] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus, or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 1202 and / or RAM 1203 described above and / or one or more memories other than ROM 1202 and RAM 1203.

[0133] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the item recommendation method provided by the embodiment of the present disclosure.

[0134] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 1201. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0135] In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication part 1209, and / or installed from a removable medium 1211. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0136] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1209, and / or installed from the removable medium 1211. When the computer program is executed by the processor 1201, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0137] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0138] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0139] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0140] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A data difference comparison method, used for comparing the difference between data in a first data list and data in a second data list, characterized in that: The data difference comparison method comprises the following steps: Read the data in the second data list in sequence as data to be compared; Compare each of the data to be compared read in sequence with the data in the first data list, Before traversing and comparing each of the to-be-compared data read in sequence with the data in the first data list, the method further comprises: A third data list is reserved with the same data arrangement as the first data list, and the third data list is empty in an initial state; When it is determined that the first data list contains data identical to the data to be compared, the data to be compared is stored in a position corresponding to the position of the identical data in the first data list, and the data to be compared in the second data list is deleted. The step of storing the data to be compared in a position corresponding to the position of the identical data in the first data list specifically includes: storing the data to be compared in a corresponding position in the third data list corresponding to the position of the identical data in the first data list; After all the data in the second data list are compared with the data in the first data list, the remaining data in the second data list are stored centrally. Wherein, the data difference comparison method further includes: Mark the remaining data in the second data list after the first data list, The data in the position in the first data list corresponding to the position in the third data list where the data is empty is marked after the third data list.

2. The data difference comparison method according to claim 1, characterized in that: Before sequentially reading the data in the second data list as the data to be compared, the data difference comparison method further includes: The first data list and the second data list are received, wherein the first data list and the second data list include one or more data.

3. The data difference comparison method according to claim 1 or 2, characterized in that: The data in the first data list and the second data list are arranged in rows or columns.

4. The data difference comparison method according to claim 1, characterized in that: The step of sequentially reading the data in the second data list as the data to be compared specifically includes: The data in the second data list are read in sequence according to the arrangement of the data in the second data list as the data to be compared.

5. The data difference comparison method according to claim 1 or 4, characterized in that: The second data list includes a row of data or a column of data, and sequentially reading the data in the second data list as the data to be compared specifically includes: Data are read in sequence starting from the first row or the first column of the row of data or the column of data according to the arrangement of rows or columns as the data to be compared.

6. The data difference comparison method according to claim 1, characterized in that: The traversing and comparing each of the to-be-compared data read in sequence with the data in the first data list specifically includes: Each of the data to be compared that is read in sequence is traversed and compared with the data in the first data list according to the arrangement of the data in the first data list.

7. The data difference comparison method according to claim 1 or 6, characterized in that: The first data list includes a row of data or a column of data, and the traversal comparison of each of the to-be-compared data read in sequence with the data in the first data list specifically includes: Starting from the first row or the first column of the first data list, each of the to-be-compared data read in sequence is traversed and compared with the data in the first data list in the order of rows or columns.

8. The data difference comparison method according to claim 1, characterized in that: The data difference comparison method further includes: When it is determined that there is no data identical to the data to be compared in the first data list, the step of sequentially reading the data in the second data list is continued.

9. The data difference comparison method according to claim 1, characterized in that: The step of sequentially reading the data in the second data list as the data to be compared specifically includes: Identify the number of data in the second data list, recorded as the maximum number of data in the second data list N, where N≥1; Set the data reading sequence number n, and set the initial value of n to 1; Determine whether the data reading sequence number n is less than or equal to N. When it is determined that the data reading sequence number n is less than or equal to N, read the nth data in the second data list as the data to be compared, and execute the step of traversing and comparing the data to be compared with the data in the first data list; when it is determined that the data reading sequence number n is greater than N, execute the step of centrally storing the remaining data in the second data list.

10. The data difference comparison method according to claim 9, characterized in that: The step of determining that the data to be compared exists in the first data list and the data to be compared exists in the first data list, storing the data to be compared in a position corresponding to the position of the data to be compared in the first data list, and deleting the data to be compared in the second data list specifically includes: Determine whether there is data in the first data list that is identical to the data to be compared; When it is determined that the first data list contains data identical to the data to be compared, the data to be compared is stored in a position corresponding to the position of the identical data in the first data list, the data to be compared in the second data list is deleted, and the following steps are performed; when it is determined that the first data list does not contain data identical to the data to be compared, the following steps are continued; The data reading sequence number n is increased by 1, and the step of determining whether the data reading sequence number n is less than or equal to N is continued.

11. The data difference comparison method according to claim 1, characterized in that: The first data list includes a row of data or a column of data, and the third data list includes blank rows or columns with the same number of rows or columns as the first data list; The storing of the data to be compared at a corresponding position in the third data list corresponding to the position of the identical data in the first data list specifically includes: storing the data to be compared in a row or column in the third data list which is the same as the row or column where the identical data is located in the first data list.

12. The data difference comparison method according to claim 11, characterized in that: The centrally storing the remaining data in the second data list specifically includes: storing the remaining data in the second data list after the third data list.

13. The data difference comparison method according to claim 1, characterized in that: The first data list and the third data list include row data or column data, and marking the data in the position in the first data list corresponding to the position in the third data list where the data is empty after the third data list specifically includes: The data in the row or column in the first data list corresponding to the row or column in the third data list where the data is empty are marked after the third data list.

14. A data difference comparison device, used for comparing the difference between data in a first data list and data in a second data list, characterized in that: The data difference comparison device comprises: A reading module, used for sequentially reading the data in the second data list as data to be compared; A comparison module is used to traverse and compare each of the to-be-compared data read in sequence with the data in the first data list, The receiving module is used for: before traversing and comparing each of the to-be-compared data read in sequence with the data in the first data list: A third data list is reserved with the same data arrangement as the first data list, and the third data list is empty in an initial state; an execution module, configured to store the data to be compared in a position corresponding to the position of the identical data in the first data list when determining that the data to be compared exists in the first data list, and to delete the data to be compared in the second data list, The storing the data to be compared in a position corresponding to the position of the identical data in the first data list specifically includes: storing the data to be compared in a corresponding position in the third data list corresponding to the position of the identical data in the first data list; and A storage module is used to centrally store the remaining data in the second data list after all the data in the second data list are traversed and compared with the data in the first data list. Wherein, the storage module is also used for: Mark the remaining data in the second data list after the first data list, The data in the position in the first data list corresponding to the position in the third data list where the data is empty is marked after the third data list.

15. An electronic device, comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 13.

16. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 13.

17. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.

Citation Information

Patent Citations

  • Method and device for removing duplications of EXCEL form data

    CN102200968A

  • Extreme point extraction method and device and computer readable storage medium

    CN112204605A