Data verification method and system
By introducing a second data verification node into the outsourcing database system, the two-factor verification of the target data is achieved, and the problem of verification delay and low throughput in the dynamic data scenario of the outsourcing database is solved, improving the security and efficiency of data use.
Patent Information
- Application Number
- CN202310577733.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-19
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2043-05-19
AI Technical Summary
In the outsourcing database scenario, when the user side verifies the data returned by the outsourcing database, especially in the dynamic data scenario, the problems of delay and throughput reduction caused by the prior art.
The second data verification node is introduced, and a trusted interaction framework between the first data verification node and the data providing node is realized, and the first data verification node performs necessary verification, and the second data verification node performs asynchronous verification, reducing the latency of the user side and ensuring high throughput.
Through dual data verification, we ensure the security of the data returned by the outsourcing database, reduce the latency of the user side, and improve the experience and throughput of data usage.
Smart Images

Figure CN116756782B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and in particular to a data verification method. Background Art
[0002] An outsourced database (ODB) refers to a situation where the data owner delegates all database management rights to a third party, typically referred to as a database service provider. The database service provider's digital signal processor (DSP) handles the storage, maintenance, and management of the database. With the rapid development of computer technology and internet applications, the volume of data and the number of users are rapidly increasing. Consequently, more and more businesses and organizations are choosing to delegate database management to database service providers.
[0003] Since enterprises or institutions entrust database management rights to database service providers, they are no longer able to manage their own data. Therefore, there is a crisis of trust in the security of the data returned by the database service provider. Therefore, how to verify the security of the data returned by the database service provider to ensure the security of the data used by enterprises or institutions is a technical problem that needs to be solved urgently. Summary of the Invention
[0004] In view of this, the embodiments of this specification provide two data verification methods. One or more embodiments of this specification also involve two data verification devices, a data verification system, a computing device, a computer-readable storage medium, and a computer program to address technical deficiencies in the prior art.
[0005] According to a first aspect of an embodiment of this specification, a data verification method is provided, which is applied to a second data verification node, including:
[0006] receiving first data verification information sent by a first data verification node, wherein the first data verification information is sent by the first data verification node to the second data verification node when the first data verification node successfully verifies target data returned by the data providing node, and the target data is returned by the data providing node in response to a data processing request sent by the first data verification node;
[0007] A data verification strategy is determined according to the data processing request, and data verification is performed on the target data according to the data verification strategy and the first data verification information.
[0008] According to a second aspect of an embodiment of this specification, a data verification device is provided, applied to a second data verification node, including:
[0009] a receiving module configured to receive first data verification information sent by a first data verification node, wherein the first data verification information is sent by the first data verification node to the second data verification node when the first data verification node successfully verifies the target data returned by the data providing node, and the target is returned by the data providing node in response to the data processing request sent by the first data verification node;
[0010] The first verification module is configured to determine a data verification strategy according to the data processing request, and perform data verification on the target data according to the data verification strategy and the first data verification information.
[0011] According to a third aspect of an embodiment of this specification, a data verification method is provided, which is applied to a first data verification node and includes:
[0012] Sending a data processing request to a data providing node, and receiving target data and fourth data verification information returned by the data providing node according to the data processing request;
[0013] performing data verification on the target data according to the fourth data verification information;
[0014] In the case that the target data is verified successfully, first data verification information is sent to the second data verification node, so that the second data verification node performs data verification on the target data according to the first data verification information.
[0015] According to a fourth aspect of an embodiment of this specification, a data verification device is provided, applied to a first data verification node, including:
[0016] A first sending module is configured to send a data processing request to a data providing node, and receive target data and fourth data verification information returned by the data providing node according to the data processing request;
[0017] a second verification module, configured to perform data verification on the target data according to the fourth data verification information;
[0018] The second sending module is configured to send first data verification information to the second data verification node when the target data is verified successfully, so that the second data verification node performs data verification on the target data according to the first data verification information.
[0019] According to a fifth aspect of the embodiments of this specification, a data verification system is provided, including a first data verification node, a second data verification node, and a data providing node, wherein:
[0020] The first data verification node is used to send a data processing request to the data providing node;
[0021] The data providing node is configured to process the data processing request, and send the target data and fourth data verification information obtained by processing the data processing request to the first data verification node;
[0022] The first data verification node is configured to perform data verification on the target data according to the fourth data verification information, obtain first data verification information, and send the first data verification information to the second data verification node;
[0023] The second data verification node is used to receive the first data verification information sent by the first data verification node, determine a data verification strategy according to the data processing request, and perform data verification on the target data according to the data verification strategy and the first data verification information.
[0024] According to a sixth aspect of the embodiments of this specification, there is provided a computing device, including:
[0025] memory and processor;
[0026] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the above-mentioned data verification method are implemented.
[0027] According to a seventh aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned data verification method are implemented.
[0028] According to an eighth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned data verification method.
[0029] A data verification method provided in one embodiment of the present specification is applied to a second data verification node, and includes receiving first data verification information sent by a first data verification node, wherein the first data verification information is sent by the first data verification node to the second data verification node when the target data returned by the data providing node is verified to be successful, and the target data is returned by the data providing node in response to a data processing request sent by the first data verification node; a data verification strategy is determined according to the data processing request, and data verification is performed on the target data according to the data verification strategy and the first data verification information.
[0030] Specifically, the data verification method first uses a first data verification node to verify the target data returned by the data providing node according to the data processing request; if the data verification passes, the second data verification node is used in combination with the data verification strategy determined according to the data processing request to verify the target data again. By performing double data verification on the target data through the first data verification node and the second data verification node, the security of the target data returned by the data providing node can be guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 This is a scenario diagram of a data verification method provided by an embodiment of this specification;
[0032] Figure 2 is a flow chart of a data verification method applied to a first data verification node provided by one embodiment of this specification;
[0033] Figure 3 is a flow chart of a data verification method applied to a second data verification node provided by one embodiment of this specification;
[0034] Figure 4 is a schematic diagram of target data in a data verification method provided by an embodiment of this specification;
[0035] Figure 5 A data update tree diagram in a data verification method provided according to an embodiment of this specification is shown;
[0036] Figure 6 Another data update tree diagram in a data verification method provided according to an embodiment of this specification is shown;
[0037] Figure 7 This is a schematic diagram of a scenario of an update data verification process of a data verification method provided by an embodiment of this specification;
[0038] Figure 8 This is a schematic diagram of a query data verification process of a data verification method provided by an embodiment of this specification;
[0039] Figure 9 is a flow chart of a data verification system provided by one embodiment of this specification;
[0040] Figure 10 This is a schematic structural diagram of a first data verification device provided by an embodiment of this specification;
[0041] Figure 11 This is a schematic structural diagram of a second data verification device provided by an embodiment of this specification;
[0042] Figure 12 This is a structural block diagram of a computing device provided by one embodiment of this specification. DETAILED DESCRIPTION
[0043] The following description sets forth many specific details to facilitate a thorough understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0044] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0045] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0046] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0047] First, the terms involved in one or more embodiments of this specification are explained.
[0048] ODB (Outsourced Databases): enables data owners to entrust database management to outsourced database service providers to provide various database services to different users.
[0049] ADS (authenticated data structure): refers to a data structure that can provide verification, among which Merkle Tree (MT) is widely used.
[0050] MT (Merkle Tree): Used to record the current state of database tables. Generally speaking, it's a method for hashing a large number of data units. Each leaf node corresponds to the hash of a data unit. Non-leaf nodes are aggregated by hashing their child nodes to calculate the node's hash value. This process is repeated until the root node's hash value is calculated.
[0051] State-MT: Used to record the initial backup data status of the database.
[0052] SQL-MT: Used to record user data update operations.
[0053] Hash: Hash, commonly translated as "hash", is a function that converts an input of any length into an output of a fixed length through a hash algorithm. This output is the hash value. Simply put, it is a function that compresses a message of any length into a message digest of a fixed length.
[0054] RootHash: The hash value of the root node, which can represent the corresponding overall data integrity characteristics.
[0055] W (Write, update): used to indicate the user's data update request.
[0056] W-correctness: Correctness is used to indicate that the data has been updated and that the updated data meets the data correctness requirements.
[0057] W-completeness: Completeness is used to indicate that in a scenario where multiple data are updated, there is no remaining data that should be updated, and all data that should be updated is updated completely, thus satisfying data integrity.
[0058] W-excessiveness: Excessive update is used to indicate that the unupdated data other than the target data has not been tampered with, that is, the data excessive update verification is satisfied.
[0059] R (Read, Query): Used to indicate the user's data query request.
[0060] R-correctness: Correctness, used to indicate that the query results meet the data correctness.
[0061] R-completeness: Completeness, used to indicate that the query results meet data integrity.
[0062] R-freshness: freshness. The query results meet the data timeliness, which is used to indicate that the target data of the query is the latest version and not replaced by a historical version.
[0063] Verify-log from user: indicates the verification data record obtained from the user.
[0064] Verify-log from db: Verify data records obtained from the database.
[0065] Proofpath: Proof path, used to represent the path data of the target data and the necessary related data required for verification.
[0066] With the rise of outsourced databases, more and more data owners, such as enterprises or institutions, are choosing to delegate their database management rights to outsourced database service providers, thereby providing them with various database services. Based on the trust database owners place in outsourced databases, the scope of their database management rights has expanded, from the basic hardware and software core of data management to core developers and management and operation and maintenance personnel. This has also led to a greater scope of trust in outsourced database service providers, necessitating verification of the correctness of the data returned by the server in response to data requests. For example, when a user sends a data query request to an outsourced database, data correctness verification involves: first, the database owner pre-calculates a trusted credential for the data and stores the data and the trusted credential in the outsourced database. Then, in response to the user's data query request, the outsourced database returns the data query result and a data query result certificate. Finally, the user verifies the correctness of the data query result based on the data query result certificate and the trusted credential of the queried data. However, this method is suitable for static data scenarios. When the data request sent by the user is in a dynamic data scenario and the data is frequently updated, the user must first ensure the trustworthiness of the updated data when the data is updated, and then the correctness of the query data can be trusted and verified. Therefore, in order to ensure the credibility of the received data, the database owner usually needs to verify the trustworthiness of the data returned by each data request by replaying the database operation record. That is, the user end needs to store the data operation log in a local storage system of the user and record the initial state of the database. When data verification is required, an initialized database is obtained based on the initial state of the database. Further, verification operations are performed on the database in the order of the SQL (Structured Query Language) operation log until the verification time point of the target data is reached. Furthermore, by comparing the first state of the data with the second state of the outsourced database, it is determined whether the first state and the second state are consistent. If the first state and the second state are consistent, it means that the data verification has passed; otherwise, it means that the data in the outsourced database has been tampered with. Trusted verification of target data through the user end will cause delays in the user's use of data and reduce the throughput of data use, resulting in a reduced user data usage experience.
[0067] Based on this, the embodiments of this specification propose a data verification method that provides a trusted interaction framework for dynamic database scenarios. Specifically, by introducing a second data verification node between the first data verification node and the data provision node, trusted interaction among the first data verification node, the second data verification node, and the data provision node is achieved. Based on the second data verification node sharing the verification of the first data verification node, the first data verification node executes the necessary verification logic for the target data, and the remaining verification logic is asynchronously verified by the second data verification node, thereby reducing the delay when the user uses the data, ensuring high throughput of data use, and improving the user's data usage experience.
[0068] In this specification, two data verification methods are provided. This specification also involves two data verification devices, a data verification system, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0069] See also Figure 1 , Figure 1 A schematic diagram of a scenario of a data verification method provided according to an embodiment of this specification is shown.
[0070] Figure 1 It includes an outsourced database 102, a user terminal 104 and a monitoring component terminal 106, wherein the outsourced database 102 can be understood as a data providing node, which is used to manage the data entrusted by the user; the user terminal 104 can be understood as a first data verification node, which is used to store data through the outsourced database, read the data in the outsourced database, and perform initial verification on the data returned by the outsourced database; the monitoring component terminal 106 can be understood as a second data verification node, which is used to re-verify the data verified by the user terminal 104.
[0071] The monitoring component end 106 may be deployed independently from the outsourced database 102 and the user end 104 , or may be deployed on the same side as the user end 104 , or may be deployed on the same side as the outsourced database 102 . This specification does not impose any limitation on this.
[0072] In the embodiments of this specification, the data verification method is described in detail by taking the independent deployment of the data providing node 102 , the first data verification node 104 , and the second data verification node 106 as an example.
[0073] First, the user terminal 104 sends a data processing request to the outsourced database 102. The outsourced database 102 processes the received data processing request and, after the data processing is completed, sends the target data obtained after processing the data processing request and the fourth data verification information to the user terminal 104. Then, the user terminal 104 verifies the target data according to the fourth data verification information obtained, obtains the first data verification information, and sends the first data verification information to the monitoring component terminal 106. Finally, the monitoring component terminal 106 verifies the target data according to the received first data verification information and the data verification strategy determined according to the data processing request.
[0074] In the embodiments of this specification, the user end is first used to verify the target data returned by the outsourced database based on the data processing request; if the data verification passes, the monitoring component end is used in combination with the data verification strategy determined based on the data processing request to verify the target data again. By performing double data verification on the target data by the user end and the monitoring component end, the security of the target data returned by the outsourced database can be guaranteed.
[0075] See also Figure 2 , Figure 2 This is a flowchart of a data verification method applied to a first data verification node provided by an embodiment of this specification, which specifically includes the following steps.
[0076] Step 202: Send a data processing request to a data providing node, and receive target data and fourth data verification information returned by the data providing node according to the data processing request.
[0077] Step 204: Perform data verification on the target data according to the fourth data verification information.
[0078] Step 206: When the target data is verified successfully, first data verification information is sent to a second data verification node, so that the second data verification node performs data verification on the target data according to the first data verification information.
[0079] Continuing with the above example, the first data verification node can be understood as the user end of the above embodiment; the second data verification node can be understood as the monitoring component end of the above embodiment; and the data providing node can be understood as the outsourced database of the above embodiment.
[0080] Among them, the data processing request can be understood as the data processing request sent by the first data verification node to the data providing node, that is, the data processing request sent by the user end to the outsourced database, including but not limited to data query request (ie R), data update request (ie W), etc.
[0081] The target data can be understood as the target data returned by the data providing node in response to the above data processing request, that is, the target data returned by the outsourced database in response to the data processing request sent by the user end, such as query data, update data, etc.
[0082] The first data verification information can be understood as data information related to the target data sent by the first data verification node to the second data verification node, that is, data information related to the target data sent by the user end to the monitoring component end, including but not limited to the root hash value, node hash value, proof path data, verification data, etc. related to the target data.
[0083] The fourth data verification information can be understood as data information related to the target data sent by the data providing node to the first data verification node, that is, data information related to the target data sent by the outsourced database to the user end, including but not limited to the root hash value corresponding to the target data, proof path data, verification data, etc.
[0084] During specific implementation, first, the first data verification node sends a data processing request to the data providing node. In response to the data providing node receiving the data processing request and after processing the data processing request, the obtained target data and fourth data verification information are sent to the first data verification node; then, the first data verification node performs necessary data verification on the target data based on the received fourth data verification information. After the necessary data verification is passed, the obtained first data verification information is sent to the second data verification node, so that the second data verification node performs data verification on the target data based on the first data verification information.
[0085] Taking the first data verification node as user terminal A, the second data verification node as monitoring component terminal B, and the data providing node as outsourced database C as an example, sending a data processing request to the data providing node, and receiving the target data and fourth data verification information returned by the data providing node according to the data processing request, can be understood as: user terminal A sends a data processing request to the outsourced database C, and receives the target data and fourth data verification information returned by the outsourced database C after processing the data processing request; performing data verification on the target data according to the fourth data verification information, can be understood as: user terminal A performs data verification on the target data according to the received fourth data verification information; if the target data is verified successfully, sending the first data verification information to the second data verification node, so that the second data verification node performs data verification on the target data according to the first data verification information, can be understood as: if the user terminal A performs data verification on the target data according to the fourth data verification information and the verification succeeds, sending the first data verification information generated by the verification to the monitoring component terminal B, so that the monitoring component terminal performs data verification on the target data according to the first data verification information.
[0086] In an embodiment of the present specification, the first data verification node sends a data processing request to the data providing node, and performs necessary logical verification on the target data based on the data verification information returned by the data providing node. If the necessary logical verification is passed, other verification information is sent to the second data verification node so that the second data verification node can perform other logical verification. The double data verification of the target data by the first data verification node and the second data verification node can ensure the security of the target data returned by the data providing node.
[0087] See also Figure 3 , Figure 3 This is a flowchart of a data verification method applied to a second data verification node provided by an embodiment of this specification, which specifically includes the following steps.
[0088] Step 302: Receive first data verification information sent by the first data verification node, wherein the first data verification information is sent by the first data verification node to the second data verification node when the target data returned by the data providing node is verified and passed, and the target data is returned by the data providing node in response to the data processing request sent by the first data verification node.
[0089] Step 304: Determine a data verification strategy according to the data processing request, and perform data verification on the target data according to the data verification strategy and the first data verification information.
[0090] Continuing with the above example, the first data verification node can be understood as the user end of the above embodiment; the second data verification node can be understood as the monitoring component end of the above embodiment; and the data providing node can be understood as the outsourced database of the above embodiment.
[0091] Among them, the data processing request, target data and first data verification information can be understood to be consistent with the data processing request, target data and first data verification information in the above-mentioned data verification method, and will not be elaborated in the embodiments of this specification.
[0092] A data validation strategy can be understood as the data validation method determined during the data validation process based on different data processing requests. In practice, different data processing requests will result in different data validation strategies. For example, if the data processing request is a data update request, the data validation strategy determined by that request is the data update strategy. Similarly, if the data processing request is a data query request, the data validation strategy determined by that request is the data query strategy.
[0093] In specific implementation, first, the second data verification node receives the first data verification information sent by the first data verification node, then determines the first data verification strategy based on the data processing request of the first data verification node, and finally, performs data verification on the target data through the determined data verification strategy and the received first data verification information.
[0094] Taking the first data verification node as user terminal A, the second data verification node as monitoring component terminal B, and the data providing node as outsourced database C as an example, receiving the first data verification information sent by the first data verification node can be understood as: the monitoring component terminal B receives the first data verification information sent by user terminal A, wherein the first data verification information is sent by user terminal A to the monitoring component terminal B when the target data returned by the outsourced database C is verified to be successful, and the target data is returned by the outsourced database C in response to the data processing request sent by user terminal A; determining the data verification strategy according to the data processing request, and performing data verification on the target data according to the data verification strategy and the first data verification information, can be understood as: user terminal A determines the data verification strategy according to the data processing request, and performs data verification on the target data according to the data verification strategy and the first data verification information.
[0095] In the embodiments of this specification, the target data returned by the data providing node is subjected to other logical verifications by the second data verification node in addition to the necessary logical verifications performed on the target data by the first data verification node. This can reduce the delay rate of user use of the target data and ensure high throughput of data use on the basis of the security of the target data returned by the data providing node.
[0096] In one or more embodiments of the present specification, the data processing request may include a data update request and a data query request. The following takes the data processing request being a data update request or a data query request as an example to explain in detail how to verify the target data according to the fourth data verification strategy, determine the data verification strategy according to the data processing request, and verify the target data according to the data verification strategy and the first data verification information.
[0097] In one or more embodiments of this specification, when the data processing request is a data update request, the specific implementation method of performing data verification on the target data according to the fourth data verification strategy is as follows:
[0098] In a case where the data processing request is a data update request, the fourth data verification information includes the data to be updated carried in the data processing request;
[0099] Accordingly, performing data verification on the target data according to the fourth data verification information includes:
[0100] The target data is verified for data correctness based on the target data and the data to be updated.
[0101] Continuing with the above example, the first data verification node can be understood as the user end of the above embodiment; the second data verification node can be understood as the monitoring component end of the above embodiment; and the data providing node can be understood as the outsourced database of the above embodiment.
[0102] Among them, the data processing request, target data and fourth data verification information can be understood to be consistent with the data processing request, target data and fourth data verification information in the above-mentioned data verification method, and will not be elaborated in the embodiments of this specification.
[0103] The data to be updated carried in the data processing request can be understood as the corresponding data information to be processed in the data processing request when the first data verification node sends a data processing request to the data providing node, that is, the corresponding data information to be processed in the data processing request when the user end sends a data processing request to the outsourced database.
[0104] In specific implementation, first, the first data verification node receives the target update data and the fourth data verification information returned by the data providing node, and then performs necessary logical verification on the returned target update data based on the fourth data verification information, that is, verifies the data correctness (i.e., W-correctness) of the target update data.
[0105] Take the case where the first data verification node is the user terminal A, the second data verification node is the monitoring component terminal B, and the data providing node is the outsourced database C as an example. Suppose that user terminal A sends a data update request "Update Person SETA age=18 WHERE job='teacher'. Determine whether the returned results are all Age=18" to outsourced database B. Therefore, it can be seen that the data to be updated carried in the data processing request sent by user terminal A is the age of teachers, which is all 18. After receiving the data processing request sent by user terminal A, outsourced database B will return the updated age of teachers. Therefore, it can be seen that the target update data is the age of teachers returned by outsourced database B. When the user terminal wants to verify the correctness of the returned target update data, the data correctness of the target update data can be verified by determining whether the age of teachers returned by outsourced database B is all 18; when the age of teachers returned by outsourced database B is all 18, it is determined that the target update data meets the data correctness; when the age of teachers returned by outsourced database B is not all 18, it is determined that the target update data does not meet the data correctness.
[0106] In the embodiments of this specification, by verifying the correctness of the target update data through the first data verification node, the amount of data calculation by the first data verification node can be reduced, data redundancy can be reduced, and the user experience of data use can be improved.
[0107] In one or more embodiments of this specification, when the data processing request is a data update request, the first data verification node determines a data verification strategy based on the data processing request, and performs data verification on the target data based on the data verification strategy and the first data verification information, specifically in the following manner:
[0108] In the case where the data processing request is a data update request, a data verification strategy is determined according to the data processing request, and a specific implementation method of performing data verification on the target data according to the data verification strategy and the first data verification information is as follows:
[0109] The data processing request is a data update request;
[0110] Accordingly, determining a data verification strategy according to the data processing request, and performing data verification on the target data according to the data verification strategy and the first data verification information, includes:
[0111] Determining a first data verification strategy according to the data update request, and determining the first data verification information and the second data verification information received and sent by the data providing node according to the first data verification strategy;
[0112] The target data is verified according to the first data verification information and the second data verification information.
[0113] Continuing with the above example, the first data verification node can be understood as the user end of the above embodiment; the second data verification node can be understood as the monitoring component end of the above embodiment; and the data providing node can be understood as the outsourced database of the above embodiment.
[0114] Among them, the data processing request, target data, first data verification information and data verification strategy can be understood as being consistent with the data processing request, target data, first data verification information and data verification strategy in the above-mentioned data verification method, and will not be elaborated in the embodiments of this specification.
[0115] The first data verification strategy can be understood as an updated data verification method determined according to a data update request during the data verification process.
[0116] The second data verification information can be understood as data information related to the target data sent by the data providing node to the second data verification node, that is, data information related to the target data sent by the outsourced database to the monitoring component end, including but not limited to proof path data corresponding to the target data, root hash value, etc.
[0117] During specific implementation, first, the second data verification node determines the first data verification strategy based on the data update request, and then, based on the first data verification strategy, determines the first data verification information sent by the first data verification node and the second data verification information sent by the data providing node. Secondly, the target data is verified based on the obtained first data verification information and the second data verification information.
[0118] Continuing with the above example, when user terminal A passes the data correctness verification of the target update data, first data verification information is sent to monitoring component terminal C, i.e., data information that the target update data satisfies the data correctness and data information related to the target update data, i.e., information on whether the ages of teachers in the returned target data are all 18 and data information related to whether the ages of teachers are 18. Therefore, monitoring component terminal B first receives the first verification information sent by user terminal A, and then receives the second verification information sent by outsourced database B. Secondly, based on the data update request of user terminal A, monitoring component terminal B determines the first data verification strategy, and determines the first data verification information of the first verification information and the second data verification information of the second verification information based on the first data verification strategy. Finally, data verification is performed on the target data based on the received first data verification information and second data verification information.
[0119] More specifically, the first data verification information includes the node hash value and the first root hash value corresponding to the target data, and the second data verification information includes the proof path data and the second root hash value corresponding to the target data;
[0120] The first data verification information includes the node hash value and the first root hash value corresponding to the target data, and the second data verification information includes the proof path data and the second root hash value corresponding to the target data;
[0121] Accordingly, performing data verification on the target data according to the first data verification information and the second data verification information includes:
[0122] When it is determined that the first root hash value is consistent with the second root hash value, calculating a third root hash value according to the node hash value corresponding to the target data and the proof path data corresponding to the target data;
[0123] Perform data integrity verification on the target data according to the third root hash value.
[0124] More specifically, performing data integrity verification on the target data according to the third root hash value includes:
[0125] When it is determined that the third root hash value is consistent with the first root hash value or the second root hash value, it is determined that the target data satisfies data integrity verification.
[0126] Continuing with the above example, the first data verification node can be understood as the user end of the above embodiment; the second data verification node can be understood as the monitoring component end of the above embodiment; and the data providing node can be understood as the outsourced database of the above embodiment.
[0127] Among them, the target data, first data verification information, second data verification information and data verification strategy can be understood as being consistent with the target data, first data verification information, second data verification information and data verification strategy in the above-mentioned data verification method, and are not elaborated herein in the embodiments of this specification.
[0128] The first root hash value can be understood as the output length information of the root node of the target data sent by the first data verification node to the second data verification node, that is, the output length information of the root node of the target data sent by the user end to the monitoring component end.
[0129] The second root hash value can be understood as the output length information of the root node of the target data sent by the data providing node to the second data verification node, that is, the output length information of the root node of the target data sent by the outsourced database to the monitoring component end.
[0130] The third root hash value can be understood as the output length information of the root node of the target data calculated by the second data verification node based on the obtained first data verification information and the second data verification information, that is, the output length information of the root node of the target data calculated by the monitoring component end based on the obtained first data verification information and the second data verification information.
[0131] The proof path data can be understood as the storage path information of the target data in the initial update backup data of the data providing node, as well as the verification information related to the target data.
[0132] In a specific implementation, after determining the first data verification information and the second data verification information according to the first data verification strategy, the second data verification node first obtains the node hash value and the first root hash value corresponding to the target data in the first data verification information, as well as the proof path data and the second root hash value corresponding to the target data in the second data verification information, and then judges whether the obtained first root hash value and the second root hash value are consistent. If the first root hash value is consistent with the second root hash value, a third root hash value is calculated based on the obtained node hash value corresponding to the target data and the proof path data corresponding to the target data. Secondly, the third root hash value is compared with the first root hash value and / or The second root hash value is judged to be consistent. When the third root hash value is consistent with the first root hash value and / or the second root hash value, it is determined that the target data meets the data integrity (i.e., W-completeness) verification. It should be specifically explained that the third root hash value is calculated based on the obtained node hash value corresponding to the target data and the proof path data corresponding to the target data. It is obtained by bottom-up deduction through MerkleTree, that is, the verification process of MerkleTree, which deduces the hash value of the root node step by step from the hash value of the leaf node, and judges the correctness by comparing whether the calculated root node hash value is the same as the cached root node hash value.
[0133] For example, let's assume that the first data verification node is user terminal A, the second data verification node is monitoring component terminal B, and the data provision node is outsourced database C. Assume that user terminal A sends a data update request to outsourced database C, "Update table set age = 20, where name = bob." After outsourced database C processes the data update request and sends the target data and data verification information to user terminal A and monitoring component terminal B, user terminal A verifies the correctness of the target data returned by outsourced database B. After the verification passes, monitoring component terminal B needs to perform other data verifications on the target data returned by outsourced database B, namely data integrity verification and data over-update (W-excessiveness) verification. The following example illustrates data integrity verification by monitoring component terminal B.
[0134] Among them, the database entrusted by user A to outsourced database B can be Figure 4 The target data diagram is given as an example. Figure 4 , Figure 4 This is a schematic diagram of target data in a data verification method provided in one embodiment of this specification. Figure 4 As shown, Figure 4 The following example shows two databases (i.e., Database 1 and Database 2). Database 1 contains the initial database backup data, while Database 2 contains the updated database backup data. Database 1 has four data entries, corresponding to identity identification numbers (IDs) 1-4. ID 1 corresponds to the name Alice and age 18, while ID 4 corresponds to the name Bob and age 18. If the data processing request is a data update, Database 1 can be updated to Database 2 based on the request. Specifically, the age column in Database 1 with ID 4 can be updated from 18 to 20, resulting in Database 2. The age column in Database 2 with ID 4 corresponding to 20 is then the target data.
[0135] The integrity verification process of the target data returned by the monitoring component end B to the outsourced database B can be based on Figure 5 、 Figure 6 accomplish.
[0136] See also Figure 5 , Figure 5 A data update tree diagram in a data verification method provided according to an embodiment of this specification is shown.
[0137] Figure 5 The leaf nodes of the initial backup data are: 1, 2, 3, 4, which are used for the above Figure 4The hash values of the four pieces of data shown are recorded, and the root hash value is D1, which is used to represent the status of the overall data in the current database. When the initial backup data completes the data update request, the updated backup data is obtained, that is, after the update of the data with ID 4 is completed, the leaf node with ID 4 in the initial backup data changes from 4 to the leaf node with ID 4' in the updated backup data, and the root hash value changes from D1 to D2. Therefore, the first data verification information determined by the C monitoring component end according to the data update request includes: the leaf node corresponding to the target data ID 4 is 4', and the first root hash value corresponding to the target data ID 4 is D2.
[0138] See also Figure 6 , Figure 6 Another data update tree diagram in a data verification method provided according to an embodiment of this specification is shown.
[0139] like Figure 6 As shown in the figure, the leaf nodes of the data update tree diagram in the initial backup data are: 1, 2, and 3, which are used to represent the user's first update operation record, second update operation record, and third update operation record of the target data. A new leaf node is added every time a data update operation is performed; the root node is H1, which is used to represent the current status of the entire database data. Assume that user terminal A has sent three data update requests before sending a data update request to the outsourced database B, that is, the update operation record of the initial backup data includes three leaf nodes, such as Figure 6 The data update operation record in the initial backup data on the left, the root node corresponding to leaf node 3 is Figure 5 The root hash value D1 is shown in the initial backup data in the left figure. When the outsourced database B completes the data update request sent by the user terminal A, it adds a leaf node 4 to the data update tree diagram and records the root hash value D2. Therefore, the monitoring component terminal C determines the second data verification information based on the data update request, including: the proof path data corresponding to the target data ID 4 is a Merkle Tree with three layers, and the third layer has a total of four leaf nodes. The target data update operation is recorded as the fourth leaf node of the third layer, and the second root hash value corresponding to the target data ID 4 is D2. It should be noted that the Merkle Tree is mainly used to record the current data status of the database table.
[0140] Therefore, when the monitoring component end C verifies the target data, it first determines that the first root hash value corresponding to the target data ID 4 is D2, which is consistent with the second root hash value corresponding to the target data ID 4. Then, based on the leaf node 4' corresponding to the target data ID 4, the proof path data corresponding to the target data ID 4 is a MerkleTree consisting of three layers, and the third layer has four leaf nodes. The target data update operation is recorded as the fourth leaf node of the third layer. The third root hash value is calculated, as shown in the following example: Figure 6 From the data update operation record on the right, it can be seen that the third root hash value is D2. Therefore, the third root hash value is consistent with the first root hash value D2 corresponding to the target data ID 4 and / or the second root hash value D2 corresponding to the target data ID 4. It is determined that the data corresponding to the target data ID 4 meets the data integrity verification.
[0141] In the embodiments of this specification, by migrating the complex data verification process of the first data verification node to the second data verification node, the second data verification node can asynchronously perform data integrity verification on the target data update request initiated by the first data verification node, thereby reducing the data redundancy of the first data verification node and the delay in user use of data, thereby improving the user experience.
[0142] More specifically, performing data verification on the target data according to the first data verification information and the second data verification information includes:
[0143] If it is determined that the first root hash value is consistent with the second root hash value, comparing and verifying the proof path data corresponding to the target data and the current backup data corresponding to the target data, wherein the current backup data corresponding to the target data is generated after the receiving data providing node executes the data update request;
[0144] According to the comparison and verification result, data over-update verification is performed on the target data.
[0145] More specifically, performing data over-update verification on the target data based on the comparison verification result includes:
[0146] When it is determined that the comparison verification results are consistent, it is determined that the target data meets the data excessive update verification, wherein the data excessive update verification is that the data providing node does not update other data except the target data.
[0147] Continuing with the above example, the first data verification node can be understood as the user end of the above embodiment; the second data verification node can be understood as the monitoring component end of the above embodiment; and the data providing node can be understood as the outsourced database of the above embodiment.
[0148] Among them, the target data, first data verification information, second data verification information, first root hash value, second root hash value and proof path information can be understood as being consistent with the target data, first data verification information, second data verification information, first root hash value, second root hash value and proof path information in the above-mentioned data verification method, and the embodiments of this specification will not be elaborated here.
[0149] The current backup data can be understood as the data information sent by the data providing node to the second data verification node when completing the data processing request sent by the first data verification node. It can also be understood as the backup of the MerkleTree of the current state of the data by the second data verification node, that is, the data information sent by the outsourced database to the monitoring component end when completing the data processing request sent by the user end can also be understood as the backup of the MerkleTree of the current state of the data by the monitoring component end.
[0150] In a specific implementation, the second data verification node first obtains the first root hash value in the first data information, the second root hash value in the second data verification information, and the proof path data corresponding to the target data. The node then determines whether the obtained first root hash value and the second root hash value are consistent. If the first root hash value and the second root hash value are consistent, the node compares and verifies the proof path data corresponding to the target data with the current backup data corresponding to the target data. Based on the comparison and verification results, the node performs data over-update verification on the target data. Secondly, if the proof path data corresponding to the target data and the current backup data corresponding to the target data are consistent, the node determines that the target data satisfies the data over-update verification.
[0151] Continuing with the above example, the monitoring component C verifies by comparison that the target data ID is 4 and the corresponding proof path data is a MerkleTree consisting of three layers, and the third layer has four leaf nodes. The target data update operation is recorded as the fourth leaf node of the third layer, and the current backup data corresponding to the target data is, Figure 6 The data update operation record on the right side determines whether the target data meets the data over-update verification. Figure 6 As shown in the figure on the right, if the target data's proof path data is consistent, the target data is determined to meet the data over-update verification requirement. It should be noted that the second data verification node backs up the data received from the first data verification node in the MerkleTree of the data's current state, and backs up the data received from the data provider node in the MerkleTree of the data operation record. The current state of the data is the data update tree diagram of the target data.
[0152] In the embodiments of this specification, by migrating the complex data verification process of the first data verification node to the second data verification node, the second data verification node can asynchronously perform data over-update verification on the target data update request initiated by the first data verification node, thereby reducing the data redundancy of the first data verification node and the delay in user use of data, thereby improving the user experience.
[0153] More specifically, the first data verification information further includes a data update execution statement for the target data and a data signature of the first root hash value;
[0154] After performing data verification on the target data according to the first data verification information and the second data verification information, the method further includes:
[0155] updating the initial update backup data corresponding to the target data according to the data update execution statement to obtain target update backup data, wherein the initial update backup data is generated by the data providing node before executing the data update request;
[0156] The target updated backup data and the data signature of the first root hash value are sent to and stored in the data providing node.
[0157] Continuing with the above example, the first data verification node can be understood as the user end of the above embodiment; the second data verification node can be understood as the monitoring component end of the above embodiment; and the data providing node can be understood as the outsourced database of the above embodiment.
[0158] Among them, the target data, the first data verification information and the second data verification information can be understood to be consistent with the target data, the first data verification information and the second data verification information in the above-mentioned data verification method, and are not elaborated herein in the embodiments of this specification.
[0159] The data update execution statement can be understood as the data information sent by the data providing node to the second data verification node before executing the data processing request sent by the first data verification node, that is, the data information sent by the outsourced database to the monitoring component end before executing the data processing request sent by the first data verification node.
[0160] The initial update backup data can be understood as the data information sent by the data providing node to the second data verification node before executing the data processing request sent by the first data verification node, that is, the data information sent by the outsourced database to the monitoring component end before executing the data processing request sent by the first data verification node.
[0161] The target updated backup data can be understood as the data information obtained after the first data verification node and the second data verification node have successfully verified the target data and the second data verification node has updated the initial updated backup data, that is, the data information obtained after the user end and the monitoring component end have successfully verified the target data and the monitoring component end has updated the initial updated backup data.
[0162] A digital signature can be understood as a signature made by the user using his or her own private key, which ensures the security of the user's data operation records and prevents others from forging the user's digital signature.
[0163] During specific implementation, after the first data verification node passes the data correctness verification of the target data, and the second data verification node passes the data integrity and data over-update verification of the target data, it means that the target data returned by the data providing node meets the security principle. Therefore, the second data verification node will execute the statement according to the update operation record of the target data, update the initial update backup data corresponding to the target data, obtain the target updated backup data, and send the target updated backup data and the data signature of the first root hash value sent by the first data providing node to the data providing node, thereby realizing the storage of the updated data.
[0164] In the embodiment of this specification, by sending the target update backup to the data providing node for persistent storage, the user end's requirements for the timeliness of the target data can be guaranteed, and the user's experience of using the data can be improved. In addition, the embodiment of this specification also sends the digital signature of the first root hash value to the data providing node for storage, which can prevent others from tampering with the data and ensure the security of the data.
[0165] join Figure 7 , Figure 7 This is a scenario diagram of an update data verification process of a data verification method provided by an embodiment of this specification.
[0166] Figure 7 In the scenario diagram of the update data verification process, the outsourced database 702, the user terminal 704, and the monitoring component terminal 706 are included. The interaction process among the outsourced database 702, the user terminal 704, and the monitoring component terminal 706 is as follows.
[0167] a. The client 704 initiates a data update request to the outsourced database 702.
[0168] b. The outsourced database 702 updates the database and data verification information according to the received data update request, and sends the data update result to the user terminal 704, wherein the data update result includes the updated data and the first root hash value corresponding to the updated data.
[0169] c. The client 704 verifies the correctness of the returned updated data based on the received data processing result.
[0170] d. After the data correctness verification is passed, the user terminal 704 asynchronously sends the data update operation record, the node hash value corresponding to the updated data, the second root hash value corresponding to the updated data, and the digital signature corresponding to the second root hash value to the monitoring component terminal 706.
[0171] e. After sending the data processing results to the user end 704, the outsourced database 702 asynchronously sends relevant data verification information corresponding to the updated data to the monitoring component end 706, wherein the relevant data verification information corresponding to the updated data includes the proof node data corresponding to the updated data and the first root hash value corresponding to the updated data.
[0172] f. The monitoring component end 706 records the received data update operation record, the node hash value corresponding to the updated data, the second root hash value corresponding to the updated data, and the digital signature corresponding to the second root hash value in the user's initial backup data, and records the relevant data verification information corresponding to the received update data in the initial backup data of the outsourced database.
[0173] g. After receiving the messages sent by the user terminal 704 and the outsourced database 702, the monitoring component terminal 706 performs data integrity verification and data over-update verification on the returned updated data. The verification logic of the monitoring component terminal 706 for performing data integrity verification on the returned updated data includes: (1) comparing the second root hash value corresponding to the updated data sent by the user terminal in step c and the first root hash value corresponding to the updated data sent by the outsourced database 702 in step d to see if they are consistent; (2) based on the node hash value corresponding to the updated data sent by the user terminal 704 in step c and the proof node data corresponding to the updated data sent by the outsourced database 702 in step d, calculate the root hash value corresponding to the updated data, and if the root hash value corresponding to the updated data is consistent with the second root hash value corresponding to the updated data and the second root hash value corresponding to the updated data. Under the above, it is determined that the updated data meets the data integrity verification; the monitoring component end 706 performs data over-update verification on the returned updated data through verification logic, including: (1) comparing the second root hash value corresponding to the updated data sent by the user end in step c and the first root hash value corresponding to the updated data sent by the outsourced database 702 in step d to see whether they are consistent; (3) comparing and verifying the proof node data corresponding to the updated data sent by the outsourced database 702 in step d with the initial backup data cached in the monitoring component end 706. When the proof node data corresponding to the updated data is consistent with the initial backup data, it is determined that the updated data meets the data over-update verification.
[0174] h. After the monitoring component end 706 completes the verification of data integrity and data over-update, the cached initial update backup data is updated to obtain the target update backup data, and the digital signature of the first root node hash value corresponding to the update data is updated to obtain the updated digital signature. After the update is completed, the target update backup data and the updated digital signature are sent to the outsourced database 702 for persistent storage.
[0175] Taking the malicious attack launched by the outsourced database 702 on the updated data as an example, the embodiments of this specification provide the following verification methods. However, those skilled in the art should know that in addition to the verification of the several malicious attacks launched against the outsourced database provided in the embodiments of this specification, the methods provided in the embodiments of this specification for other malicious attacks launched by other entities can also be implemented.
[0176] When the outsourced database 702 may launch a malicious attack on the updated data, it will be detected by the data correctness verification logic in step c; when the outsourced database 702 may launch a malicious attack on the root node hash value corresponding to the updated data after returning the correct updated data, it will be detected by the verification logic (1) of step g; when the outsourced database 702 may update part of the target data, it will be detected by the verification logic (2) of step g; when the outsourced database 702 updates the target data but tampered with other data, it will be detected by the verification logic (3) of step g.
[0177] Therefore, when the data processing request is a data update request, the first data verification node 704 performs necessary verification on the target data based on the data verification information received from the data providing node 702. If the verification is passed, the data verification information is sent to the second data verification node 706 to implement other complex verifications of the target data by the second data verification node 706, thereby quickly determining whether the target data meets the security verification logic, ensuring high throughput of data use, and reducing latency in data use.
[0178] In one or more embodiments of this specification, when the data processing request is a data query request, the first data verification node performs data verification on the target data according to the fourth data verification information in a specific implementation manner as follows:
[0179] In the case where the data processing request is a data query request, the fourth data verification information includes a first root hash value and proof path data corresponding to the target data;
[0180] Accordingly, performing data verification on the target data according to the fourth data verification information includes:
[0181] Calculate and obtain a fourth root hash value based on the target data and the proof path data corresponding to the target data;
[0182] Perform data integrity verification on the target data according to the fourth root Hash value and the first root Hash value.
[0183] Continuing with the above example, the first data verification node can be understood as the user end of the above embodiment; the second data verification node can be understood as the monitoring component end of the above embodiment; and the data providing node can be understood as the outsourced database of the above embodiment.
[0184] Among them, the data processing request, target data, first root hash value, proof path data, and fourth data verification information can be understood as being consistent with the data processing request, target data, first root hash value, proof path data, and fourth data verification information in the above-mentioned data verification method, and the embodiments of this specification will not be elaborated here.
[0185] The fourth root hash value can be understood as the output length information of the root node of the target data calculated by the first data verification node based on the target data returned by the data verification node and the proof path data corresponding to the target data, that is, the output length information of the root node of the target data calculated by the user end based on the target data returned by the outsourced database and the proof path data corresponding to the target data.
[0186] During specific implementation, the first data verification node first determines the first root hash value and the proof path data corresponding to the target data based on the fourth data verification information obtained; then, based on the first root hash value and the proof path data corresponding to the target data, the fourth root hash value is calculated; secondly, by comparing the fourth root hash value with the first root hash value, the data integrity (i.e., R-completeness) of the target data is verified.
[0187] For example, if the first data verification node is user terminal A, the second data verification node is monitoring component terminal B, and the data providing node is outsourced database C, and user terminal A sends a data query request to outsourced database C, then outsourced database C will send target data and fourth data verification information to user terminal A after processing the received data query request. User terminal A verifies the target data based on the received fourth data verification information. Figure 4 For example, when the data query request sent by client A to outsourced database B is "find table set age=20", outsourced database B queries database 2 according to the received data query request, and sends the target data obtained by the query and the fourth query verification information to client A. Client A verifies the target data according to the received fourth data verification information. Figure 4The target data shown in the diagram is as follows: "age = 20" in database 2 corresponds to "name = bob, ID = 4", so it can be seen that the target data is 4; accordingly, according to Figure 5 As shown in the data tree diagram on the right, when "ID=4", the first hash value corresponding to the target data is D2; according to Figure 6 From the data operation record shown in the right figure, it can be seen that when "ID=4", the proof path data corresponding to the target data is a MerkleTree including three layers, and the third layer has four leaf nodes. The target data operation record is the fourth leaf node of the third layer, and its corresponding root hash value is D2. Therefore, through the first root hash value corresponding to the target data and the proof path data, the fourth root hash value is calculated to be D2, that is, the first root hash value corresponding to the target data is consistent with the fourth root hash value, and it is determined that the query data meets the data integrity (ie R-completeness) verification.
[0188] In the embodiments of this specification, by migrating the complex data verification process of the first data verification node to the second data verification node, the first data verification node can perform necessary data verification on the target data query request, for example, query data integrity verification, which can reduce the delay in user use of data and improve the user experience.
[0189] In one or more embodiments of this specification, when the data processing request is a data query request, the first data verification node performs data verification on the target data according to the data verification policy and the first data verification information in a specific implementation manner as follows:
[0190] The data processing request is a data query request;
[0191] Accordingly, determining a data verification strategy according to the data processing request, and performing data verification on the target data according to the data verification strategy and the first data verification information, includes:
[0192] determining a second data verification strategy according to the data query request, and determining the third data verification information according to the second data verification strategy;
[0193] The target data is verified according to the third data verification information.
[0194] Continuing with the above example, the first data verification node can be understood as the user end of the above embodiment; the second data verification node can be understood as the monitoring component end of the above embodiment; and the data providing node can be understood as the outsourced database of the above embodiment.
[0195] Among them, the data processing request, data verification strategy, target data and first data verification information can be understood as being consistent with the data processing request, data verification strategy, target data and first data verification information in the above-mentioned data verification method, and will not be elaborated in the embodiments of this specification.
[0196] The second data verification strategy can be understood as a query data verification method determined according to a data query request during the data verification process.
[0197] The third data verification information can be understood as data information related to the target data sent by the first data verification node to the second data verification node, that is, data information related to the target data sent by the user end to the monitoring component end, including but not limited to the root hash value corresponding to the target data, etc.
[0198] In specific implementation, first, the second data verification node receives the third data verification information sent by the first data verification node, then determines the second data verification strategy based on the data processing request of the first data verification node, and finally, performs data verification on the target data through the determined data verification strategy and the received third data verification information.
[0199] Taking the first data verification node as user terminal A, the second data verification node as monitoring component terminal B, and the data providing node as outsourced database C as an example, the second data verification strategy is determined according to the data query request, and the third data verification information is determined according to the second data verification strategy. It can be understood that: the monitoring component terminal B determines the second data verification strategy according to the data query request sent by the user terminal A, and determines the third data verification information according to the second data verification strategy; according to the third data verification information, the target data is data verified, which can be understood as the monitoring component terminal B performs data verification on the target data according to the determined third data verification information.
[0200] In the embodiments of this specification, the target data returned by the data providing node is verified by the second data verification node. In addition to the necessary logical verification of the target data performed by the first data verification node, other logical verifications can reduce the delay rate of the user's use of the target data and ensure high throughput of data use on the basis of the security of the target data returned by the data providing node.
[0201] More specifically, the third data verification information includes a root hash value corresponding to the target data;
[0202] Accordingly, performing data verification on the target data according to the third data verification information includes:
[0203] The target data is verified for data correctness and / or timeliness based on the root hash value corresponding to the target data.
[0204] In a specific implementation, the data correctness and / or timeliness verification of the target data according to the root hash value corresponding to the target data includes:
[0205] If it is determined that a root hash value corresponding to the target data exists in the query backup data corresponding to the target data, determining that the target data satisfies data correctness verification; and / or
[0206] When it is determined that the root hash value corresponding to the target data satisfies a preset timeliness condition in the query backup data, it is determined that the target data satisfies data timeliness verification.
[0207] Continuing with the above example, the first data verification node can be understood as the user end of the above embodiment; the second data verification node can be understood as the monitoring component end of the above embodiment; and the data providing node can be understood as the outsourced database of the above embodiment.
[0208] Among them, the target data, query backup data and third data verification information can be understood as being consistent with the data processing request, data verification strategy, target data and first data verification information in the above-mentioned data verification method, and will not be elaborated in the embodiments of this specification.
[0209] Among them, the preset timeliness condition can be understood as the root hash value of the target data belonging to the latest leaf node in the data operation record backup data, that is, the condition of the query data being the latest is met.
[0210] During specific implementation, the second data verification node performs query data correctness (i.e., R-correctness) verification and / or query data timeliness (i.e., R-freshness) verification on the target data by obtaining the root hash value corresponding to the target data. When the root hash value corresponding to the target data exists in the query backup data corresponding to the target data, it is determined that the target data satisfies the data correctness verification; when the root hash value corresponding to the target data is in the query backup data and satisfies the preset timeliness condition, it is determined that the target data satisfies the data timeliness verification.
[0211] For example, if the first data verification node is user terminal A, the second data verification node is monitoring component terminal B, and the data providing node is outsourced database C, after the monitoring component terminal C receives the third data verification information, it verifies the correctness and timeliness of the target data based on the root hash value corresponding to the target data of the third data verification information. Figure 6 As shown in the right figure of another data tree diagram, let the root hash value corresponding to the target data be D2. When the root hash value D2 corresponding to the target data is Figure 6If the right figure exists, it is determined that the target data meets the data correctness verification; when the root hash value D2 corresponding to the target data is Figure 6 If the hash value of the latest leaf node in the right figure is consistent, it is determined that the target data meets the data timeliness verification.
[0212] In the embodiments of this specification, by migrating the complex data verification process of the first data verification node to the second data verification node, the second data verification node can asynchronously verify the data correctness and data timeliness of the target data query request initiated by the first data verification node, thereby reducing the delay in users using data and improving the user experience.
[0213] join Figure 8 , Figure 8 This is a scenario diagram of a query data verification process of a data verification method provided in an embodiment of this specification.
[0214] Figure 8 In FIG, a scenario diagram of the query data verification process includes an outsourced database 802, a user terminal 804, and a monitoring component terminal 806. The interaction process among the outsourced database 802, the user terminal 804, and the monitoring component terminal 806 is as follows.
[0215] i. The client 804 initiates a data query request to the outsourced database 802.
[0216] j. The outsourced database 802 performs a data query on the database according to the received data query request, and sends the data query result to the user terminal 804, wherein the data query result includes the query data, the third root hash value corresponding to the query data, and the proof path data corresponding to the query data.
[0217] k. The user terminal 804 performs data integrity verification on the returned query data based on the query data in the received data query result and the proof path data corresponding to the query data.
[0218] 1. After the data integrity verification is passed, the user terminal 804 asynchronously sends the data and the third hash value corresponding to the query data to the monitoring component terminal 806.
[0219] m. The monitoring component end 806 performs data correctness verification and data timeliness verification on the returned query data based on the cached third root hash value corresponding to the query data. The verification logic of the monitoring component end 806 performing data correctness verification and data timeliness verification on the returned query data includes: (1) the monitoring component end 806 checks whether there is a third root hash value corresponding to the query data in the cached data query operation record. If so, it is determined that the data query data meets the data correctness verification; (2) the monitoring component end 806 checks whether the third root hash value corresponding to the query data in the cached data query operation record is the root hash value of the latest leaf node. If so, it is determined that the data query data meets the data timeliness verification.
[0220] Taking the malicious attack launched by the outsourced database 802 on the query data as an example, the embodiments of this specification provide the following verification methods. However, those skilled in the art should know that in addition to the verification of the several malicious attacks launched against the outsourced database provided in the embodiments of this specification, the methods provided in the embodiments of this specification for other malicious attacks launched by other entities can also be implemented.
[0221] When the outsourced database 802 may maliciously tamper with the query data results, it will be detected by the query data integrity verification logic in step k; when the outsourced database 802 may maliciously tamper with the query data results and tamper with the returned third root node hash value and the proof path data corresponding to the query data, it will be detected by the query data correctness verification logic (1) in step m; when the outsourced database 802 may return the correct query data results, the third root node hash value, and the proof path data corresponding to the query data of the old version snapshot, it will be detected by the query data timeliness verification logic (2) in step m;
[0222] Therefore, when the data processing request is a data query request, the first data verification node 804 performs necessary verification on the target data based on the data verification information sent by the received data providing node 802. If the verification is passed, the data verification information is sent to the second data verification node 806 to implement other complex verifications of the target data by the second data verification node 806, thereby quickly determining whether the target data meets the security verification logic, ensuring high throughput of data use, and reducing latency in data use.
[0223] Figure 9 This is a flow chart of a data verification system provided by an embodiment of this specification. Figure 9 As shown, the specific steps include the following steps.
[0224] It should be noted that the data verification system provided in the embodiment of this specification includes a data providing node 902, a first data verification node 904, and a second data verification node 906, wherein the first data verification node 904 is used to send a data processing request to the data providing node. The data providing node 902 is used to process the data processing request, and send the target data and the fourth data verification information obtained by processing the data processing request to the first data verification node. The first data verification node 904 is used to perform data verification on the target data according to the fourth data verification information, obtain the first data verification information, and send the first data verification information to the second data verification node. The second data verification node 906 is used to receive the first data verification information sent by the first data verification node, and determine the data verification strategy according to the data processing request, and perform data verification on the target data according to the data verification strategy and the first data verification information.
[0225] The above is a schematic diagram of a data verification device according to an embodiment of this specification. It should be noted that the technical solution of the data verification device and the technical solution of the above-mentioned data verification method are based on the same concept. For details not described in detail in the technical solution of the data verification device, please refer to the description of the technical solution of the above-mentioned data verification method.
[0226] Figure 10 This is a schematic diagram of a data verification device applied to a first verification node according to an embodiment of this specification. Figure 10 As shown, the device includes:
[0227] The first sending module 1002 is configured to send a data processing request to a data providing node, and receive target data and fourth data verification information returned by the data providing node according to the data processing request.
[0228] The second verification module 1004 is configured to perform data verification on the target data according to the fourth data verification information.
[0229] The second sending module 1006 is configured to send first data verification information to the second data verification node when the target data is verified successfully, so that the second data verification node performs data verification on the target data according to the first data verification information.
[0230] Optionally, the second verification module 1004 is further configured to:
[0231] The target data is verified for data correctness based on the target data and the data to be updated.
[0232] Optionally, the second verification module 1004 is further configured to:
[0233] Calculate and obtain a fourth root hash value based on the target data and the proof path data corresponding to the target data;
[0234] Perform data integrity verification on the target data according to the fourth root Hash value and the first root Hash value.
[0235] The above is a schematic diagram of a data verification system according to an embodiment of this specification. It should be noted that the technical solution of the data verification device and the technical solution of the above-mentioned data verification method are based on the same concept. For details not described in detail in the technical solution of the data verification device, please refer to the description of the technical solution of the above-mentioned data verification method.
[0236] Corresponding to the above method embodiments, this specification also provides data verification device embodiments.
[0237] Figure 11 FIG. 1 is a structural diagram of a data verification device applied to a second data verification node provided by an embodiment of this specification. Figure 11 As shown, the device includes:
[0238] The receiving module 1102 is configured to receive first data verification information sent by the first data verification node, wherein the first data verification information is sent by the first data verification node to the second data verification node when the first data verification node verifies the target data returned by the data providing node, and the target data is returned by the data providing node in response to the data processing request sent by the first data verification node.
[0239] The first verification module 1104 is configured to determine a data verification strategy according to the data processing request, and perform data verification on the target data according to the data verification strategy and the first data verification information.
[0240] Optionally, the first verification module 1104 is further configured to: determine a first data verification strategy according to the data update request, and determine the first data verification information and the second data verification information received from the data providing node according to the first data verification strategy;
[0241] The target data is verified according to the first data verification information and the second data verification information.
[0242] Optionally, the first verification module 1104 is further configured to:
[0243] When it is determined that the first root hash value is consistent with the second root hash value, calculating a third root hash value according to the node hash value corresponding to the target data and the proof path data corresponding to the target data;
[0244] Perform data integrity verification on the target data according to the third root hash value.
[0245] Optionally, the first verification module 1104 is further configured to:
[0246] If it is determined that the first root hash value is consistent with the second root hash value, comparing and verifying the proof path data corresponding to the target data and the current backup data corresponding to the target data, wherein the current backup data corresponding to the target data is generated after the receiving data providing node executes the data update request;
[0247] According to the comparison and verification result, data over-update verification is performed on the target data.
[0248] Optionally, the first verification module 1104 is further configured to:
[0249] When it is determined that the third root hash value is consistent with the first root hash value or the second root hash value, it is determined that the target data satisfies data integrity verification.
[0250] Optionally, the first verification module 1104 is further configured to:
[0251] When it is determined that the comparison verification results are consistent, it is determined that the target data meets the data excessive update verification, wherein the data excessive update verification is that the data providing node does not update other data except the target data.
[0252] Optionally, the device further comprises:
[0253] an update module configured to update the initial update backup data corresponding to the target data according to the data update execution statement to obtain target update backup data, wherein the initial update backup data is generated by the data providing node before executing the data update request;
[0254] The storage module is configured to send and store the target updated backup data and the data signature of the first root hash value to the data providing node.
[0255] Optionally, the first verification module 1104 is further configured to:
[0256] determining a second data verification strategy according to the data query request, and determining the third data verification information according to the second data verification strategy;
[0257] The target data is verified according to the third data verification information.
[0258] Optionally, the first verification module 1104 is further configured to:
[0259] The target data is verified for data correctness and / or timeliness based on the root hash value corresponding to the target data.
[0260] Optionally, the first verification module 1104 is further configured to:
[0261] If it is determined that a root hash value corresponding to the target data exists in the query backup data corresponding to the target data, determining that the target data satisfies data correctness verification; and / or
[0262] When it is determined that the root hash value corresponding to the target data satisfies a preset timeliness condition in the query backup data, it is determined that the target data satisfies data timeliness verification.
[0263] The data verification device adopted in the embodiment of this specification first uses the first data verification node to verify the target data returned by the data providing node according to the data processing request; if the data verification passes, the second data verification node is used in combination with the data verification strategy determined by the data processing request to verify the target data again. By performing double data verification on the target data through the first data verification node and the second data verification node, the security of the target data returned by the data providing node is guaranteed.
[0264] The above is a schematic diagram of a data verification device according to an embodiment of this specification. It should be noted that the technical solution of the data verification device and the technical solution of the above-mentioned data verification method are based on the same concept. For details not described in detail in the technical solution of the data verification device, please refer to the description of the technical solution of the above-mentioned data verification method.
[0265] Figure 12 The following is a block diagram of a computing device 1200 according to one embodiment of the present disclosure. Components of the computing device 1200 include, but are not limited to, a memory 1210 and a processor 1220. The processor 1220 is connected to the memory 1210 via a bus 1230, and a database 1250 is used to store data.
[0266] The computing device 1200 also includes an access device 1240 that enables the computing device 1200 to communicate via one or more networks 1260. Examples of such networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 1240 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, or a near field communication (NFC) interface.
[0267] In one embodiment of the present specification, the above components of the computing device 1200 and Figure 12 Other components not shown in the figure may also be connected to each other, for example, via a bus. Figure 12 The computing device structure block diagram shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art may add or replace other components as needed.
[0268] Computing device 1200 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, personal digital assistant, laptop computer, notebook computer, netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or personal computer (PC). Computing device 1200 may also be a mobile or stationary server.
[0269] The processor 1220 is configured to execute the following computer-executable instructions, which implement the steps of the above-mentioned data verification method when executed by the processor.
[0270] The above is a schematic diagram of a computing device according to an embodiment of this specification. It should be noted that the technical solution of the computing device and the technical solution of the above-mentioned data verification method are of the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the above-mentioned data verification method.
[0271] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which implement the steps of the above-mentioned data verification method when executed by a processor.
[0272] The above is a schematic scheme of a computer-readable storage medium in an embodiment of this specification. It should be noted that the technical solution of this storage medium and the technical solution of the above-mentioned data verification method are based on the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the above-mentioned data verification method.
[0273] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned data verification method.
[0274] The above is a schematic scheme of a computer program in an embodiment of this specification. It should be noted that the technical scheme of this computer program and the technical scheme of the above-mentioned data verification method are based on the same concept. For details not described in detail in the technical scheme of the computer program, please refer to the description of the technical scheme of the above-mentioned data verification method.
[0275] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0276] The computer instructions include computer program code, which may be in source code form, object code form, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal, and software distribution medium. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media does not include electric carrier signals and telecommunication signals.
[0277] It should be noted that for the aforementioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0278] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0279] The preferred embodiments disclosed above are intended only to help illustrate this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made based on the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A data verification method, applied to a second data verification node, comprising: receiving first data verification information sent by a first data verification node, wherein the first data verification information is sent by the first data verification node to the second data verification node when the first data verification node successfully verifies target data returned by the data providing node, and the target data is returned by the data providing node in response to a data processing request sent by the first data verification node; Determining a data verification strategy according to the data processing request, and performing data verification on the target data according to the data verification strategy and the first data verification information, including: Determining a first data verification strategy for the data update request according to the data update request, and determining the first data verification information and the second data verification information received from the data providing node according to the first data verification strategy; performing data verification on the target data according to the first data verification information and the second data verification information; The first data verification information includes a node hash value and a first root hash value corresponding to the target data, and the second data verification information includes proof path data and a second root hash value corresponding to the target data. The data verification of the target data based on the first data verification information and the second data verification information includes: When it is determined that the first root hash value is consistent with the second root hash value, a third root hash value is calculated based on the node hash value corresponding to the target data and the proof path data corresponding to the target data; and data integrity verification is performed on the target data based on the third root hash value.
2. The method according to claim 1, performing data verification on the target data according to the first data verification information and the second data verification information, comprising: If it is determined that the first root hash value is consistent with the second root hash value, comparing and verifying the proof path data corresponding to the target data and the current backup data corresponding to the target data, wherein the current backup data corresponding to the target data is generated after the receiving data providing node executes the data update request; According to the comparison and verification result, data over-update verification is performed on the target data.
3. The method according to claim 1, wherein the data integrity verification of the target data according to the third root hash value comprises: When it is determined that the third root hash value is consistent with the first root hash value or the second root hash value, it is determined that the target data satisfies data integrity verification.
4. The method according to claim 2, wherein the step of performing data over-update verification on the target data based on the comparison verification result comprises: When it is determined that the comparison verification results are consistent, it is determined that the target data meets the data excessive update verification, wherein the data excessive update verification is that the data providing node does not update other data except the target data.
5. The method according to any one of claims 1 to 4, wherein the first data verification information further includes a data update execution statement for the target data and a data signature of the first root hash value; After performing data verification on the target data according to the first data verification information and the second data verification information, the method further includes: updating the initial update backup data corresponding to the target data according to the data update execution statement to obtain target update backup data, wherein the initial update backup data is generated by the data providing node before executing the data update request; The target updated backup data and the data signature of the first root hash value are sent to and stored in the data providing node.
6. The method according to claim 1, wherein the data processing request is a data query request; Accordingly, determining a data verification strategy according to the data processing request, and performing data verification on the target data according to the data verification strategy and the first data verification information, includes: determining a second data verification strategy according to the data query request, and determining third data verification information according to the second data verification strategy; The target data is verified according to the third data verification information.
7. The method according to claim 6, wherein the third data verification information includes a root hash value corresponding to the target data; Accordingly, performing data verification on the target data according to the third data verification information includes: The target data is verified for data correctness and / or timeliness based on the root hash value corresponding to the target data.
8. The method according to claim 7, wherein the verifying the correctness and / or timeliness of the target data according to the root hash value corresponding to the target data comprises: If it is determined that a root hash value corresponding to the target data exists in the query backup data corresponding to the target data, determining that the target data satisfies data correctness verification; and / or When it is determined that the root hash value corresponding to the target data satisfies a preset timeliness condition in the query backup data, it is determined that the target data satisfies data timeliness verification.
9. A data verification method, applied to a first data verification node, comprising: Sending a data processing request to a data providing node, and receiving target data and fourth data verification information returned by the data providing node according to the data processing request; performing data verification on the target data according to the fourth data verification information; When the target data is verified successfully, first data verification information is sent to the second data verification node, so that the second data verification node performs data verification on the target data according to the first data verification information and the second data verification information determined according to the data verification policy corresponding to the data processing request; wherein, the first data verification information includes the node hash value and the first root hash value corresponding to the target data, and the second data verification information includes the proof path data and the second root hash value corresponding to the target data, and the data verification process is: when it is determined that the first root hash value is consistent with the second root hash value, a third root hash value is calculated according to the node hash value corresponding to the target data and the proof path data corresponding to the target data; and data integrity verification is performed on the target data according to the third root hash value.
10. The method according to claim 9, wherein when the data processing request is a data update request, the fourth data verification information includes the data to be updated carried in the data processing request; Accordingly, performing data verification on the target data according to the fourth data verification information includes: The target data is verified for data correctness based on the target data and the data to be updated.
11. The method according to claim 9, wherein when the data processing request is a data query request, the fourth data verification information includes a first root hash value and proof path data corresponding to the target data; Accordingly, performing data verification on the target data according to the fourth data verification information includes: Calculate and obtain a fourth root hash value based on the target data and the proof path data corresponding to the target data; Perform data integrity verification on the target data according to the fourth root Hash value and the first root Hash value.
12. A data verification system, comprising a first data verification node, a second data verification node, and a data providing node, wherein: The first data verification node is used to send a data processing request to the data providing node; The data providing node is configured to process the data processing request, and send the target data and fourth data verification information obtained by processing the data processing request to the first data verification node; The first data verification node is configured to perform data verification on the target data according to the fourth data verification information, obtain first data verification information, and send the first data verification information to the second data verification node; the second data verification node is configured to receive the first data verification information sent by the first data verification node, determine a data verification strategy according to the data processing request, and perform data verification on the target data according to the data verification strategy and the first data verification information; The second data verification node is specifically configured to determine a first data verification strategy for the data update request according to the data update request, and determine the first data verification information and the second data verification information received and sent by the data providing node according to the first data verification strategy; perform data verification on the target data according to the first data verification information and the second data verification information; wherein the first data verification information includes a node hash value and a first root hash value corresponding to the target data, and the second data verification information includes proof path data and a second root hash value corresponding to the target data; The second data verification node is specifically used to calculate a third root hash value based on the node hash value corresponding to the target data and the proof path data corresponding to the target data when determining that the first root hash value is consistent with the second root hash value during the data verification process of the target data based on the first data verification information and the second data verification information; and perform data integrity verification on the target data based on the third root hash value.
Citation Information
Patent Citations
Data verification method and device, electronic equipment and storage medium
CN110083615A
Method for providing authenticated update in distributed network
CN110445633A