Data verification method, device and equipment and computer storage medium
By storing and comparing integrity check codes in blockchain and data warehouses, the problem of database access personnel tampering with check codes is solved, thus improving the security and reliability of check codes.
Patent Information
- Application Number
- CN202411164391.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-11-26
AI Technical Summary
In existing technologies, database privileged personnel may maliciously tamper with the integrity check codes of data tables, leading to a decrease in the security and reliability of the integrity check codes.
By generating an integrity verification code based on a preset encryption algorithm and storing it in a blockchain and data warehouse, the security storage and comparison of the verification code can be achieved by combining the immutability of the blockchain with the target attributes of the data warehouse.
This improves the security of the integrity check code, reduces the probability of tampering, and ensures the reliability of data integrity verification.
Smart Images

Figure CN119026183A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain, and in particular to a data verification method, device, equipment, computer storage medium and computer program product. Background Art
[0002] In recent years, with the rapid development of big data technology, more and more fields have begun to use big data technology to store data. In related technologies, the integrity of the stored data is verified through the integrity check code field in the data table.
[0003] However, there may be a phenomenon that someone who has obtained database permissions maliciously tampered with the integrity check code in the database table, causing the integrity check code in the data table to be damaged, reducing the security of the integrity check code. In addition, since the subsequent integrity check of the data in the data table using the complete new check code fails, the reliability of the data integrity check is reduced. Summary of the invention
[0004] The embodiments of the present disclosure provide a data verification method, apparatus, device, computer storage medium and computer program product, which can improve the security of integrity verification codes.
[0005] In a first aspect, an embodiment of the present disclosure provides a data verification method, the method comprising:
[0006] Based on the preset encryption algorithm, the data to be stored is encrypted to obtain the integrity check code;
[0007] The data to be stored is stored in the data warehouse; the integrity check code is stored in the blockchain and the data warehouse;
[0008] Under the condition that a preset verification method is met, a first verification code stored in the blockchain and a second verification code stored in the data warehouse are read, and the first verification code and the second verification code correspond to the same data to be verified;
[0009] Comparing the first check code with the second check code;
[0010] When the first verification code is consistent with the second verification code, the comparison result is recorded and saved in the data warehouse.
[0011] In one practicable implementation, storing the data to be stored in the data warehouse includes:
[0012] The data table obtained by combining the target attribute corresponding to the data to be stored and the data to be stored is stored in the data warehouse. The target attribute can uniquely identify the data to be stored.
[0013] In one practicable implementation, storing the integrity check code in a data warehouse includes:
[0014] The check code table obtained by combining the target attributes and integrity check codes corresponding to the data to be stored is stored in the data warehouse.
[0015] In one possible implementation, storing the integrity check code in the blockchain includes:
[0016] The integrity check code is stored in the blockchain in a scheduled or asynchronous manner.
[0017] In one possible implementation, the integrity check code is stored in the blockchain in a timed or asynchronous manner, including:
[0018] Check whether the integrity check code is stored in the blockchain within a preset period;
[0019] When it is detected that the integrity check code is not stored in the blockchain, the integrity check code and the target attribute corresponding to the data to be stored are stored in the blockchain;
[0020] or
[0021] After obtaining the integrity check code, the integrity check code and the target attributes corresponding to the data to be stored are stored in the blockchain.
[0022] In an achievable implementation, after comparing the first check code with the second check code, the method further includes:
[0023] In the case where the first verification code is inconsistent with the second verification code, a third verification code is obtained by encrypting the data to be verified in the data table of the data warehouse in real time;
[0024] When the first check code is consistent with the third check code, the second check code and the comparison result in the check code table of the data warehouse are updated.
[0025] In one possible implementation, the method further includes:
[0026] Compare the integrity check code obtained by the data to be checked in the data table of the data warehouse with the second check code in the check code table of the data warehouse in a scheduled or real-time manner;
[0027] When the integrity check code obtained from the data to be checked is consistent with the second check code, the integrity of the data to be checked is determined.
[0028] In a second aspect, an embodiment of the present disclosure provides a data verification device, the device comprising:
[0029] The encryption module is used to encrypt the data to be stored based on a preset encryption algorithm to obtain an integrity check code;
[0030] The storage module is used to store the data to be stored in the data warehouse; and store the integrity check code in the blockchain and the data warehouse;
[0031] A reading module, used to read a first verification code stored in the blockchain and a second verification code stored in the data warehouse under the condition that a preset verification method is satisfied, wherein the first verification code and the second verification code correspond to the same data to be verified;
[0032] A comparison module, used for comparing the first check code with the second check code;
[0033] The recording module is used to record the comparison result and save it to the data warehouse when the first verification code is consistent with the second verification code.
[0034] In a third aspect, an embodiment of the present disclosure provides a data verification device, which includes a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement a data verification method as described in any one of the first aspects.
[0035] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, a data verification method as described in any one of the first aspects is implemented.
[0036] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which implements the data verification method of any one of the first aspects when the computer program is executed by a processor.
[0037] The embodiment of the present disclosure provides a data verification method, device, equipment, computer storage medium and computer program product. The method encrypts the data to be stored in the warehouse based on a preset encryption algorithm to obtain an integrity check code; stores the data to be stored in the warehouse in the data warehouse; stores the integrity check code in the blockchain and the data warehouse; under the condition of satisfying the preset verification method, reads the first check code stored in the blockchain and the second check code stored in the data warehouse, and compares the first check code with the second check code; when the first check code is consistent with the second check code, records the comparison result and saves it to the data warehouse. It can be seen that after obtaining the integrity check code, the present disclosure stores the integrity check code in the blockchain and the data warehouse respectively, which can reduce the probability of the integrity check code being tampered with. And according to the preset verification method, the integrity check codes of the blockchain and the data warehouse are compared, and it is determined whether the integrity check code has been tampered with according to the comparison result, thereby improving the security of the integrity check code. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the following is a brief introduction to the drawings required for use in the embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0039] Figure 1 It is a flowchart of a data verification method provided by an embodiment of the present disclosure;
[0040] Figure 2 It is a flow chart of storing the data to be stored and the integrity check code in the data warehouse provided by the embodiment of the present disclosure;
[0041] Figure 3 It is a schematic diagram of a process of storing an integrity check code to a blockchain in a timely or asynchronous manner, provided by an embodiment of the present disclosure;
[0042] Figure 4 It is a schematic diagram of a process of regularly storing an integrity check code to a blockchain provided by an embodiment of the present disclosure;
[0043] Figure 5 It is a schematic diagram of a process of asynchronously storing an integrity check code to a blockchain provided by an embodiment of the present disclosure;
[0044] Figure 6 It is a flow chart of a method for comparing integrity check codes generated by using the data to be checked in a data table provided by an embodiment of the present disclosure;
[0045] Figure 7 It is a schematic diagram of a process of periodically comparing the integrity check code generated by the data to be checked with the integrity check code in the check code table provided by an embodiment of the present disclosure;
[0046] Figure 8 It is a flow chart of a method for comparing the integrity check code generated by the data to be checked and the integrity check code in the check code table in real time provided by an embodiment of the present disclosure;
[0047] Fig. 9 is a structural schematic diagram of a data verification device provided by an embodiment of the present disclosure;
[0048] Fig.10 It is a structural schematic diagram of a data verification device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0049] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present invention, rather than to limit the present invention. For those skilled in the art, the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention.
[0050] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0051] It should be noted that the acquisition, storage, use and processing of data in the embodiments of the present application are in compliance with the relevant provisions of national laws and regulations.
[0052] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0053] Before describing the technical solutions provided by the embodiments of the present disclosure, in order to facilitate understanding of the embodiments of the present disclosure, the present disclosure specifically describes the problems existing in the related technologies:
[0054] In recent years, with the rapid development of big data technology, more and more fields have begun to use big data technology to store data, provide data services and manage related report data through big data technology. In related technologies, the integrity of the incoming data is verified through the integrity check code field in the data table.
[0055] However, there may be a phenomenon that someone who has obtained database permissions maliciously tampered with the integrity check code in the database table, causing the integrity check code in the data table to be damaged, reducing the security of the integrity check code. In addition, since the subsequent integrity check of the data in the data table using the complete new check code fails, the reliability of the data integrity check is reduced.
[0056] In view of the above research findings of the inventors, the embodiments of the present disclosure provide a data verification method, apparatus, device, computer storage medium and computer program product, which can solve the technical problems existing in the related technologies.
[0057] The following is an introduction to the data verification method provided by the embodiment of the present disclosure.
[0058] Figure 1 FIG. 1 is a flow chart of a data verification method provided by an embodiment of the present disclosure. Figure 1 , the method includes steps S110-S150.
[0059] S110: Based on a preset encryption algorithm, the data to be stored is encrypted to obtain an integrity check code.
[0060] In one embodiment, an encryption tool is used to encrypt the data content string in the data to be stored based on a preset encryption algorithm to obtain an integrity check code.
[0061] The integrity check code is used to check the integrity of the data to be stored. The preset encryption algorithm is not fixed and can be SM3 algorithm, SHA-256 algorithm or other algorithms.
[0062] S120: Store the data to be stored in the data warehouse; store the integrity check code in the blockchain and the data warehouse.
[0063] After obtaining the integrity check code, the data to be stored is stored in the data warehouse. The integrity check code is also stored in the blockchain and the data warehouse.
[0064] In one example, the integrity check code can be stored in the blockchain and the data warehouse according to a preset storage method. The step of storing the integrity check code in the blockchain and the data warehouse using the preset storage method includes: detecting whether the integrity check code is successfully stored in the data warehouse. After detecting that the integrity check code is successfully stored in the data warehouse, the integrity check code is stored in the blockchain.
[0065] In one example, the data warehouse may be a Hadoop data warehouse.
[0066] S130: Under the condition that a preset verification method is met, read the first verification code stored in the blockchain and the second verification code stored in the data warehouse.
[0067] Under the condition that a preset verification method is met, the first verification code stored in the blockchain is read and the second verification code in the data warehouse is read.
[0068] The first check code and the second check code correspond to the same data to be checked, that is, the first check code and the second check code are used to check the integrity of the same batch of data.
[0069] S140: Compare the first check code with the second check code.
[0070] After obtaining the first check code and the second check code, the consistency of the first check code and the second check code is compared.
[0071] S150: When the first verification code is consistent with the second verification code, the comparison result is recorded and saved in the data warehouse.
[0072] If the data information of the first verification code and the second verification code is completely consistent, the comparison result is recorded and saved in the data warehouse.
[0073] After obtaining the integrity check code, the disclosed embodiment stores the integrity check code in the blockchain and the data warehouse respectively, which can reduce the risk of the integrity check code being tampered with. And according to the preset verification method, the integrity check code of the blockchain and the data warehouse are compared, and it is determined whether the integrity check code has been tampered with according to the comparison result, thereby improving the security of the integrity check code.
[0074] In one embodiment, storing the data to be stored in the data warehouse may include step S121.
[0075] S121: storing a data table obtained by combining the target attribute corresponding to the data to be stored and the data to be stored in the data warehouse.
[0076] After the target attribute corresponding to the data to be stored is confirmed by using a preset confirmation method, the target attribute and the data to be stored are combined to obtain a data table and stored in the data warehouse.
[0077] Among them, the target attribute can uniquely identify the data to be stored.
[0078] In one example, the target attribute includes a primary key. For example, students in a class can be uniquely identified by their student ID, so it can be determined that the student ID is the primary key.
[0079] The disclosed embodiment combines the target attributes of the data to be stored and the data tables obtained by combining the data to be stored into a data warehouse, so that the data to be stored and the integrity check code are stored in different tables, reducing the probability that the data to be stored and the integrity check code are tampered with at the same time.
[0080] In one embodiment, storing the integrity check code in a data warehouse may include step S122.
[0081] S122: storing a check code table obtained by combining the target attribute and integrity check code corresponding to the data to be stored in the data warehouse.
[0082] After the target attribute corresponding to the data to be stored is confirmed by using the preset confirmation method, the target attribute and the integrity check code are combined to obtain a check code table and stored in the data warehouse.
[0083] The disclosed embodiment combines the check code table obtained by combining the target attributes of the data to be stored and the integrity check code into the data warehouse, so that the data to be stored and the integrity check code are stored in different tables, reducing the probability that the data to be stored and the integrity check code are tampered with at the same time.
[0084] In one embodiment, the steps of storing the data to be stored and the integrity check code in the data warehouse are as follows: Figure 2 As shown, in S201, the primary key and data content of each data in the data to be stored are read. In S202, an encryption algorithm is used to generate an integrity check code corresponding to the data content. In S203, the primary key and the corresponding data content are saved in the data table to be loaded file. In S204, the primary key and the integrity check code are saved in the check code table to be loaded file. In S205, the data table is loaded in batches so that the data table is stored in the data warehouse 200. In S206, it is determined whether the data table is loaded successfully. If the data table is not loaded successfully, S207 is executed to reprocess the business data processing of the data to be stored. If the data table is loaded successfully, S208 is executed to batch load the check code table so that the check code table is stored in the data warehouse 200. In S209, it is determined whether the check code table is loaded successfully. If the check code table is not loaded successfully, S207 is executed to reprocess the business data processing of the data to be stored. If the verification code table is loaded successfully, S210 is executed to store the verification code table in the blockchain.
[0085] In one embodiment, storing the integrity check code in the blockchain may include step S310.
[0086] S310: The integrity check code is stored in the blockchain in a scheduled or asynchronous manner.
[0087] After obtaining the integrity check code, the terminal can store the integrity check code to the blockchain in a scheduled or asynchronous manner according to the configuration file.
[0088] The disclosed embodiment stores the integrity check code in the blockchain in a timed or asynchronous manner, which can improve the flexibility of the blockchain in storing the integrity check code.
[0089] In one embodiment, Figure 3 As shown, storing the integrity check code in the blockchain in a timed or asynchronous manner may include steps S311-S313.
[0090] S311: Check whether the integrity check code is stored in the blockchain within a preset period.
[0091] The terminal detects whether the integrity check code is successfully stored in the blockchain within a preset period based on the parameter information in the configuration file.
[0092] S312: When it is detected that the integrity check code is not stored in the blockchain, the integrity check code and the target attribute corresponding to the data to be stored are stored in the blockchain.
[0093] If it is detected that the integrity check code is not successfully stored in the blockchain, the integrity check code and the target attribute corresponding to the data to be stored will be stored in the blockchain.
[0094] S313: After obtaining the integrity check code, the integrity check code and the target attributes corresponding to the data to be stored are stored in the blockchain.
[0095] After the data to be stored is encrypted to obtain the integrity check code, the integrity check code and the target attributes corresponding to the data to be stored are stored in the blockchain.
[0096] The disclosed embodiment stores the integrity check code in the blockchain in a timed or asynchronous manner, which can improve the security of the integrity check code on the blockchain.
[0097] In one embodiment, the steps of storing the integrity check code to the blockchain in a timed manner are as follows: Figure 4 As shown, in S401, a scheduled chain operation is initiated according to the configuration file, and it is found that the integrity check code is not stored in the blockchain within the preset period. In S402, the integrity check code and the target attribute corresponding to the data to be stored are encapsulated. In S403, the encapsulated integrity check code and the target attribute corresponding to the data to be stored are pushed to the blockchain, and the chain receipt returned by the blockchain is obtained. In S404, the chain receipt and the chain time are stored in the check code table in the data warehouse.
[0098] In one embodiment, the steps of storing the integrity check code to the blockchain in an asynchronous manner are as follows: Figure 5As shown, in S405, after the integrity check code is detected to be generated, an asynchronous on-chain operation is initiated. In S402, the integrity check code and the target attribute corresponding to the data to be stored are encapsulated. In S403, the encapsulated integrity check code and the target attribute corresponding to the data to be stored are pushed to the blockchain, and the on-chain receipt returned by the blockchain is obtained. In S404, the on-chain receipt and the on-chain time are stored in the check code table in the data warehouse.
[0099] In one embodiment, after comparing the first verification code with the second verification code, the data verification method further includes step S150 and step S160.
[0100] S150: When the first verification code is inconsistent with the second verification code, a third verification code is obtained by encrypting in real time the data to be verified in the data table of the data warehouse.
[0101] If the comparison results of the first verification code and the second verification code are inconsistent, an encryption algorithm is used to perform real-time encryption calculation on the data to be verified in the data table in the data warehouse to obtain a third verification code.
[0102] S160: When the first check code is consistent with the third check code, the second check code and the comparison result in the check code table of the data warehouse are updated.
[0103] Compare the data consistency of the first check code and the third check code. If the first check code and the third check code are inconsistent, use the third check code to update the second check code and the comparison result in the data table in the data warehouse.
[0104] In the case where the integrity check code in the blockchain is inconsistent with the integrity check code in the data warehouse, the embodiment of the present disclosure generates an integrity check code based on the data to be checked in the data warehouse and compares and updates the integrity check code in the blockchain, which can reduce the probability of the integrity check code in the data warehouse being tampered with and improve the security of the integrity check code in the data warehouse.
[0105] In one embodiment, the steps of comparing the integrity check code generated by the data to be checked in the data table are as follows: Figure 6As shown, in S501, the data about the integrity check code detection interval configuration in the configuration file is read. In S502, the data that the interval between the current date and the integrity check code verification date is greater than the configured interval is queried. In S503, according to the on-chain receipt of the data to be verified, the integrity check code stored in the blockchain is obtained. In S504, the integrity check code on the blockchain is compared with the integrity check code in the data warehouse. If the integrity check code on the blockchain is consistent with the integrity check code in the data warehouse, S505 is executed to update the integrity check code verification date and the check code verification result in the check code table of the data warehouse.
[0106] If the integrity check code on the blockchain is inconsistent with the integrity check code in the data warehouse, S506 is executed to query the data to be checked through the target attribute, and the data to be checked is encrypted based on the encryption algorithm to obtain a real-time integrity check code. In S507, the real-time integrity check code in the data warehouse is compared with the integrity check code in the blockchain. If the real-time integrity check code in the data warehouse is consistent with the integrity check code in the blockchain, S508 is executed to update the integrity check code verification date and the check code verification result in the check code table of the data warehouse. If the real-time integrity check code in the data warehouse is inconsistent with the integrity check code in the blockchain, S509 is executed to update the integrity check code, integrity check code verification date and check code verification result in the check code table of the data warehouse.
[0107] In one embodiment, the data verification method further includes step S170 and step S180.
[0108] S170: Compare the integrity check code obtained by the data to be checked in the data table of the data warehouse with the second check code in the check code table of the data warehouse in a scheduled or real-time manner.
[0109] According to the parameter information in the configuration file, the terminal compares the integrity check code obtained from the data to be checked in the data table of the data warehouse with the second check code in the check code table of the data warehouse in a timing or real-time manner.
[0110] S180: When the integrity check code obtained from the data to be checked is consistent with the second check code, determine the integrity of the data to be checked.
[0111] If it is detected that the integrity check code obtained from the data to be checked in the data table of the data warehouse is consistent with the second check code in the check code table of the data warehouse, the data to be checked is considered to be complete.
[0112] The disclosed embodiment compares the integrity check code generated by the data to be checked with the integrity check code in the check code table of the data warehouse periodically or in real time, and checks the data to be checked when the integrity check codes are consistent, thereby improving the integrity of the integrity check code in the check code table of the data warehouse, thereby improving the accuracy of checking the data to be checked using the integrity check code in the check code table.
[0113] In one embodiment, the steps of comparing the integrity check code generated by the data to be checked with the integrity check code in the check code table in a timed manner are as follows: Figure 7 As shown, in S601, the data about the data integrity check period in the configuration file is read, and S602 is executed based on the data to determine whether to perform a full check configuration. If a full check is required, S603 is executed to traverse the data in the check code table with a normal check code check result for check. If a full check is not required, S604 is executed to query the data with a normal check code check result and the interval between the current date and the data check date is greater than the configured interval.
[0114] In S605, the data to be verified in the data table is queried according to the target attribute. In S606, the integrity check code of the data to be verified is generated based on the encryption algorithm and compared with the integrity check code in the check code table. If the comparison result is consistent, the data verification result marked as normal is added to the data integrity verification result record table in S607. In S608, the data verification date is added to the check code table. If the comparison result is inconsistent, the data verification result marked as abnormal is added to the data integrity verification result record table in S609. In S608, the data verification date is added to the check code table.
[0115] In another embodiment, the steps of comparing the integrity check code generated by the data to be checked with the integrity check code in the check code table in real time are as follows: Figure 8 As shown, in S701, the data to be verified and the integrity check code in the check code table corresponding to the target attribute are queried according to the real-time instruction. In S702, the integrity check code of the data to be verified is generated based on the encryption algorithm and compared with the integrity check code in the check code table. If the comparison result is consistent, in S703, the data verification result is recorded as abnormal and the business data and data integrity verification result are encapsulated. In S705, the business data and data integrity verification result are returned to the user end. In S706, the verification results are asynchronously pushed into the warehouse. In S707, the verification results are added to the data integrity verification result record table. In S708, the data verification date is added to the check code table.
[0116] If the comparison result is inconsistent, in S704, record the data verification result as normal and encapsulate the business data and data integrity verification result. In S705, return the business data and data integrity verification result to the user. In S706, push the verification result into the library asynchronously. In S707, add the verification result to the data integrity verification result record table. In S708, add the data verification date to the verification code table.
[0117] like Fig. 9 As shown, the embodiment of the present disclosure further provides a data verification device 800, and the data verification device 800 includes:
[0118] The encryption module 801 is used to encrypt the data to be stored based on a preset encryption algorithm to obtain an integrity check code;
[0119] Storage module 802, used to store the data to be stored in the data warehouse; store the integrity check code in the blockchain and the data warehouse;
[0120] A reading module 803 is used to read a first verification code stored in the blockchain and a second verification code stored in the data warehouse under the condition that a preset verification method is satisfied, where the first verification code and the second verification code correspond to the same data to be verified;
[0121] A comparison module 804, configured to compare the first check code with the second check code;
[0122] The recording module 805 is used to record the comparison result and save it to the data warehouse when the first verification code is consistent with the second verification code.
[0123] In some embodiments, the storage module 802 is specifically configured to:
[0124] The data table obtained by combining the target attribute corresponding to the data to be stored and the data to be stored is stored in the data warehouse. The target attribute can uniquely identify the data to be stored.
[0125] In some embodiments, the storage module 802 is specifically configured to:
[0126] The check code table obtained by combining the target attributes and integrity check codes corresponding to the data to be stored is stored in the data warehouse.
[0127] In some embodiments, the storage module 802 is specifically configured to:
[0128] The integrity check code is stored in the blockchain in a scheduled or asynchronous manner.
[0129] In some embodiments, the data verification device includes a detection module, and the detection module is used to detect whether the integrity verification code is stored in the blockchain within a preset period;
[0130] When it is detected that the integrity check code is not stored in the blockchain, the integrity check code and the target attribute corresponding to the data to be stored are stored in the blockchain;
[0131] Or after obtaining the integrity check code, the integrity check code and the target attribute corresponding to the data to be stored are stored in the blockchain.
[0132] In some embodiments, the encryption module 801 is specifically used to:
[0133] In the case where the first verification code is inconsistent with the second verification code, a third verification code is obtained by encrypting the data to be verified in the data table of the data warehouse in real time;
[0134] When the first check code is consistent with the third check code, the second check code and the comparison result in the check code table of the data warehouse are updated.
[0135] In some embodiments, the comparison module 804 is specifically configured to:
[0136] Compare the integrity check code obtained by the data to be checked in the data table of the data warehouse with the second check code in the check code table of the data warehouse in a scheduled or real-time manner;
[0137] When the integrity check code obtained from the data to be checked is consistent with the second check code, the integrity of the data to be checked is determined.
[0138] Fig. 9 Each module / unit in the device shown has the function of realizing Figure 1 or Figure 3 The functions of each step executed by the application system in the present invention can achieve the corresponding technical effects. For the sake of brevity, they will not be repeated here.
[0139] Fig.10 A schematic diagram of the data verification hardware structure provided by an embodiment of the present disclosure is shown.
[0140] The data verification device may include a processor 901 and a memory 902 storing computer program instructions.
[0141] Specifically, the processor 901 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0142] The memory 902 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 902 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 902 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 902 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 902 is a non-volatile solid-state memory.
[0143] The memory 902 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of the present disclosure.
[0144] The processor 901 implements any one of the data verification methods in the above embodiments by reading and executing computer program instructions stored in the memory 902 .
[0145] In one example, the data verification device may further include a communication interface 903 and a bus 904. Fig.10 As shown, the processor 901, the memory 902, and the communication interface 903 are connected via a bus 904 and communicate with each other.
[0146] The communication interface 903 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0147] Bus 904 includes hardware, software or both, and couples the components of online data flow billing equipment to each other. For example, but not limitation, the bus may include Accelerated Graphics Port (AGP) or other graphics bus, Enhanced Industry Standard Architecture (EISA) bus, Front Side Bus (FSB), Hyper Transport (HT) interconnection, Industry Standard Architecture (ISA) bus, InfiniBand interconnection, Low Pin Count (LPC) bus, Memory bus, Micro Channel Architecture (MCA) bus, Peripheral Component Interconnect (PCI) bus, PCI-Express (PCI-X) bus, Serial Advanced Technology Attachment (SATA) bus, Video Electronics Standards Association Local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 904 may include one or more buses. Although the embodiment of the present invention describes and shows a specific bus, the present invention considers any suitable bus or interconnection. In addition, in conjunction with the data verification method in the above embodiment, the present application embodiment also provides a computer storage medium to achieve. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the data verification methods in the above embodiments is implemented.
[0148] An embodiment of the present application also provides a computer program product, including a computer program, which implements any one of the data verification methods in the above embodiments when the computer program is executed by a processor.
[0149] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0150] The functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), appropriate firmware, plug-in, function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or communication link by a data signal carried in a carrier. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (Read-Only Memory, ROM), flash memory, erasable read-only memory (Erasable ReadOnly Memory, EROM), floppy disks, compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical discs, hard disks, optical fiber media, radio frequency (Radio Frequency, RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0151] It should also be noted that the exemplary embodiments mentioned in the present invention describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
[0152] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0153] The above is only a specific implementation of the present invention. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system, module and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.
Claims
1. A data verification method, characterized in that: include: Based on the preset encryption algorithm, the data to be stored is encrypted to obtain the integrity check code; storing the data to be stored in the data warehouse; Storing the integrity check code in the blockchain and the data warehouse; Under the condition that a preset verification method is satisfied, a first verification code stored in the blockchain and a second verification code stored in the data warehouse are read, where the first verification code and the second verification code correspond to the same data to be verified; Comparing the first verification code with the second verification code; When the first verification code is consistent with the second verification code, the comparison result is recorded and saved in the data warehouse.
2. The method according to claim 1, characterized in that The storing the data to be stored in the data warehouse includes: A data table obtained by combining a target attribute corresponding to the data to be stored in the warehouse and the data to be stored in the warehouse is stored in the data warehouse, and the target attribute can uniquely identify the data to be stored in the warehouse.
3. The method according to claim 1, characterized in that The storing the integrity check code in the data warehouse comprises: A check code table obtained by combining the target attribute corresponding to the data to be stored and the integrity check code is stored in the data warehouse.
4. The method according to claim 1, characterized in that: The storing the integrity check code to the blockchain includes: The integrity check code is stored in the blockchain in a scheduled or asynchronous manner.
5. The method according to claim 4, characterized in that The storing the integrity check code to the blockchain in a timed or asynchronous manner includes: Detecting whether the integrity check code is stored in the blockchain within a preset period; When it is detected that the integrity check code is not stored in the blockchain, the integrity check code and the target attribute corresponding to the data to be stored are stored in the blockchain; Or after obtaining the integrity check code, the integrity check code and the target attribute corresponding to the data to be stored are stored in the blockchain.
6. The method according to any one of claims 1 to 3, characterized in that: After comparing the first check code with the second check code, the method further includes: In the case where the first verification code is inconsistent with the second verification code, a third verification code is obtained by encrypting in real time the data to be verified in the data table of the data warehouse; When the first check code is consistent with the third check code, the second check code and the comparison result in the check code table of the data warehouse are updated.
7. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Comparing the integrity check code obtained by the data to be checked in the data table of the data warehouse with the second check code in the check code table of the data warehouse in a scheduled or real-time manner; When the integrity check code obtained for the data to be checked is consistent with the second check code, the integrity of the data to be checked is determined.
8. A data verification device, characterized in that: The device comprises: An encryption module, which is used to encrypt the data to be stored based on a preset encryption algorithm to obtain an integrity check code; A storage module, the storage module is used to store the data to be stored in the data warehouse; store the integrity check code in the blockchain and the data warehouse; A reading module, the reading module is used to read a first verification code stored in the blockchain and a second verification code stored in the data warehouse under the condition that a preset verification method is satisfied, wherein the first verification code and the second verification code correspond to the same data to be verified; A comparison module, wherein the comparison module is used to compare the first check code with the second check code; A recording module, wherein the recording module is used to record a comparison result and save it to the data warehouse when the first verification code is consistent with the second verification code.
9. A data verification device, characterized in that: The device comprises: a processor, and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the data verification method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the data verification method according to any one of claims 1 to 7 is implemented.
11. A computer program product, characterized in that It includes a computer program, which, when executed by a processor, implements the data verification method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Cloud distribution network cache content verification method and device, network, storage medium and computing device
CN108667827A
Data correctness verification method and device based on blockchain evidence storage, and medium
CN112671780A
Bidding and tendering data processing method and device, computer equipment and storage medium
CN114238218A
Equipment coding consistency verification method and system
CN117708101A
Managing a database management system using a blockchain database
US20180227119A1
