A fixed value single contrast method, device, equipment and medium

By converting the fixed value sheet into an array format and using a hash join algorithm for comparison, the problem of low efficiency in comparing fixed value sheets of different models and versions is solved, and fast and accurate fixed value sheet comparison is achieved.

CN116663524BActive Publication Date: 2026-07-21STATE GRID BEIJING ELECTRIC POWER CO +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
STATE GRID BEIJING ELECTRIC POWER CO
Filing Date
2023-06-25
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

The existing methods for comparing relay protection setting sheets are inefficient, especially for setting sheets of different models and versions, which lack universality, resulting in a large workload and long time consumption for manual comparison.

Method used

The sheetJs component is used to parse the fixed value sheet into an array format. Data processing and comparison are performed using a hash join algorithm. A comparison strategy is selected, and comparison results are generated.

Benefits of technology

It enables quick and accurate comparison of setting sheets of different models and version numbers, improves comparison efficiency, and provides convenience for various usage scenarios and accuracy of comparison results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116663524B_ABST
    Figure CN116663524B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of data comparison, and specifically discloses a fixed-value single comparison method, device, equipment and medium. The method comprises the following steps: obtaining a first fixed-value single and a second fixed-value single to be compared, performing data processing on the first fixed-value single and the second fixed-value single to obtain array formats of SHEET1 and SHEET2; selecting a comparison strategy according to the SHEET1 and the SHEET2; comparing specified data selected from the SHEET1 and the SHEET2 according to the comparison strategy, and outputting a comparison result. The application can quickly and accurately select data to be compared by converting two fixed-value singles into array formats and then selecting different comparison strategies for comparison, and can be used for fixed-value comparison of different models and different version numbers, and can greatly improve comparison efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data comparison technology, and specifically relates to a method, apparatus, equipment and medium for comparing fixed values. Background Technology

[0002] Currently, existing relay protection setting sheets require input of settings from existing sheets when new ones are issued. The only current methods for comparing these settings are either comparing each item in the two sheets individually or exporting the results from an Excel spreadsheet for comparison. The former is labor-intensive and time-consuming for setting sheets with many settings, while the latter is only applicable to comparing settings of protection devices of the same model, version number, and checksum, lacking universality. As the workload of setting calculations gradually increases, the development of this program has significant economic and social implications. Summary of the Invention

[0003] The purpose of this invention is to provide a method, apparatus, equipment, and medium for comparing fixed value sheets, so as to solve the technical problems of low efficiency and difficulty in processing existing fixed value sheets through manual comparison.

[0004] To achieve the above objectives, the present invention employs the following technical solution:

[0005] In a first aspect, the present invention provides a method for comparing fixed values, comprising the following steps:

[0006] Obtain the first and second fixed value sheets to be compared, and perform data processing on the first and second fixed value sheets to obtain SHEET1 and SHEET2 in array format;

[0007] Choose a comparison strategy based on SHEET1 and SHEET2;

[0008] The comparison is performed on selected data from SHEET1 and SHEET2 according to the comparison strategy, and the comparison results are output.

[0009] A further improvement of the present invention is that the step of obtaining the first and second setpoint sheets to be compared, and performing data processing on the first and second setpoint sheets to obtain array-formatted SHEET1 and SHEET2 includes:

[0010] Obtain the first and second value sheets;

[0011] The sheetJs component is used to parse the first and second fixed value sheets into array format SHEET1 and SHEET2.

[0012] A further improvement of the present invention is that: SHEET1 and SHEET2 include information on storing table headers, sub-table arrays, table names, and content arrays.

[0013] A further improvement of the present invention is that the step of comparing the selected data from SHEET1 and SHEET2 according to the comparison strategy and outputting the comparison result includes:

[0014] Extract sub-tables from SHEET1 and SHEET2, and generate table1 and table2 based on the extracted sub-tables;

[0015] Based on the comparison strategy, extract the comparison row data and comparison row headers from table1 and table2, and generate portionTable1 and portionTable2 based on the comparison row data and comparison row headers;

[0016] Convert portionTable2 to a hash map type, and then convert portionTable2 to a hash table.

[0017] The result set is generated by using hash join based on the hash table and the sub-tables in portionTable1;

