Data auditing method and device, electronic equipment and storage medium
By constructing data groups between heterogeneous databases and encrypting them, the problem of low data audit efficiency is solved, achieving more efficient data audit and better security.
Patent Information
- Application Number
- CN202311730213.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2024-10-18
AI Technical Summary
The existing technology has low efficiency in data auditing between heterogeneous databases, resulting in large storage space usage, high memory consumption and insufficient data security, which in turn affects the efficiency and security of the data migration process.
By constructing data groups of source data and target data, the dense state value is determined based on the length information of each group of data for data encryption, and dense state data is generated for auditing, which reduces storage and memory requirements, improves audit efficiency, and ensures data security.
It improves the efficiency of heterogeneous database data auditing, reduces storage and memory requirements, enhances data security, and solves the problems of storage space occupation and insufficient memory during the data auditing process.
Smart Images

Figure CN118796907A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data auditing method, device, electronic device and storage medium. Background Art
[0002] In computer architecture, heterogeneity refers to different mainframes, minicomputers, workstations, personal computers (PCs) or embedded systems, or different basic operating systems. In the database field, heterogeneous databases refer more to relational databases with different underlying architectures, or heterogeneous database systems with different data models such as relational, hierarchical, schema, and object-oriented.
[0003] With the rapid development of the trusted database, more industries are choosing to gradually migrate their core databases to trusted databases. During the migration process, the source data needs to be fully synchronized to the target heterogeneous database. After the data migration is completed, it does not mean that the target data is 100% identical to the source data. Due to the different character sets, different support ranges for rare characters, or different data type precisions between heterogeneous databases, there may be differences between the target data and the source data. The difference data is disastrous for the entire application system, and the user experience will be greatly reduced.
[0004] In order to troubleshoot and resolve data discrepancies, specific tools are needed to audit the data on the source and target ends. Auditing is not only about comparing the full amount of data, but also about evaluating the migration cycle and the total amount of data migrated. The shorter the cycle and the larger the total amount of data, the higher the efficiency requirements for the audit. Currently, manual auditing methods can be used to audit the data on the source and target ends. The manual auditing method requires building a synchronization link from the target database to reversely synchronize the target data to a different user of the source database, or to a database of the same type as the source database. Then, through the Structured Query Language (SQL) statement, the database's difference function is used to perform a two-way comparison of the data, and the output result set is displayed on the client interface, and the manual judgment is made as to whether there is a difference. Once the result set has data displayed, it means that the data is different. However, manual auditing relies on reverse synchronization data, so it requires the same storage space as the source end. The source database and the reverse database correspond one-to-one, and the storage environment of the reverse database cannot be used by other audit tasks at the same time. If there are multiple audit tasks, reverse libraries with the same number of tasks need to be built for auditing. Therefore, manual auditing requires a large amount of storage space, increasing storage costs. Secondly, the current auditing application usually compares the original data by putting the original data into the memory for comparison. If the amount of data is too large, a large amount of memory will be consumed, which may lead to insufficient memory and block the operation of the auditing task. In addition, data leakage is prone to occur in the auditing process, and the security of the data cannot be guaranteed. Therefore, the current data auditing of heterogeneous databases is inefficient. Summary of the invention
[0005] The embodiments of the present application provide a data auditing method, device, electronic device and storage medium to solve the problem of low efficiency in current data auditing of heterogeneous databases.
[0006] In a first aspect, an embodiment of the present application provides a data audit method, comprising:
[0007] Acquire source data and target data; the source data and the target data are from a homogeneous database or a heterogeneous database;
[0008] Constructing a first data group of the source end data and a second data group of the target end data;
[0009] Determine a secret value based on the length information of each group of data in the first data group and the second data group;
[0010] Encrypt the first data group and the second data group based on the secret value to obtain first secret data and second secret data respectively;
[0011] A data audit is performed based on the first confidential data and the second confidential data to obtain a data audit result.
[0012] In one embodiment, encrypting the first data group and the second data group based on the secret value to obtain first secret data and second secret data respectively includes:
[0013] performing an addition operation based on the secret state value and a first group of data in the first data group to obtain first summed data; after updating the secret state value with the first summed data and deleting the first group of data in the first data group, performing the step of performing an addition operation based on the secret state value and the first group of data in the first data group to obtain the first summed data, until it is determined that no data exists in the first data group, generating first secret state data based on the obtained first summed data;
[0014] Performing an addition operation based on the secret value and the first group of data in the second data group to obtain second sum data; after updating the secret data through the second sum data and deleting the first group of data in the second data group, executing the step of performing an addition operation based on the secret value and the first group of data in the second data group to obtain second sum data, until it is determined that no data exists in the second data group, generating second secret data based on the obtained second sum data.
[0015] In one embodiment, generating the first encrypted data based on the obtained first sum data includes:
[0016] The obtained first sum data is converted into hexadecimal data to obtain first encrypted data.
[0017] In one embodiment, determining the secret state value based on the length information of each group of data in the first data group and the second data group includes:
[0018] Determine the length of the secret value based on the length information of each group of data in the first data group and the second data group;
[0019] Encrypting the length of the secret state value to obtain an encrypted value;
[0020] Perform rounding based on the encrypted value to obtain an integer value;
[0021] The integer value is converted into a base to obtain a secret value.
[0022] In one embodiment, the step of constructing the first data group of the source data includes:
[0023] Convert the source data into binary data to obtain converted data;
[0024] Dividing the converted data according to a preset segmentation length to obtain multiple groups of data;
[0025] A first data group of the source data is constructed based on multiple groups of data.
[0026] In one embodiment, constructing the first data group of the source data based on multiple groups of data includes:
[0027] If the length of any group of data among the multiple groups of data is less than the preset segmentation length, data padding is performed on the group of data whose length is less than the preset segmentation length to obtain padding data;
[0028] A first data group of the source data is constructed based on the padding data and other groups of data in the multiple groups of data.
[0029] In one embodiment, performing data audit based on the first confidential data and the second confidential data to obtain a data audit result includes:
[0030] Performing data comparison on the first secret state data and the second secret state data;
[0031] If the first secret data is consistent with the second secret data, it is determined that the source data is consistent with the target data.
[0032] In a second aspect, an embodiment of the present application provides a data auditing device, including:
[0033] An acquisition module is used to acquire source data and target data; the source data and the target data are from a homogeneous database or a heterogeneous database;
[0034] A construction module, used to construct a first data group of the source end data and a second data group of the target end data;
[0035] A determination module, configured to determine a secret state value based on length information of each group of data in the first data group and the second data group;
[0036] An encryption module, used to encrypt the first data group and the second data group based on the secret value to obtain first secret data and second secret data respectively;
[0037] An audit module is used to perform data audit based on the first confidential data and the second confidential data to obtain a data audit result.
[0038] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory storing a computer program, wherein when the processor executes the program, the data audit method described in the first aspect is implemented.
[0039] In a fourth aspect, an embodiment of the present application provides a storage medium, which is a computer-readable storage medium and includes a computer program. When the computer program is executed by a processor, the data audit method described in the first aspect is implemented.
[0040] The data audit method, device, electronic device and storage medium provided in the embodiment of the present application, by constructing a first data group of source data and a second data group of target data from a heterogeneous database, can determine the secret value according to the length information of each data group in the data group, and then encrypt the first data group and the second data group according to the secret value, and finally perform data audit according to the encrypted first secret data and the second secret data to obtain the data audit result. Since the original data is converted into secret data, the secret data occupies less space and the data is smaller, while speeding up the audit, reducing the requirements for storage and memory, and ensuring the security of the data, so that the data audit efficiency of the heterogeneous database can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 It is a flowchart of the data audit method provided in the embodiment of the present application;
[0043] Figure 2 It is a schematic diagram of the confidential data conversion process of the data audit method provided in the embodiment of the present application;
[0044] Figure 3 It is a schematic diagram of an application scenario of the data audit method provided in an embodiment of the present application;
[0045] Figure 4 It is a functional module diagram of an embodiment of the data auditing device of the present application;
[0046] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] It should be noted that the data audit of the source and target ends can also be performed through the Java Database Connectivity (JDBC) program audit method, in which the JDBC program audit method connects to the source and target databases respectively through the JDBC program, executes SQL statements to query the full data, and caches the result set in memory. In the memory, use the equals method or compareTo method to compare the data of the source and target ends, and output the comparison results to the foreground. Among them, Java is a widely used high-level programming language. The equals method and compareTo method are methods used in Java to compare the equality and order of objects. The equals method is used to compare whether two objects are equal. The compareTo method is used to compare the order relationship of two objects.
[0049] However, the auditing method through JDBC program requires extracting all the data from the source and target ends, and then comparing the original data. When there are too many records, too many fields, or large object (LOB) fields, the efficiency of original data comparison will be greatly reduced.
[0050] Furthermore, since the original data is not encrypted, the methods of data leakage are greatly increased, and the security of the data cannot be guaranteed.
[0051] Below is a combination of the embodiments and Figure 1-Figure 5 The data audit method, device, electronic device and storage medium provided by the present invention are described in detail.
[0052] Figure 1 The flowchart of the data audit method provided in the embodiment of the present application is shown in FIG. Figure 1 , the present application embodiment provides a data audit method, which may include:
[0053] Step 100, obtaining source data and target data;
[0054] It should be noted that the execution subject of the device identification method provided in the embodiment of the present application may be a server, a computer device, etc., such as a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. The server or computer device of the present application may be provided with or connected to a data audit device, and the data audit method of the present application may be completed by controlling the data audit device.
[0055] The data auditing device of the present application may include a data entry module, a format processing module, a confidentiality conversion module, a result output module, a confidentiality comparison module and a result analysis module.
[0056] In this application, heterogeneous databases in the database field more often refer to relational databases with different underlying architectures such as Oracle, Mysql, and DB2, or heterogeneous database systems with different data models such as relations, hierarchies, patterns, and object-oriented. Among them, Oracle, Mysql, and DB2 are all relational database management systems. Homogeneous databases are databases that use the same architecture and technology.
[0057] When data audit is required, the application can obtain the data of the specified source and the specified target through the data entry module, thereby obtaining the source data and the target data, and sending the obtained data to the format processing module. The source data and the target data can come from heterogeneous databases or homogeneous databases.
[0058] It should be noted that when the source data and the target data are derived from the same database, the present application may also adopt other existing data auditing methods for data auditing. The present application does not make any specific limitation.
[0059] Step 200, constructing a first data group of source-end data and a second data group of target-end data;
[0060] After obtaining the source data and the target data, the present application can perform base conversion on the source data and the target data respectively through the format processing module, and group the data obtained by the base conversion according to the specified length value, and form a corresponding data group from each group of data after grouping. Among them, the data group formed by the source data can be defined as the first data group, and the data group formed by the target data can be defined as the second data group.
[0061] It should be noted that after grouping, if any group of data does not meet the specified length, the group of data needs to be padded.
[0062] Step 300, determining a secret state value based on the length information of each data group in the first data group and the second data group;
[0063] After obtaining the first data group and the second data group, the length information of each data group in the first data group and the second data group can be determined, and the encrypted value is calculated according to the length information to obtain the initial encrypted value.
[0064] Step 400, encrypting the first data group and the second data group based on the secret value to obtain first secret data and second secret data respectively;
[0065] After obtaining the secret state value, the secret state conversion module can be used to encrypt the first data group using the secret state value, and the encrypted data can be determined as the first secret state data, and the secret state value can be used to encrypt the second data group using the secret state value, and the encrypted data can be determined as the second secret state data. The data encryption process can include secret state value accumulation and base conversion. Furthermore, the result output module can receive the first secret state data and the second secret state data output by the secret state conversion module, and send them to the secret state comparison module for auditing.
[0066] Step 500, performing data audit based on the first confidential data and the second confidential data to obtain a data audit result.
[0067] After obtaining the first secret data and the second secret data, the specific data audit result can be determined by comparing the first secret data with the second secret data.
[0068] The data audit method provided in the embodiment of the present application, by constructing a first data group of source data from a heterogeneous database and a second data group of target data, can determine the secret value according to the length information of each group of data in the data group, and then encrypt the first data group and the second data group according to the secret value, and finally perform data audit according to the encrypted first secret data and the second secret data to obtain the data audit result. Since the original data is converted into secret data, the secret data occupies less space and the data is smaller, while speeding up the audit, reducing the requirements for storage and memory, and ensuring the security of the data, so the data audit efficiency of the heterogeneous database can be improved.
[0069] In one embodiment, constructing a first data group of source data includes:
[0070] Step 201, converting source data into binary data to obtain converted data;
[0071] Step 202, dividing the converted data according to a preset segmentation length to obtain multiple groups of data;
[0072] Step 203: construct a first data group of source data based on multiple groups of data.
[0073] After obtaining the source-end data and the target-end data, the present application may convert the source-end data into binary data, and define the converted data as converted data.
[0074] Furthermore, a preset segmentation length may be obtained. In the present application, the preset segmentation length may be, for example, 64 bits.
[0075] Therefore, the converted data can be divided into multiple groups of data according to the preset division length.
[0076] After obtaining multiple sets of data, a data group may be formed from the complete multiple sets of data, and the data group may be defined as a first data group.
[0077] Similarly, the target end data can be converted into binary data, and the converted data is defined as conversion data.
[0078] Therefore, the converted data can be divided into multiple groups of data according to the preset division length.
[0079] After obtaining multiple sets of data, a data group may be formed from the complete multiple sets of data, and the data group may be defined as a second data group.
[0080] Further, constructing a first data group of source data based on the multiple data groups includes:
[0081] Step 2031, if the length of any group of data among the multiple groups of data is less than the preset segmentation length, data padding is performed on the group of data whose length is less than the preset segmentation length to obtain padding data;
[0082] Step 2032: construct a first data group of source data based on the padding data and other groups of data in the multiple groups of data.
[0083] After obtaining multiple groups of data, the present application can detect whether the length of each group of data is the same as the preset segmentation length.
[0084] If it is determined through detection that the length of any group of data among the multiple groups of data is less than the preset segmentation length (generally the last group of data among the multiple groups of data), data padding is performed on the group of data. Specifically, the first bit of the group of data can be used as the starting point, and the data can be sequentially padded to the last bit of the data until the length of the group of data reaches the preset segmentation length. It can be understood that when performing data padding, the padded data can be 0.
[0085] After the padding data is obtained, a data group may be constructed by combining the padding data with the remaining groups of data and determined as the first data group of the source data.
[0086] After obtaining the binary conversion data, the conversion data can be divided into data groups with the length of 64 bits as the dividing line. If the length of the last group of data in the data group is less than 64 bits, data padding is required. When padding, the first bit of the data group is used as the starting point, and the data is supplemented to the last bit of the data in sequence until the length of the data group is full of 64 bits. At this point, the binary conversion data is divided into data groups with a length of 64 bits.
[0087] This embodiment can construct a first data group of source data from a heterogeneous database and a second data group of target data, so that the secret value can be determined according to the length information of each group of data in the data group, and then the first data group and the second data group can be encrypted according to the secret value, and finally the data audit can be performed according to the encrypted first secret data and the second secret data to obtain the data audit result. Since the original data is converted into secret data, the secret data occupies less space and the data is smaller, while speeding up the audit, reducing the requirements for storage and memory, and ensuring the security of the data, so the data audit efficiency of the heterogeneous database can be improved.
[0088] In one embodiment, determining the secret state value based on the length information of each group of data in the first data group and the second data group includes:
[0089] Step 301, determining the length of the secret state value based on the length information of each group of data in the first data group and the second data group;
[0090] Step 302, encrypt the length of the secret state value to obtain an encrypted value;
[0091] Step 303, rounding the encrypted value to obtain an integer value;
[0092] Step 304, convert the integer value to obtain a secret value.
[0093] After obtaining the first data group and the second data group, the present application can determine the length information of each group of data in the first data group and the second data group, and determine the difference between the length information and the first preset value as the secret state value length. The first preset value in the present application can be 1.
[0094] Furthermore, the encrypted value length may be multiplied by a second preset value to encrypt the encrypted value length to obtain an encrypted value. The second preset value may be any real number greater than or equal to 1, for example, 3.14 in the present application.
[0095] Furthermore, the encrypted value may be rounded. Specifically, the encrypted value may be ratioed with the third preset value and then the ratio calculation result may be rounded to obtain an integer value.
[0096] Furthermore, the integer value is converted into binary data, and the converted data is determined as a secret value.
[0097] In one embodiment, the secret state value may be determined by the following calculation formula:
[0098] i = (2^n-1)*m / 10;
[0099] Among them, i represents a secret value, n represents a specified word length, that is, the length information of each group of data in the first data group and the second data group, m represents any real number greater than or equal to 1, such as pi 3.14, and / 10 represents rounding after dividing by 10.
[0100] This embodiment can accurately determine the secret value based on the length information of the data group constructed by the source data and the target data from the heterogeneous database, and then encrypt the first data group and the second data group according to the secret value, and finally perform data audit based on the encrypted first secret data and the second secret data to obtain the data audit result. Since the original data is converted into secret data, the secret data occupies less space and the data is smaller, which speeds up the audit while reducing the requirements for storage and memory, and also ensures the security of the data, so the data audit efficiency of the heterogeneous database can be improved.
[0101] Further, the first data group and the second data group are encrypted based on the secret value to obtain first secret data and second secret data, respectively, including:
[0102] Step 401, performing an addition operation based on the secret state value and the first group of data in the first data group to obtain first summed data; after updating the secret state value with the first summed data and deleting the first group of data in the first data group, performing an addition operation based on the secret state value and the first group of data in the first data group to obtain the first summed data, until it is determined that there is no data in the first data group, generating first secret state data based on the obtained first summed data;
[0103] Step 402, performing an addition operation based on the secret value and the first group of data in the second data group to obtain second sum data; after updating the secret data with the second sum data and deleting the first group of data in the second data group, performing an addition operation based on the secret value and the first group of data in the second data group to obtain second sum data, until it is determined that there is no data in the second data group, and then generating second secret data based on the obtained second sum data.
[0104] After obtaining the secret state value, the first data group and the second data group, the present application can perform an addition operation on the secret state value and the first group of data in the first data group for the first data group, and determine the result of the addition operation as the first added data.
[0105] Furthermore, the initial encrypted value is replaced by the first added data and the first group of data in the first data group is deleted.
[0106] Furthermore, the encrypted value is added to the new first group of data in the first data group to obtain new first added data, and then the original encrypted value is replaced by the first added data and the first group of data in the first data group is deleted. This is deduced in this way until it is determined that there is no data in the first data group (that is, all groups of data in the first data group are processed and deleted), and the first encrypted data as the final encrypted data is generated based on the obtained first added data.
[0107] Similarly, for the second data group, the secret value and the first group of data in the second data group may be added together, and the result of the addition operation may be determined as the second added data.
[0108] Furthermore, the initial encrypted value is replaced by the second added data and the first group of data in the second data group is deleted.
[0109] Furthermore, the encrypted value is added to the new first group of data in the second data group to obtain new second added data, and then the original encrypted value is replaced by the second added data and the first group of data in the second data group is deleted. This is deduced in this way until it is determined that there is no data in the second data group (that is, each group of data in the second data group is processed and deleted), and the second encrypted data as the final encrypted data is generated based on the obtained second added data.
[0110] Further, generating first encrypted data based on the obtained first sum data includes:
[0111] Step 4011, convert the obtained first sum data into hexadecimal data to obtain first encrypted data.
[0112] After obtaining the final first sum data, the first sum data may be converted into a base system. Specifically, the first sum data may be converted into hexadecimal data, and the converted data may be confirmed as the first secret data.
[0113] Similarly, after obtaining the final second sum data, the second sum data can be converted into a base, specifically, the second sum data can be converted into hexadecimal data, and the converted data is confirmed as the second secret data.
[0114] In this embodiment, the first data group and the second data group can be encrypted according to the secret state value, so as to perform data audit according to the encrypted first secret state data and the second secret state data to obtain the data audit result. Since the original data is converted into secret state data, the secret state data occupies less space and the data is smaller, which speeds up the audit while reducing the storage and memory requirements and ensuring the security of the data, thus improving the data audit efficiency of heterogeneous databases.
[0115] In one embodiment, data audit is performed based on the first secret data and the second secret data to obtain a data audit result, including:
[0116] Step 501, performing data comparison between the first secret state data and the second secret state data;
[0117] Step 502: If the first secret data is consistent with the second secret data, it is determined that the source data is consistent with the target data.
[0118] After obtaining the first secret data and the second secret data, the present application may perform a data comparison between the first secret data and the second secret data to determine whether the first secret data and the second secret data are consistent.
[0119] If the first confidential data is determined to be consistent with the second confidential data through comparison, a data audit result is obtained that the source data is consistent with the target data.
[0120] If it is determined that the first confidential data and the second confidential data are inconsistent, a data audit result indicating that the source data and the target data are inconsistent is obtained.
[0121] This embodiment constructs a first data group of source data from a heterogeneous database and a second data group of target data, so that the secret value can be determined according to the length information of each data group in the data group, and then the first data group and the second data group can be encrypted according to the secret value, and finally the data audit can be performed according to the encrypted first secret data and the second secret data to obtain the data audit result. Since the original data is converted into secret data, the secret data occupies less space and the data is smaller, while speeding up the audit, reducing the requirements for storage and memory, and ensuring the security of the data, so the data audit efficiency of the heterogeneous database can be improved.
[0122] Figure 2 A schematic diagram of the confidential data conversion process of the data audit method provided in the embodiment of the present application, referring to Figure 2 In one embodiment, the present application may receive the original data from the source and target ends through a data entry module, and send the original data to a format processing module.
[0123] Furthermore, the received data can be converted into binary data by the format processing module, and the converted binary data can be grouped with 64-bit length as the dividing line. If the last group of data in the data group is less than 64 bits long, data padding is required. When padding, the first bit of the data group is used as the starting point, and the data is supplemented to the last bit of the data in sequence until the length of the data group is full of 64 bits. At this point, the binary file is divided into data groups with a length of 64 bits.
[0124] Furthermore, the calculation of the initial secret state value, the accumulation of the secret state value and the conversion of the base of the final data can be performed through the secret state conversion module. The calculation formula of the initial secret state value is: i = (2^n-1) * m / 10, where i represents the initial secret state value, n represents the specified word length, and m represents any real number greater than or equal to 1. For example, the word length here can be 64, and m is pi 3.14. Further, the initial secret state value is added to the first group of data in the data group to obtain a new secret state value i, and the first group of data in the data group that has participated in the secret state value calculation is deleted from the data group. By analogy, the secret state value is accumulated with the data in the data group until the data in the data group is deleted, and the accumulated secret state value i is obtained. The accumulated secret state value i is then converted into hexadecimal data through the secret state conversion module to obtain the final secret state data.
[0125] Furthermore, the final confidential data is received through the result output module and sent to the audit program.
[0126] Figure 3 This is a schematic diagram of an application scenario of the data audit method provided in the embodiment of the present application, referring to Figure 3In one embodiment, the present application can connect to the database through the data extraction module in the audit program, extract the original data from the source database and the target database according to the extraction scope through the extraction process, and push the extraction results to the secret conversion process.
[0127] Furthermore, the original data pushed by the extraction process can be converted into a secret state through the secret data conversion process in the secret conversion module, and the converted secret data (specifically, each secret value) can be pushed into the memory for storage.
[0128] Furthermore, the secret data of the source and target ends pushed by the secret data conversion process can be read from the memory respectively through the secret comparison module, the two secret data can be compared in secret through the comparison program (for example, using the equals method or the compareTo method), and the return value can be pushed to the result analysis module for result analysis.
[0129] Furthermore, the result analysis module can determine whether the result driven by the secret state comparison module is true or false. If it is true, it is determined that the data of the source and target ends are consistent, and if it is false, it is determined that the data of the source and target ends are inconsistent. The comparison result is returned to the front desk through the result analysis module to inform the user of the audit result, and the secret state value after the comparison is cleared from the memory, thereby releasing the memory faster.
[0130] This application converts the original data at the source and target ends into confidential data and compares the converted confidential data. After the confidential conversion, the original data is converted into confidential data, which occupies less space and is smaller. Therefore, while speeding up the audit efficiency, it reduces the requirements for storage and memory and ensures data security.
[0131] Furthermore, the present application also provides a data auditing device.
[0132] Reference Figure 4 , Figure 4 This is a functional module diagram of an embodiment of a data auditing device of the present application.
[0133] The data auditing device comprises:
[0134] The acquisition module 410 is used to acquire source data and target data; the source data and the target data are from a homogeneous database or a heterogeneous database;
[0135] A construction module 420, configured to construct a first data group of the source end data and a second data group of the target end data;
[0136] A determination module 430, configured to determine a secret state value based on length information of each group of data in the first data group and the second data group;
[0137] An encryption module 440 is used to encrypt the first data group and the second data group based on the secret value to obtain first secret data and second secret data respectively;
[0138] The audit module 450 is used to perform data audit based on the first confidential data and the second confidential data to obtain a data audit result.
[0139] The data audit device provided in the embodiment of the present application, by constructing a first data group of source data from a heterogeneous database and a second data group of target data, can determine the secret value according to the length information of each group of data in the data group, and then encrypt the first data group and the second data group according to the secret value, and finally perform data audit according to the encrypted first secret data and the second secret data to obtain the data audit result. Since the original data is converted into secret data, the secret data occupies less space and the data is smaller, while speeding up the audit, reducing the requirements for storage and memory, and ensuring the security of the data, so that the data audit efficiency of the heterogeneous database can be improved.
[0140] In one embodiment, the construction module 420 is specifically used to:
[0141] Convert the source data into binary data to obtain converted data;
[0142] Dividing the converted data according to a preset segmentation length to obtain multiple groups of data;
[0143] A first data group of the source data is constructed based on multiple groups of data.
[0144] In one embodiment, the construction module 420 includes a construction unit, wherein the construction unit is used to:
[0145] If the length of any group of data among the multiple groups of data is less than the preset segmentation length, data padding is performed on the group of data whose length is less than the preset segmentation length to obtain padding data;
[0146] A first data group of the source data is constructed based on the padding data and other groups of data in the multiple groups of data.
[0147] In one embodiment, the determination module 430 is specifically configured to:
[0148] Determine the length of the secret value based on the length information of each group of data in the first data group and the second data group;
[0149] Encrypting the length of the secret state value to obtain an encrypted value;
[0150] Perform rounding based on the encrypted value to obtain an integer value;
[0151] The integer value is converted into a base to obtain a secret value.
[0152] In one embodiment, the encryption module 440 is specifically used to:
[0153] performing an addition operation based on the secret state value and a first group of data in the first data group to obtain first summed data; after updating the secret state value with the first summed data and deleting the first group of data in the first data group, performing the step of performing an addition operation based on the secret state value and the first group of data in the first data group to obtain the first summed data, until it is determined that no data exists in the first data group, generating first secret state data based on the obtained first summed data;
[0154] Performing an addition operation based on the secret value and the first group of data in the second data group to obtain second sum data; after updating the secret data through the second sum data and deleting the first group of data in the second data group, executing the step of performing an addition operation based on the secret value and the first group of data in the second data group to obtain second sum data, until it is determined that no data exists in the second data group, generating second secret data based on the obtained second sum data.
[0155] In one embodiment, the encryption module 440 includes a generation unit configured to:
[0156] The obtained first sum data is converted into hexadecimal data to obtain first encrypted data.
[0157] In one embodiment, the audit module 450 is specifically used to:
[0158] Performing data comparison on the first secret state data and the second secret state data;
[0159] If the first secret data is consistent with the second secret data, it is determined that the source data is consistent with the target data.
[0160] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other via the communication bus 540. The processor 510 may call a computer program in the memory 530 to execute the steps of the data audit method, for example including:
[0161] Acquire source data and target data; the source data and the target data are from a homogeneous database or a heterogeneous database;
[0162] Constructing a first data group of the source end data and a second data group of the target end data;
[0163] Determine a secret value based on the length information of each group of data in the first data group and the second data group;
[0164] Encrypt the first data group and the second data group based on the secret value to obtain first secret data and second secret data respectively;
[0165] A data audit is performed based on the first confidential data and the second confidential data to obtain a data audit result.
[0166] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0167] On the other hand, an embodiment of the present application further provides a storage medium, wherein the storage medium is a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program is used to enable a processor to execute the steps of the methods provided in the above embodiments, for example, including:
[0168] Acquire source data and target data; the source data and the target data are from a homogeneous database or a heterogeneous database;
[0169] Constructing a first data group of the source end data and a second data group of the target end data;
[0170] Determine a secret value based on the length information of each group of data in the first data group and the second data group;
[0171] Encrypt the first data group and the second data group based on the secret value to obtain first secret data and second secret data respectively;
[0172] A data audit is performed based on the first confidential data and the second confidential data to obtain a data audit result.
[0173] The computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0174] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0175] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0176] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A data audit method, characterized in that: include: Get source data and target data; The source data and the target data are from a homogeneous database or a heterogeneous database; Constructing a first data group of the source end data and a second data group of the target end data; Determine a secret value based on the length information of each group of data in the first data group and the second data group; Encrypt the first data group and the second data group based on the secret value to obtain first secret data and second secret data respectively; A data audit is performed based on the first confidential data and the second confidential data to obtain a data audit result.
2. The data audit method according to claim 1, characterized in that: The step of encrypting the first data group and the second data group based on the secret value to obtain first secret data and second secret data respectively includes: performing an addition operation based on the secret state value and a first group of data in the first data group to obtain first summed data; after updating the secret state value with the first summed data and deleting the first group of data in the first data group, performing the step of performing an addition operation based on the secret state value and the first group of data in the first data group to obtain the first summed data, until it is determined that no data exists in the first data group, generating first secret state data based on the obtained first summed data; Performing an addition operation based on the secret value and the first group of data in the second data group to obtain second sum data; after updating the secret data through the second sum data and deleting the first group of data in the second data group, executing the step of performing an addition operation based on the secret value and the first group of data in the second data group to obtain second sum data, until it is determined that no data exists in the second data group, generating second secret data based on the obtained second sum data.
3. The data audit method according to claim 2, characterized in that: The step of generating first encrypted data based on the obtained first sum data includes: The obtained first sum data is converted into hexadecimal data to obtain first encrypted data.
4. The data audit method according to claim 1, characterized in that: The determining of the secret state value based on the length information of each group of data in the first data group and the second data group includes: Determine the length of the secret value based on the length information of each group of data in the first data group and the second data group; Encrypting the length of the secret state value to obtain an encrypted value; Perform rounding based on the encrypted value to obtain an integer value; The integer value is converted into a base to obtain a secret value.
5. The data audit method according to claim 1, characterized in that: The step of constructing the first data group of the source data includes: Convert the source data into binary data to obtain converted data; Dividing the converted data according to a preset segmentation length to obtain multiple groups of data; A first data group of the source data is constructed based on multiple groups of data.
6. The data audit method according to claim 5, characterized in that: The step of constructing the first data group of the source data based on the multiple data groups includes: If the length of any group of data among the multiple groups of data is less than the preset segmentation length, data padding is performed on the group of data whose length is less than the preset segmentation length to obtain padding data; A first data group of the source data is constructed based on the padding data and other groups of data in the multiple groups of data.
7. The data audit method according to claim 1, characterized in that: The performing of data audit based on the first confidential data and the second confidential data to obtain a data audit result includes: Performing data comparison on the first secret state data and the second secret state data; If the first secret data is consistent with the second secret data, it is determined that the source data is consistent with the target data.
8. A data auditing device, characterized in that: include: The acquisition module is used to acquire source data and target data; The source data and the target data are from a homogeneous database or a heterogeneous database; A construction module, used to construct a first data group of the source end data and a second data group of the target end data; A determination module, configured to determine a secret state value based on length information of each group of data in the first data group and the second data group; An encryption module, used to encrypt the first data group and the second data group based on the secret value to obtain first secret data and second secret data respectively; An audit module is used to perform data audit based on the first confidential data and the second confidential data to obtain a data audit result.
9. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the data audit method according to any one of claims 1 to 7 is implemented.
10. A storage medium, the storage medium being a computer-readable storage medium, comprising a computer program, characterized in that: When the computer program is executed by a processor, the data audit method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Loose type data consistency checking method
CN104809250A
Data auditing and checking method and system
CN106971002A
Data auditing method and device, electronic equipment and storage medium
CN116204522A
Feature comparison method and device, electronic equipment and computer storage medium
CN116204898A
