Data comparison method and device, computer device, and storage medium
By acquiring the scan results and configuration information of the stored objects, personalized configurations can be made, solving the problem of insufficient flexibility in existing data comparison tools and achieving flexible and accurate data comparison.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA PING AN PROPERTY INSURANCE CO LTD
- Filing Date
- 2023-06-30
- Publication Date
- 2026-05-29
AI Technical Summary
Existing data comparison tools are rather rigid and cannot flexibly meet various comparison needs. They can only perform full comparisons between different databases, lacking flexibility.
Obtain scan results and comparison configuration information for multiple storage objects, including comparison configuration items and rule items, perform personalized configuration through data comparison tools, and generate target comparison results.
It achieves flexibility in the objects and processes of data comparison, enabling personalized configuration according to needs, and improving the flexibility and accuracy of data comparison tools.
Smart Images

Figure CN116719854B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the fields of big data and fintech, and in particular to a data comparison method, apparatus, computer equipment, and storage medium. Background Technology
[0002] Data comparison is a common data processing method, and existing data comparison is usually achieved through database comparison tools, which can compare databases. For example, in the fintech field, a company may have two databases to store data for two different business lines. Some customer data in the databases may come from the same customer. Database comparison tools can be used to compare the two databases to detect differences in the data between them.
[0003] Existing data comparison tools are rather rigid in functionality, only allowing comparisons between different databases and only full comparisons, with limited configuration options. However, real-world comparison needs are diverse, further highlighting the lack of flexibility in existing data comparison tools. Summary of the Invention
[0004] The purpose of this application is to provide a data comparison method, apparatus, computer equipment, and storage medium to solve the problem of low flexibility in data comparison.
[0005] To address the aforementioned technical problems, this application provides a data comparison method, employing the following technical solution:
[0006] Obtain scan results for multiple storage objects, which are obtained based on the scan of multiple storage objects, including databases and their historical backups, or data tables and their historical backups;
[0007] Obtain comparison configuration information for the scan results of the multiple storage objects, the comparison configuration information including comparison configuration items and rule items;
[0008] The scan results of the multiple storage objects are compared according to the comparison configuration items in the comparison configuration information to obtain a preliminary comparison result.
[0009] Based on the rule items in the comparison configuration information and the initial comparison results, a target comparison result is generated.
[0010] To address the aforementioned technical problems, this application also provides a data comparison device, which employs the following technical solution:
[0011] The scanning acquisition module is used to acquire the scanning results of multiple storage objects. The scanning results of multiple storage objects are obtained based on the scanning of multiple storage objects. The multiple storage objects include databases and their historical backups, or data tables and their historical backups.
[0012] The configuration acquisition module is used to acquire comparison configuration information for the scan results of the multiple storage objects, the comparison configuration information including comparison configuration items and rule items;
[0013] The data comparison module is used to compare the scan results of the multiple storage objects according to the comparison configuration items in the comparison configuration information to obtain a preliminary comparison result;
[0014] The result generation module is used to generate a target comparison result based on the rule items in the comparison configuration information and the primary comparison result.
[0015] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:
[0016] Obtain scan results for multiple storage objects, which are obtained based on the scan of multiple storage objects, including databases and their historical backups, or data tables and their historical backups;
[0017] Obtain comparison configuration information for the scan results of the multiple storage objects, the comparison configuration information including comparison configuration items and rule items;
[0018] The scan results of the multiple storage objects are compared according to the comparison configuration items in the comparison configuration information to obtain a preliminary comparison result.
[0019] Based on the rule items in the comparison configuration information and the initial comparison results, a target comparison result is generated.
[0020] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:
[0021] Obtain scan results for multiple storage objects, which are obtained based on the scan of multiple storage objects, including databases and their historical backups, or data tables and their historical backups;
[0022] Obtain comparison configuration information for the scan results of the multiple storage objects, the comparison configuration information including comparison configuration items and rule items;
[0023] The scan results of the multiple storage objects are compared according to the comparison configuration items in the comparison configuration information to obtain a preliminary comparison result.
[0024] Based on the rule items in the comparison configuration information and the initial comparison results, a target comparison result is generated.
[0025] Compared with the prior art, the embodiments of this application have the following main advantages: They obtain multiple storage object scan results, which are obtained by scanning storage objects, such as databases and their historical backups, or data tables and their historical backups, ensuring flexibility in the objects of data comparison; they obtain comparison configuration information for multiple storage object scan results, including comparison configuration items and rule items, enabling personalized configuration of data comparison; they compare the multiple storage object scan results according to the comparison configuration items to obtain preliminary comparison results; the preliminary comparison results reflect the differences between the storage object scan results, and the rule items are used to generate conclusive information based on the preliminary comparison results, thereby generating the final target comparison result; in this application, both the objects of data comparison and the comparison process can be set, improving the flexibility of the data comparison tool for data comparison. Attached Figure Description
[0026] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0028] Figure 2 This is a flowchart of an embodiment of the data comparison method according to this application;
[0029] Figure 3 This is a schematic diagram of the structure of one embodiment of the data comparison device according to this application;
[0030] Figure 4 This is a schematic diagram of the structure of one embodiment of the computer device according to this application. Detailed Implementation
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0032] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0033] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0034] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0035] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0036] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.
[0037] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.
[0038] It should be noted that the data comparison method provided in the embodiments of this application is generally executed by the server, and correspondingly, the data comparison device is generally set in the server.
[0039] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0040] Continue to refer to Figure 2 A flowchart of an embodiment of the data comparison method according to this application is shown. The data comparison method includes the following steps:
[0041] Step S201: Obtain scan results of multiple storage objects. The scan results of multiple storage objects are obtained based on the scan of multiple storage objects, including databases and their historical backups, or data tables and their historical backups.
[0042] In this embodiment, the data comparison method operates on an electronic device (e.g., Figure 1 The server shown can communicate with the terminal device via wired or wireless connection. It should be noted that the aforementioned wireless connection methods may include, but are not limited to, 3G / 4G / 5G connections, WiFi connections, Bluetooth connections, WiMAX connections, Zigbee connections, UWB (ultra wideband) connections, and other currently known or future wireless connection methods.
[0043] In this context, a storage object is an object that stores data. For example, a database can be used as a storage object; a data table can also be used as a storage object; even if a data table is a table within a database, it can still be considered a separate storage object, albeit at a different level than the database. This application can back up databases / data tables to obtain historical backups of the databases / data tables, and these historical backups can also be used as storage objects. During scanning or data comparison, historical backups of databases are treated as objects at the same level as the database itself, and historical backups of data tables are treated as objects at the same level as the data tables.
[0044] Specifically, multiple storage objects can be scanned in advance to obtain the storage object scan results corresponding to each storage object.
[0045] Step S202: Obtain comparison configuration information for the scan results of multiple storage objects. The comparison configuration information includes comparison configuration items and rule items.
[0046] Specifically, the comparison configuration information for scanning results of multiple storage objects is obtained. The comparison configuration information includes comparison configuration items and rule items. By setting the comparison configuration information, the comparison processing can be customized to meet various comparison needs. Among them, the comparison configuration items can specify which parts of the storage object scanning results (such as data tables in the database, or fields in the data tables) are compared; the rule items are used to generate the comparison results.
[0047] Step S203: Compare the scan results of multiple storage objects according to the comparison configuration items in the comparison configuration information to obtain the preliminary comparison results.
[0048] Specifically, this application employs an independently developed data comparison tool that supports scanning of stored objects and allows for personalized configuration of the data comparison process. The data comparison tool compares the scan results of multiple stored objects based on the comparison configuration items in the comparison configuration information to obtain preliminary comparison results.
[0049] Step S204: Generate the target comparison result based on the rule items in the comparison configuration information and the initial comparison result.
[0050] Specifically, data comparison tools need to generate target comparison results based on rule items, which instruct the tool to generate conclusive information. For example, based on the difference threshold in the rule items, the degree of difference in the scan results of multiple stored objects is determined; display information in a specific format is generated based on the rule items, and together with the initial comparison results, the final target comparison result is generated.
[0051] In this embodiment, multiple storage object scan results are obtained. These results are obtained by scanning storage objects, which can be databases and their historical backups, or data tables and their historical backups, ensuring flexibility in the objects to be compared. Comparison configuration information for the multiple storage object scan results is also obtained. This information includes comparison configuration items and rule items, enabling personalized configuration of the data comparison. The multiple storage object scan results are compared according to the comparison configuration items to obtain preliminary comparison results. These preliminary comparison results reflect the differences between the storage object scan results, while the rule items are used to generate conclusive information based on the preliminary comparison results, thereby generating the final target comparison result. In this application, both the objects to be compared and the comparison process can be configured, improving the flexibility of the data comparison tool.
[0052] Furthermore, the steps for obtaining scan results of multiple storage objects may include: selecting multiple storage objects in response to a received scan selection instruction; receiving scan configuration information for multiple storage objects, wherein the scan configuration information is used to set the parts to be scanned, and the parts to be scanned come from multiple storage objects; verifying the scan configuration information according to preset scan verification rules; and when the scan configuration information passes the verification, scanning the multiple storage objects according to the scan configuration information to obtain the scan results of the multiple storage objects respectively.
[0053] Specifically, users can operate the terminal and trigger a scan selection command, and the data comparison tool selects multiple storage objects based on the received scan selection command.
[0054] The data comparison tool receives scan configuration information for multiple storage objects. This configuration can be done through a visual configuration page, or by using historical scan configuration information as the current scan configuration (e.g., setting the scan as a scheduled task to retrieve historical scan configuration information when triggered; or, the user can select historical scan configuration information, edit and adjust it to obtain the current scan configuration). The scan configuration information is used to set the portion to be scanned, which comes from the storage objects. The portion to be scanned refers to which part of the data in the storage object to scan (e.g., which tables in the database to scan, or which fields in the tables to scan). Alternatively, the portion to be scanned can be the entire database or the entire table.
[0055] The data comparison tool includes preset scan verification rules. Before scanning, the scan configuration information must be verified against these rules to ensure its validity. A crucial verification dimension is checking whether the stored objects are at the same level, such as whether they are all databases or tables. This is because scanning and data comparison are typically performed sequentially, and during data comparison, it's essential to ensure that the scan results for multiple stored objects are at the same level.
[0056] When the scan configuration information passes the verification, the data comparison tool scans multiple storage objects based on the scan configuration information and obtains the scan results for each storage object.
[0057] In this embodiment, multiple storage objects are selected and scanning configuration information is received. The scanning configuration information is used to set the scanning content, thereby realizing personalized scanning. The scanning configuration information is verified to be valid according to the scanning verification rules. When the verification is passed, multiple storage objects are scanned according to the scanning configuration information to obtain the storage object scanning results corresponding to each of the multiple storage objects, thus ensuring the accuracy of the storage object scanning results.
[0058] Furthermore, prior to the step of selecting multiple storage objects in response to the received scan selection instruction, the method may further include: determining a backupable data table, wherein the backupable data table is determined based on the received table setting instruction or the storage value assessment value of the data table; when a triggered backup instruction is received, performing backup processing on the backupable data table to obtain a historical backup of the backupable data table; and setting the historical backup of the backupable data table as a storage object.
[0059] Specifically, although both databases and data tables can be backed up, databases usually contain a large amount of data and store a lot of information. Therefore, it is usually preferred to back up data tables, and it is necessary to determine the data tables that can be backed up in advance.
[0060] A backupable data table refers to a data table that needs to be backed up. It can receive table setting instructions from users and set the data table as a backupable table according to these instructions; alternatively, it can calculate the storage value assessment value of the data table according to a preset algorithm. The storage value assessment value represents the storage value of the data in the data table, and backupable data tables can be automatically selected based on the storage value assessment value. In one embodiment, storage assessment indicators for each data table are obtained. These indicators include information such as the number of times each data table is accessed within a preset time period, the level of the task associated with the data table, and the level of the user accessing the data table. The storage value assessment value for each data table is obtained by weighting and calculating each storage assessment indicator.
[0061] When a backup command is received, the backupable data table is backed up to obtain a historical backup of the backupable data table. This historical backup is also set as a storage object. Setting the historical backup of the data table as a storage object allows for comparison of the same storage object at different times, which is not available in existing data comparison tools.
[0062] In this embodiment, a backupable data table is determined based on the table setting instruction or the storage value assessment value of the data table. The backupable data table is the data table that needs to be backed up. When a backup instruction is received, the backupable data table is backed up to obtain the historical backup of the backupable data table. The historical backup of the backupable data table is then set as a storage object to ensure that data comparison of the same object at different times can be achieved in the future.
[0063] Furthermore, the steps described above for obtaining comparison configuration information for scanning results of multiple storage objects may include: obtaining historical comparison configuration information associated with scanning results of multiple storage objects from the configuration information database, and generating current comparison configuration information based on historical comparison configuration information; or, displaying a visual configuration page on the terminal, and generating comparison configuration information based on configuration operations triggered on the visual configuration page.
[0064] Specifically, the data comparison tool includes a configuration information repository that stores historical comparison configuration information. This historical comparison configuration information consists of comparison configuration information that has been used in the past, and the data comparison tool can persist this used comparison configuration information.
[0065] The system retrieves historical comparison configuration information associated with multiple storage object scan results from the configuration information repository. Here, "associated" means that the historical comparison configuration information must include the storage object corresponding to the current storage object scan result. Historical comparison configuration information can be directly used as the current comparison configuration information (e.g., in scheduled task scenarios, it's unnecessary to configure comparison configuration information separately each time), or the user can adjust the historical comparison configuration information to obtain the currently applicable comparison configuration information. Persisting and reusing used historical configuration information can improve the generation speed of comparison configuration information.
[0066] The data comparison tool can also display a visual configuration page on the terminal. Users can perform WYSIWYG configuration operations on the visual configuration page by dragging and dropping, checking boxes, and entering text, thereby generating comparison configuration information.
[0067] In this embodiment, the comparison configuration information can be generated based on historical comparison configuration information in the configuration information database or based on configuration operations in the visual configuration page, thus enriching the ways to obtain comparison configuration information.
[0068] Furthermore, step S203 may include: obtaining the parts to be compared from the scanning results of multiple storage objects according to the comparison configuration information; calculating the hash value of each part to be compared; when the obtained hash values are inconsistent, comparing each part to be compared using a preset multi-dimensional comparison algorithm to obtain a preliminary comparison result.
[0069] Specifically, based on the comparison configuration information, the parts to be compared in the scan results of multiple storage objects are obtained respectively. For example, the scanned table in the database scan result is used as the part to be compared, or the scanned content corresponding to certain fields in the data table scan result is used as the part to be compared; it can be understood that the entire database scan result or data table scan result can also be used as the part to be compared.
[0070] Calculate the hash value for each part to be compared. The hash value is a unique data fingerprint. By comparing the hash values, we can quickly determine whether the scan results of each storage object are consistent, thus avoiding the computational overhead of comparing data line by line.
[0071] When the obtained hash values are inconsistent, a pre-defined multi-dimensional comparison algorithm is used to compare the parts to be compared, and a preliminary comparison result is obtained. The multi-dimensional comparison algorithm includes comparison algorithms in multiple dimensions. For example, the row-level difference algorithm is used to determine the differences by comparing each row of data in the scan results of each storage object; the longest common subsequence (LCS) algorithm, fuzzy matching algorithm, etc. are used to match similar data and determine the correlation between them.
[0072] In this embodiment, the hash value of each part to be compared is calculated first, and the parts are compared as a whole based on the hash values. When the hash values are consistent, the comparison can be ended, reducing the amount of data processing. When the obtained hash values are inconsistent, the parts to be compared are compared by a preset multi-dimensional comparison algorithm to obtain the initial comparison result, ensuring the accuracy of the initial comparison result.
[0073] Furthermore, if the rule items in the comparison configuration information include warning rule items and format rule items, then the above step S204 may include: determining the degree of difference between the scanning results of multiple storage objects based on the warning rule items and the primary comparison results, and generating warning information based on the degree of difference; performing format conversion processing on the primary comparison results based on the format rule items to obtain secondary comparison results; and generating target comparison results based on the primary comparison results, warning information, and secondary comparison results.
[0074] Specifically, the rule items include warning rule items and formatting rule items. The primary comparison results record the differences between the scan results of stored objects, such as the number of difference records (how many differences there are), the difference fields (which fields differ), and the details of the difference data (specific differences). The warning rule items record the warning rules. Based on the warning rule items and the primary comparison results, the degree of difference between the scan results of multiple stored objects can be determined, and warning information can be generated based on the degree of difference. For example, when the number of difference records between the scan results of two stored objects exceeds a preset threshold, it indicates a large degree of difference, and corresponding warning information is generated.
[0075] The primary comparison results are formatted according to the formatting rules to obtain secondary comparison results. Formatting conversion can involve processing differences or generating secondary comparison results in a specific format (e.g., charts). Based on the primary comparison results, warning information, and secondary comparison results, the final target comparison result is generated.
[0076] In this embodiment, the degree of difference between the scanning results of multiple stored objects is determined according to the early warning rule items and the primary comparison results to generate early warning information; the primary comparison results are processed by format conversion according to the format rule items to obtain secondary comparison results, thereby realizing personalized processing of the primary comparison results and generating the final target comparison results.
[0077] It should be emphasized that, in order to further ensure the privacy and security of the above target comparison results, the above target comparison results can also be stored in a blockchain node.
[0078] The blockchain referred to in this application is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.
[0079] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0080] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0081] Further reference Figure 3 As a response to the above Figure 2 To implement the method shown, this application provides an embodiment of a data comparison device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0082] like Figure 3 As shown, the data comparison device 300 described in this embodiment includes: a scan acquisition module 301, a configuration acquisition module 302, a data comparison module 303, and a result generation module 304, wherein:
[0083] The scan acquisition module 301 is used to acquire scan results of multiple storage objects. The scan results of multiple storage objects are obtained based on the scan of multiple storage objects, including databases and their historical backups, or data tables and their historical backups.
[0084] The configuration acquisition module 302 is used to acquire comparison configuration information for scanning results of multiple storage objects. The comparison configuration information includes comparison configuration items and rule items.
[0085] The data comparison module 303 is used to compare the scan results of multiple storage objects according to the comparison configuration items in the comparison configuration information to obtain the preliminary comparison results.
[0086] The result generation module 304 is used to generate the target comparison result based on the rule items in the comparison configuration information and the initial comparison result.
[0087] In this embodiment, multiple storage object scan results are obtained. These results are obtained by scanning storage objects, which can be databases and their historical backups, or data tables and their historical backups, ensuring flexibility in the objects to be compared. Comparison configuration information for the multiple storage object scan results is also obtained. This information includes comparison configuration items and rule items, enabling personalized configuration of the data comparison. The multiple storage object scan results are compared according to the comparison configuration items to obtain preliminary comparison results. These preliminary comparison results reflect the differences between the storage object scan results, while the rule items are used to generate conclusive information based on the preliminary comparison results, thereby generating the final target comparison result. In this application, both the objects to be compared and the comparison process can be configured, improving the flexibility of the data comparison tool.
[0088] In some optional implementations of this embodiment, the scanning acquisition module 301 may include: an object selection submodule, a scan receiving submodule, an information verification submodule, and an object scanning submodule, wherein:
[0089] The object selection submodule is used to select multiple stored objects in response to received scan selection instructions.
[0090] The scan receiving submodule is used to receive scan configuration information for multiple storage objects. The scan configuration information is used to set the parts to be scanned, which come from multiple storage objects.
[0091] The information verification submodule is used to verify the scanning configuration information according to the preset scanning verification rules.
[0092] The object scanning submodule is used to scan multiple storage objects according to the scanning configuration information when the scanning configuration information passes the verification, and obtain the storage object scanning results corresponding to each of the multiple storage objects.
[0093] In this embodiment, multiple storage objects are selected and scanning configuration information is received. The scanning configuration information is used to set the scanning content, thereby realizing personalized scanning. The scanning configuration information is verified to be valid according to the scanning verification rules. When the verification is passed, multiple storage objects are scanned according to the scanning configuration information to obtain the storage object scanning results corresponding to each of the multiple storage objects, thus ensuring the accuracy of the storage object scanning results.
[0094] In some optional implementations of this embodiment, the scan acquisition module 301 may further include: a data table determination submodule, a backup processing submodule, and a backup setting submodule, wherein:
[0095] The data table determination submodule is used to determine the backupable data tables. The backupable data tables are determined based on the received table setting instructions or the storage value assessment value of the data tables.
[0096] The backup processing submodule is used to perform backup processing on the backable data tables when a backup command is received, and to obtain historical backups of the backable data tables.
[0097] The Backup Settings submodule is used to set historical backups of backable data tables as storage objects.
[0098] In this embodiment, a backupable data table is determined based on the table setting instruction or the storage value assessment value of the data table. The backupable data table is the data table that needs to be backed up. When a backup instruction is received, the backupable data table is backed up to obtain the historical backup of the backupable data table. The historical backup of the backupable data table is then set as a storage object to ensure that data comparison of the same object at different times can be achieved in the future.
[0099] In some optional implementations of this embodiment, the configuration acquisition module 302 may include: a history acquisition submodule and a page acquisition submodule, wherein:
[0100] The history acquisition submodule is used to retrieve historical comparison configuration information associated with the scan results of multiple stored objects from the configuration information database, and generate the current comparison configuration information based on the historical comparison configuration information.
[0101] The page acquisition submodule is used to display a visual configuration page through the terminal and generate comparison configuration information based on the configuration operations triggered on the visual configuration page.
[0102] In this embodiment, the comparison configuration information can be generated based on historical comparison configuration information in the configuration information database or based on configuration operations in the visual configuration page, thus enriching the ways to obtain comparison configuration information.
[0103] In some optional implementations of this embodiment, the data comparison module 303 may include: a comparison acquisition submodule, a hash calculation submodule, and a comparison submodule, wherein:
[0104] The comparison acquisition submodule is used to obtain the parts to be compared from the scan results of multiple storage objects according to the comparison configuration information.
[0105] The hash calculation submodule is used to calculate the hash value of each part to be compared.
[0106] The comparison submodule is used to compare the parts to be compared using a preset multi-dimensional comparison algorithm when the obtained hash values are inconsistent, and to obtain a preliminary comparison result.
[0107] In this embodiment, the hash value of each part to be compared is calculated first, and the parts are compared as a whole based on the hash values. When the hash values are consistent, the comparison can be ended, reducing the amount of data processing. When the obtained hash values are inconsistent, the parts to be compared are compared by a preset multi-dimensional comparison algorithm to obtain the initial comparison result, ensuring the accuracy of the initial comparison result.
[0108] In some optional implementations of this embodiment, if the rule items in the comparison configuration information include warning rule items and format rule items, then the result generation module 304 may include: a warning generation submodule, a conversion processing submodule, and a result generation submodule, wherein:
[0109] The early warning generation submodule is used to determine the degree of difference between the scan results of multiple stored objects based on the early warning rule items and the primary comparison results, and to generate early warning information based on the degree of difference.
[0110] The conversion processing submodule is used to perform format conversion processing on the primary comparison results according to the format rules to obtain the secondary comparison results.
[0111] The results generation submodule is used to generate target comparison results based on primary comparison results, early warning information, and secondary comparison results.
[0112] In this embodiment, the degree of difference between the scanning results of multiple stored objects is determined according to the early warning rule items and the primary comparison results to generate early warning information; the primary comparison results are processed by format conversion according to the format rule items to obtain secondary comparison results, thereby realizing personalized processing of the primary comparison results and generating the final target comparison results.
[0113] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0114] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected via a system bus. It should be noted that only the computer device 4 with components 41-43 is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0115] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0116] The memory 41 includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 4. Of course, the memory 41 may include both the internal storage unit and its external storage device of the computer device 4. In this embodiment, the memory 41 is typically used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions for data comparison methods. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or will be output.
[0117] In some embodiments, the processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to execute computer-readable instructions stored in the memory 41 or to process data, such as executing computer-readable instructions for the data comparison method.
[0118] The network interface 43 may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 4 and other electronic devices.
[0119] The computer device provided in this embodiment can execute the above-described data comparison method. The data comparison method here can be any of the data comparison methods described in the various embodiments above.
[0120] In this embodiment, multiple storage object scan results are obtained. These results are obtained by scanning storage objects, which can be databases and their historical backups, or data tables and their historical backups, ensuring flexibility in the objects to be compared. Comparison configuration information for the multiple storage object scan results is also obtained. This information includes comparison configuration items and rule items, enabling personalized configuration of the data comparison. The multiple storage object scan results are compared according to the comparison configuration items to obtain preliminary comparison results. These preliminary comparison results reflect the differences between the storage object scan results, while the rule items are used to generate conclusive information based on the preliminary comparison results, thereby generating the final target comparison result. In this application, both the objects to be compared and the comparison process can be configured, improving the flexibility of the data comparison tool.
[0121] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by at least one processor to cause the at least one processor to perform the steps of the data comparison method described above.
[0122] In this embodiment, multiple storage object scan results are obtained. These results are obtained by scanning storage objects, which can be databases and their historical backups, or data tables and their historical backups, ensuring flexibility in the objects to be compared. Comparison configuration information for the multiple storage object scan results is also obtained. This information includes comparison configuration items and rule items, enabling personalized configuration of the data comparison. The multiple storage object scan results are compared according to the comparison configuration items to obtain preliminary comparison results. These preliminary comparison results reflect the differences between the storage object scan results, while the rule items are used to generate conclusive information based on the preliminary comparison results, thereby generating the final target comparison result. In this application, both the objects to be compared and the comparison process can be configured, improving the flexibility of the data comparison tool.
[0123] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0124] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. A data comparison method, characterized in that, Includes the following steps: Obtain scan results for multiple storage objects, which are obtained based on the scan of multiple storage objects, including databases and their historical backups, or data tables and their historical backups; Obtain comparison configuration information for the scan results of the multiple storage objects, the comparison configuration information including comparison configuration items and rule items; The scan results of the multiple storage objects are compared according to the comparison configuration items in the comparison configuration information to obtain a preliminary comparison result. Based on the rule items in the comparison configuration information and the initial comparison result, a target comparison result is generated; The step of comparing the scan results of the multiple storage objects according to the comparison configuration items in the comparison configuration information to obtain a preliminary comparison result includes: According to the comparison configuration information, the parts to be compared in the scan results of the multiple storage objects are obtained respectively, wherein the parts to be compared refer to the scanned tables in the database scan results or the scanned content in the data table scan results; Calculate the hash value of each part to be compared separately; When the obtained hash values are inconsistent, the parts to be compared are compared using a preset multi-dimensional comparison algorithm to obtain a preliminary comparison result.
2. The data comparison method according to claim 1, characterized in that, The steps for obtaining scan results of multiple stored objects include: In response to the received scan selection command, select multiple storage objects; Receive scan configuration information for the plurality of storage objects, wherein the scan configuration information is used to set the part to be scanned, and the part to be scanned comes from the plurality of storage objects; The scanning configuration information is verified according to preset scanning verification rules; When the scanning configuration information passes the verification, the plurality of storage objects are scanned according to the scanning configuration information to obtain the storage object scanning results corresponding to the plurality of storage objects respectively.
3. The data comparison method according to claim 2, characterized in that, Prior to the step of selecting multiple storage objects in response to a received scan selection instruction, the method further includes: The backupable data table is determined based on the received table setting instructions or the storage value assessment value of the data table; When a backup command is received, the backupable data table is backed up to obtain a historical backup of the backupable data table. Set the historical backups of the backable data table as storage objects.
4. The data comparison method according to claim 1, characterized in that, The step of obtaining the comparison configuration information for the scan results of the multiple storage objects includes: Retrieve historical comparison configuration information associated with the scan results of the multiple stored objects from the configuration information database, and generate the current comparison configuration information based on the historical comparison configuration information; or, A visual configuration page is displayed on the terminal, and comparative configuration information is generated based on the configuration operations triggered on the visual configuration page.
5. The data comparison method according to claim 1, characterized in that, The rule items in the comparison configuration information include warning rule items and format rule items. The step of generating the target comparison result based on the rule items in the comparison configuration information and the initial comparison result includes: The degree of difference between the scan results of the multiple stored objects is determined based on the warning rule item and the primary comparison result, and warning information is generated based on the degree of difference; The primary comparison result is converted according to the format rules to obtain the secondary comparison result. Based on the primary comparison results, the early warning information, and the secondary comparison results, a target comparison result is generated.
6. A data comparison device, characterized in that, include: The scanning acquisition module is used to acquire the scanning results of multiple storage objects. The scanning results of multiple storage objects are obtained based on the scanning of multiple storage objects. The multiple storage objects include databases and their historical backups, or data tables and their historical backups. The configuration acquisition module is used to acquire comparison configuration information for the scan results of the multiple storage objects, the comparison configuration information including comparison configuration items and rule items; The data comparison module is used to compare the scan results of the multiple storage objects according to the comparison configuration items in the comparison configuration information to obtain a preliminary comparison result; The result generation module is used to generate a target comparison result based on the rule items in the comparison configuration information and the initial comparison result; The data comparison module includes: The comparison acquisition submodule is used to acquire the parts to be compared in the scan results of the multiple storage objects according to the comparison configuration information, wherein the parts to be compared refer to the scanned tables in the database scan results or the scanned content in the data table scan results; The hash calculation submodule is used to calculate the hash value of each part to be compared. The comparison submodule is used to compare the parts to be compared using a preset multi-dimensional comparison algorithm when the obtained hash values are inconsistent, so as to obtain a preliminary comparison result.
7. A computer device comprising a memory and a processor, the memory storing computer-readable instructions, wherein the processor, when executing the computer-readable instructions, implements the steps of the data comparison method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the data comparison method as described in any one of claims 1 to 5.