[0018] Output the result set to complete the comparison.

[0019] A further improvement of the present invention is that the step of extracting sub-tables from SHEET1 and SHEET2 and generating table1 and table2 based on the extracted sub-tables includes:

[0020] Iterate through SHEET1 and SHEET2 line by line, and identify the start and end rows of the sub-tables based on the content of the table headers and constraints.

[0021] Starting from the first row of the sub-table, traverse each row one by one. If a row has 1 element and the element type is string, then the row is identified as the table header.

[0022] If the number of elements is greater than or equal to 2 and the element type is integer, then the line is identified as content.

[0023] If the length of the content row is greater than 0 after the traversal is completed, it means that a sub-table has been generated. The sub-table is appended to the end of the sub-table array. During the traversal of SHEET1 and SHEET2, the sub-table array is stored in table1 and table2.

[0024] After traversing SHEET1 and SHEET2, the fixed table header content tableHeader is stored in table1 and table2, completing the assembly of table1 and table2.

[0025] A further improvement of the present invention is that the step of generating a result set using hashjoin based on the hash table and the sub-tables in portionTable1 includes:

[0026] Iterate through the sub-tables in portionTable1 and use hash join to search for the existence of the same sub-table in a hash map type hash table;

[0027] If identical sub-tables exist, the sub-tables will be traversed, and a hash join will be used to search for identical row headers in the sub-tables of the hash table.

[0028] If there are identical row headers, compare whether the row data is the same. If they are the same, mark the result as identical; otherwise, mark the result as different.

[0029] Store the comparison results of all sub-tables into the result set.

[0030] A further improvement of the present invention is as follows: In the step of comparing the data of the comparison rows if there are the same comparison row headers, and marking the result as the same if they are the same and the result as different if they are different, when comparing the data of the comparison rows, if one table has a value and the other table has no value, the comparison result is marked as the first difference; if both tables have values ​​and the values ​​are not equal, the comparison result is marked as the second difference.

[0031] Secondly, a fixed-value comparison device includes:

[0032] Preprocessing module: used to obtain the first and second fixed value sheets to be compared, and to process the data of the first and second fixed value sheets to obtain SHEET1 and SHEET2 in array format;

[0033] Contrast strategy selection module: used to select a contrast strategy based on SHEET1 and SHEET2;

[0034] The comparison module is used to compare specified data selected from SHEET1 and SHEET2 according to the comparison strategy and output the comparison results.

[0035] Thirdly, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the aforementioned fixed-value comparison method.

[0036] Fourthly, a computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned fixed-value comparison method.

[0037] Compared with the prior art, the present invention has at least the following beneficial effects:

[0038] 1. This invention converts two fixed value sheets into an array format and then selects different comparison strategies for comparison, which can quickly and accurately select the data to be compared. It can be used for fixed value comparison of different models and versions, and can greatly improve the comparison efficiency.

[0039] 2. This invention considers various usage scenarios for comparing fixed values ​​and provides optional comparison columns and the function of whether to display only the different items through comparison strategies, thereby increasing convenience;

[0040] 3. This invention performs traversal filtering by comparing row data and row titles, thus ensuring accurate comparison results. Attached Figure Description

[0041] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0042] In the attached diagram:

[0043] Figure 1 This is a flowchart of a fixed value comparison method according to the present invention;

[0044] Figure 2 This is a structural block diagram of a fixed value comparison device according to the present invention;

[0045] Figure 3 This is a diagram of the comparison strategy selection interface in a fixed-value comparison method of the present invention;

[0046] Figure 4 This is a code framework diagram of Embodiment 4 of the fixed value comparison method of the present invention. Detailed Implementation

[0047] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0048] The following detailed description is exemplary and intended to provide further detailed explanation of the invention. Unless otherwise specified, all technical terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this invention is for describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.

[0049] Example 1

[0050] A method for comparing fixed values, such as Figure 1 As shown, it includes the following steps:

[0051] S1. Obtain the first and second fixed value sheets to be compared, and perform data processing on the first and second fixed value sheets to obtain SHEET1 and SHEET2 in array format;

[0052] Specifically, in S1, both the first and second value sheets are Excel files;

[0053] Specifically, S1 includes the following steps:

[0054] S11. Obtain the first and second value sheets;

[0055] S12. Use the sheetJs component to parse the first and second fixed value sheets into array format SHEET1 and SHEET2;

[0056] S12 converts each line of content in the first and second value sheets into a line of data. Each element in each line of data corresponds to a cell in the first and second value sheets, for example, [{__EMPTY:”XX value sheet”},…,{__EMPTY:1,__EMPTY_3:“rated capacity of the high and medium pressure side of the main transformer”…},…];

[0057] Specifically, SHEET1 and SHEET2 include information on storing table headers, sub-table arrays, table names, and content arrays.

[0058] S2. Select a comparison strategy based on SHEET1 and SHEET2;

[0059] Specifically, in S2, SHEET1 and SHEET2 are divided into Table 1 original value, Table 1 current value, Table 2 original value, and Table 2 current value. Each time, two values ​​are selected from these four tables. A suitable comparison strategy is manually chosen, and then different IDs are assigned to the original, current, and original values ​​of Table 1 and Table 2. The IDs are then stored in the `checked_columns` array according to the selected comparison strategy, with each array element representing the selected comparison item ID, in the form of ['0', '1']. If an incorrect comparison strategy is selected, it can be reselected, and the changed ID is stored in the `checked_columns` array. The comparison strategy selection interface is shown below. Figure 3 As shown.

[0060] S3. Based on the comparison strategy, compare the specified data selected from SHEET1 and SHEET2, and output the comparison results;

[0061] S31. Extract sub-tables from SHEET1 and SHEET2, and generate table1 and table2 based on the extracted sub-tables;

[0062] Specifically, S31 includes the following steps:

[0063] S311. Traverse SHEET1 and SHEET2 row by row, and identify the start and end rows of the sub-tables based on the content of the table header and the constraints.

[0064] S312. Starting from the first row of the sub-table, traverse each row one by one. If the number of elements in a row is equal to 1 and the element type is string, then the row is identified as the table header and stored in the tableName variable.

[0065] If the number of elements is greater than or equal to 2 and the element type is integer, then the row is identified as content and stored in the array row.

[0066] S313. If the length of the content row is greater than 0 after the traversal is completed, it means that a sub-table has been generated. The sub-table is appended to the end of the sub-table array subTable. During the traversal of SHEET1 and SHEET2, the sub-table array subTable is stored in table1 and table2.

[0067] S314. After traversing SHEET1 and SHEET2, store the fixed table header content tableHeader into table1 and table2 to complete the assembly of table1 and table2.

[0068] Specifically, the content format of table1 and table2 is: {tableHeader:String,subTables:subtable[]};

[0069] S32. Extract the comparison row data and comparison row titles from table1 and table2 according to the comparison strategy, and generate portionTable1 and portionTable2 based on the comparison row data and comparison row titles;

[0070] Specifically, S32 includes the following steps:

[0071] The currently selected comparison strategy is obtained from the `checked_columns` array. The subtable arrays `subTables` of `table1` and `table2` objects are then traversed to obtain the subtables. Each row in the subtable is further traversed to obtain the value and key of the row to be compared. A compatibility mechanism is implemented here: when the row content remains unchanged, the original fixed value is used as the data for the current row. Next, the value and key are combined and appended to the `newRows` array. After completing the traversal, the table objects `portionTable1` and `portionTable2` with the extracted comparison columns are obtained.

[0072] S33. Convert portionTable2 to a hash map type, and then convert the converted portionTable2 into a hash table.

[0073] Specifically, portionTable2 is converted into a hash map type, denoted as map, and its sub-tables are denoted as subMap, which facilitates the subsequent retrieval of row parameters existing in portionTable1 from portionTable2;

[0074] S34. Traverse the sub-tables in portionTable1 and use hash join to search for the existence of the same sub-table in a hash map type hash table;

[0075] If identical sub-tables exist, the sub-tables will be traversed, and a hash join will be used to search for identical row headers in the sub-tables of the hash table.

[0076] If there are identical row headers, compare whether the row data is the same. If they are the same, mark the result as identical; otherwise, mark the result as different.

[0077] Store the comparison results of all sub-tables into the result set;

[0078] S35. Output the result set to complete the comparison.

[0079] Specifically, use different colors to fill in the image when it is marked as the same and when it is marked as different, so as to facilitate subsequent viewing;

[0080] Specifically, in the step of comparing row headers, if there are identical row headers, the comparison row data is compared. If they are identical, the result is marked as identical; if they are different, the result is marked as different. When comparing row data, if one table has a value and the other table has no value, the comparison result is marked as the first difference; if both tables have values ​​and the values ​​are not equal, the result is marked as the second difference.

[0081] Specifically, the first and second differences are represented by different colors.

[0082] Example 2

[0083] A fixed-value comparison device, such as Figure 2 As shown, it includes:

[0084] Preprocessing module: used to obtain the first and second fixed value sheets to be compared, and to process the data of the first and second fixed value sheets to obtain SHEET1 and SHEET2 in array format;

[0085] Specifically, both the first and second value sheets are Excel files;

[0086] Specifically, the preprocessing module includes:

[0087] Obtain the first and second value sheets;

[0088] The sheetJs component is used to parse the first and second fixed value sheets into array format SHEET1 and SHEET2;

[0089] By converting each line of content in the first and second value sheets into a single line of data, each element in each line of data corresponds to a cell in the first and second value sheets, for example, [{__EMPTY:”XX value sheet”},…,{__EMPTY:1,__EMPTY_3:“rated capacity of the high and medium voltage side of the main transformer”…},…];

[0090] Specifically, SHEET1 and SHEET2 include information on storing table headers, sub-table arrays, table names, and content arrays.

[0091] Contrast strategy selection module: used to select a contrast strategy based on SHEET1 and SHEET2;

[0092] Specifically, in S2, SHEET1 and SHEET2 are divided into Table 1 original value, Table 1 current value, Table 2 original value, and Table 2 current value. Each time, two values ​​are selected from these four tables. A suitable comparison strategy is manually chosen, and then different IDs are assigned to the original, current, and original values ​​of Table 1 and Table 2. The IDs are then stored in the `checked_columns` array according to the selected comparison strategy, with each array element representing the selected comparison item ID, in the form of ['0', '1']. If an incorrect comparison strategy is selected, it can be reselected, and the changed ID is stored in the `checked_columns` array. The comparison strategy selection interface is shown below. Figure 3 As shown.

[0093] The comparison module is used to compare specified data selected from SHEET1 and SHEET2 according to the comparison strategy and output the comparison results.

[0094] Specifically, the comparison module includes: extracting sub-tables from SHEET1 and SHEET2, and generating table1 and table2 based on the extracted sub-tables;

[0095] Specifically, extracting sub-tables from SHEET1 and SHEET2, and generating table1 and table2 based on the extracted sub-tables, includes the following steps:

[0096] Iterate through SHEET1 and SHEET2 line by line, and identify the start and end rows of the sub-tables based on the content of the table headers and constraints.

[0097] Starting from the first row of the sub-table, traverse each row one by one. If a row has 1 element and the element type is string, then the row is identified as the table header and stored in the tableName variable.

[0098] If the number of elements is greater than or equal to 2 and the element type is integer, then the row is identified as content and stored in the array row.

[0099] If the length of the content row is greater than 0 after the traversal is completed, it means that a subtable has been generated. The subtable is appended to the end of the subtable array subTable. During the traversal of SHEET1 and SHEET2, the subtable array subTable is stored in table1 and table2.

[0100] After traversing SHEET1 and SHEET2, store the fixed table header content tableHeader into table1 and table2, thus completing the assembly of table1 and table2.

[0101] Specifically, the content format of table1 and table2 is: {tableHeader:String,subTables:subtable[]};

[0102] Based on the comparison strategy, extract the comparison row data and comparison row headers from table1 and table2, and generate portionTable1 and portionTable2 based on the comparison row data and comparison row headers;

[0103] Specifically, the comparison row data and comparison row headers are extracted from table1 and table2 according to the comparison strategy, and portionTable1 and portionTable2 are generated based on the comparison row data and comparison row headers, including the following steps:

[0104] The currently selected comparison strategy is obtained from the `checked_columns` array. The subtable arrays `subTables` of `table1` and `table2` objects are then traversed to obtain the subtables. Each row in the subtable is further traversed to obtain the value and key of the row to be compared. A compatibility mechanism is implemented here: when the row content remains unchanged, the original fixed value is used as the data for the current row. Next, the value and key are combined and appended to the `newRows` array. After completing the traversal, the table objects `portionTable1` and `portionTable2` with the extracted comparison columns are obtained.

[0105] Convert portionTable2 to a hash map type, and then convert portionTable2 to a hash table.

[0106] Specifically, portionTable2 is converted into a hash map type, denoted as map, and its sub-tables are denoted as subMap, which facilitates the subsequent retrieval of row parameters existing in portionTable1 from portionTable2;

[0107] Iterate through the sub-tables in portionTable1 and use hash join to search for the existence of the same sub-table in a hash map type hash table;

[0108] If identical sub-tables exist, the sub-tables will be traversed, and a hash join will be used to search for identical row headers in the sub-tables of the hash table.

[0109] If there are identical row headers, compare whether the row data is the same. If they are the same, mark the result as identical; otherwise, mark the result as different.

[0110] Store the comparison results of all sub-tables into the result set;

[0111] Output the result set to complete the comparison.

[0112] Specifically, use different colors to fill in the image when it is marked as the same and when it is marked as different, so as to facilitate subsequent viewing;

[0113] Specifically, in the step of comparing row headers, if there are identical row headers, the comparison row data is compared. If they are identical, the result is marked as identical; if they are different, the result is marked as different. When comparing row data, if one table has a value and the other table has no value, the comparison result is marked as the first difference; if both tables have values ​​and the values ​​are not equal, the result is marked as the second difference.

[0114] Specifically, the first and second differences are represented by different colors.

[0115] Example 3

[0116] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements a fixed-value comparison method, including the following steps:

[0117] Obtain the first and second fixed value sheets to be compared, and perform data processing on the first and second fixed value sheets to obtain SHEET1 and SHEET2 in array format;

[0118] Choose a comparison strategy based on SHEET1 and SHEET2;

[0119] The comparison is performed on selected data from SHEET1 and SHEET2 according to the comparison strategy, and the comparison results are output.

[0120] Example 4

[0121] A computer-readable storage medium storing a computer program that, when executed by a processor, implements a fixed-value comparison method of Embodiment 1.

[0122] Example 5

[0123] A method for comparing fixed-value sheets, implemented via a WeChat mini-program, with the WeChat mini-program's code framework as follows: Figure 4 As shown, it includes the following steps:

[0124] A1. Upload and parse the contents of the fixed value sheet. Upload the new and old fixed value sheet Excel files. The program parses the Excel information and obtains the basic dataset sheet1 and sheet2 objects of the fixed value sheet used for subsequent comparison.

[0125] A11: Importing Fixed Value Sheets. This function guides users to import fixed value sheets and handles boundary conditions. When a user logs into the mini-program on a PC, a message will be displayed indicating that the PC version is not supported. If the user cancels the upload or the upload fails, the reason for the failure will be displayed. A message will indicate successful import upon completion.

[0126] A12: Parsing the value sheet content. This relies on the SheetJs component to parse the imported Excel file into an array format, such as [{__EMPTY:”XX Value Sheet”},…,{__EMPTY:1,__EMPTY_3:“Rated Capacity of High and Medium Voltage Side of Main Transformer”…},…]. Each row of data corresponds to a row of content in the Excel file, and each element in the row corresponds to a cell in the table. This completes the acquisition and assembly of the two table objects, SHEET1 and SHEET2.

[0127] A2: Strategy selection. The front-end page displays four selection boxes: "Original value of Table 1", "Current value of Table 1", "Original value of Table 2" and "Current value of Table 2". Selecting different combinations will determine the program to choose different comparison strategies.

[0128] Strategy selection mainly consists of the following two sub-steps:

[0129] A21: Assign different IDs to “Table 1 Original Value”, “Table 1 Current Value”, “Table 2 Original Value”, and “Table 2 Current Value”. Bind the IDs of the four enumerated values ​​to the selection box. At the same time, bind the selection box to the change method. When the selected content changes, the backend data is triggered to change, and the latest selection result is stored in the checked_column s array. Each array element represents the ID of the selected comparison item, in the form of ['0', '1'].

[0130] A22: Boundary case check: When the user selects a comparison item that is not equal to 2, prompt "Please select two comparison columns"; when the user has not uploaded the original value sheet or the current value sheet, prompt the user to upload the file.

[0131] A3: Fixed Value Comparison. Based on the original and current fixed value sheets input in step 1, and combined with the comparison strategy selected in step 2, click "Compare" to execute the comparison program, calculate and assemble the comparison results, and display them on the program interface. This step is the core logic of the entire program, involving multiple data traversals and comparisons. For ease of use, different colors are used to indicate data rows with comparison anomalies.

[0132] A31: Data Extraction and Formatting. Iterate through SHEET1 and SHEET2 generated in step 1, row by row. Based on the header content and whether the row contains 5 elements, identify the start row of the sub-table. Similarly, identify the end row of the sub-table. Then, iterate from the start row of the sub-table. If a row has 1 element and the element type is string, it is identified as the header; if a row has 2 or more elements and the element type is integer, it is identified as content. Store the content in the array `row` and the header in the variable `tableName`. After iteration, if the length of a content row is greater than 0, it means a sub-table has been generated. Append the sub-table to the end of the sub-table array `subTable`. Throughout the traversal of the table data SHEET1 and SHEET2, the content of the subTables read is continuously stored into the final table objects table1 and table. After the traversal is completed, the fixed table header content tableHeader is stored in table1 and table2. At this point, the completed table objects table1 and table2 are assembled, with the content format {tableHeader:String,subTables:subtable[]}.

[0133] A32: Extract the comparison columns. Retrieve the currently selected comparison strategy from the `checked_columns` array. Iterate through the subTables array of `table1` and `table2` objects to obtain the subTables. Further iterate through each row of data in the subTables to obtain the data value and row title key of the row to be compared. Here, a compatibility mechanism is implemented: when the row content is 'unchanged', the original fixed value is used as the data for the current row. Next, the value and key are combined and appended to the array `newRows`. After completing the traversal, the table objects `portionTable1` and `portionTable2` with the extracted comparison columns are obtained.

[0134] A33: HashMap conversion, converting portionTable2 into a hash map type, denoted as map, with its sub-tables denoted as subMap, to facilitate subsequent retrieval of row parameters existing in portionTable1 from portionTable2.

[0135] A34: Traverse and retrieve data. Traverse the subtables in portionTable1, using hash join to check if they exist in the map generated in step 33. If they exist, traverse each row of the subtable, using hash join to check if the same key exists in the subMap. If it exists, compare the row content. If they are the same, mark the comparison result as identical. If a value exists in one table but not in the other, mark the comparison result as different (yellow). If both tables have values, and the values ​​are not equal, mark the comparison result as different (red). Traverse the two-dimensional array using the above logic to obtain the comparison result of each subtable and store it in the result set table3.

[0136] A35: Handling sub-tables where portionTable1 does not exist but portionTable2 does. This indicates that the old value sheet has fewer sub-tables than the new value sheet. Simply mark each row of the sub-table as different by using yellow.

[0137] A36: Data display. The comparison results table3 are displayed in the column comparison module of the program interface according to fixed rules. The table will also be displayed in different colors according to the different data parameters, so that users can intuitively perceive the comparison results.

[0138] As is known from common technical knowledge, this invention can be implemented through other embodiments that do not depart from its spirit or essential characteristics. Therefore, the disclosed embodiments described above are merely illustrative in all respects and are not the only ones. All modifications within the scope of this invention or its equivalents are included in this invention.

[0139] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0140] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0141] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0142] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0143] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for comparing fixed values, characterized in that, Includes the following steps: Obtain the first and second fixed value sheets to be compared, and perform data processing on the first and second fixed value sheets to obtain SHEET1 and SHEET2 in array format; Choose a comparison strategy based on SHEET1 and SHEET2; Based on the comparison strategy, the specified data selected from SHEET1 and SHEET2 are compared, and the comparison results are output. The step of comparing specified data selected from SHEET1 and SHEET2 according to the comparison strategy and outputting the comparison results includes: Extract sub-tables from SHEET1 and SHEET2, and generate table1 and table2 based on the extracted sub-tables; Based on the comparison strategy, extract the comparison row data and comparison row headers from table1 and table2, and generate portionTable1 and portionTable2 based on the comparison row data and comparison row headers; Convert portionTable2 to a hash map type, and then convert portionTable2 to a hash table. The result set is generated by using hash join based on the hash table and the sub-tables in portionTable1; Output the result set to complete the comparison.

2. The method for comparing fixed values ​​according to claim 1, characterized in that, The step of obtaining the first and second fixed-value sheets to be compared, and processing the first and second fixed-value sheets to obtain array-formatted SHEET1 and SHEET2 includes: Obtain the first and second value sheets; The sheetJs component is used to parse the first and second fixed value sheets into array format SHEET1 and SHEET2.

3. The method for comparing fixed values ​​according to claim 1, characterized in that, SHEET1 and SHEET2 include information on storing table headers, sub-table arrays, table names, and content arrays.

4. The method for comparing fixed values ​​according to claim 1, characterized in that, The step of extracting sub-tables from SHEET1 and SHEET2 and generating table1 and table2 based on the extracted sub-tables includes: Iterate through SHEET1 and SHEET2 line by line, and identify the start and end rows of the sub-tables based on the content of the table headers and constraints. Starting from the first row of the sub-table, traverse each row one by one. If a row has 1 element and the element type is string, then the row is identified as the table header. If the number of elements is greater than or equal to 2 and the element type is integer, then the line is identified as content. If the length of the content row is greater than 0 after the traversal is completed, it means that a sub-table has been generated. The sub-table is appended to the end of the sub-table array. During the traversal of SHEET1 and SHEET2, the sub-table array is stored in table1 and table2. After traversing SHEET1 and SHEET2, the fixed table header content tableHeader is stored in table1 and table2, completing the assembly of table1 and table2.

5. The method for comparing fixed values ​​according to claim 1, characterized in that, The step of generating a result set using hash join based on the hash table and the sub-tables in portionTable1 includes: Iterate through the sub-tables in portionTable1 and use hash join to search for the existence of the same sub-table in a hash map type hash table; If identical sub-tables exist, the sub-tables will be traversed, and a hash join will be used to search for identical row headers in the sub-tables of the hash table. If there are identical row headers, compare whether the row data is the same. If they are the same, mark the result as identical; otherwise, mark the result as different. Store the comparison results of all sub-tables into the result set.

6. The method for comparing fixed values ​​according to claim 5, characterized in that, In the step of comparing the data of the same comparison row if there are identical comparison row headers, and marking the result as identical if they are identical and as different if they are different, when comparing the data of the same comparison row, if one table has a value and the other table has no value, the comparison result is marked as the first difference; if both tables have values ​​and the values ​​are not equal, the comparison result is marked as the second difference.

7. A fixed-value comparison device, characterized in that, include: Preprocessing module: used to obtain the first and second fixed value sheets to be compared, and to process the data of the first and second fixed value sheets to obtain SHEET1 and SHEET2 in array format; Contrast strategy selection module: used to select a contrast strategy based on SHEET1 and SHEET2; The comparison module is used to compare specified data selected from SHEET1 and SHEET2 according to the comparison strategy and output the comparison results. The step of comparing specified data selected from SHEET1 and SHEET2 according to the comparison strategy and outputting the comparison results includes: Extract sub-tables from SHEET1 and SHEET2, and generate table1 and table2 based on the extracted sub-tables; Based on the comparison strategy, extract the comparison row data and comparison row headers from table1 and table2, and generate portionTable1 and portionTable2 based on the comparison row data and comparison row headers; Convert portionTable2 to a hash map type, and then convert portionTable2 to a hash table. The result set is generated by using hash join based on the hash table and the sub-tables in portionTable1; Output the result set to complete the comparison.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes a computer program, it implements a fixed value comparison method according to any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that, When a computer program is executed by a processor, it implements a fixed value comparison method according to any one of claims 1 to 6.