High-performance database data tamper-proofing method, device and system based on block chain

Through the blockchain-based database tamper-proof method, the client preprocesses data, the server builds a Merkel tree and generates a Merkel tree-like problem in the existing technology that data cannot be quickly recovered and a single central node is easily attacked, and efficient data management and rapid recovery are achieved.

CN120493300APending Publication Date: 2025-08-15CICC HUITONG DATA MANAGEMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510559821.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

Existing database data anti-tamper detection methods cannot quickly recover data and a single central node is easily attacked or tampered, resulting in the entire tamper-proof system being bypassed or destroyed.

Method used

Through a high-performance database data tamper-proof method based on blockchain, the client preprocesses the data, the server builds a Merkel tree and performs multiple rounds of verification, generates new blocks and builds Merkel-like trees to achieve tamper-proof detection.

Benefits of technology

It improves the integrity and authenticity of data, reduces the risk of illegal tampering, can quickly recover data, avoids the tamper-proof system being destroyed after a single central node is attacked, and improves the performance and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120493300A_ABST
    Figure CN120493300A_ABST
Patent Text Reader

Abstract

The invention discloses a high-performance database data tamper-proofing method, device and system based on a block chain, and the method comprises the steps: 1, carrying out the preprocessing of local data through a client, obtaining a preprocessed data block, and uploading the data block to a corresponding server; 2, the preset central program verifies the state of the server, generates a plurality of random verification sequence number pairs, and sends the plurality of random verification sequence number pairs to the server in a normal state; step 3, the server constructs the uploaded data blocks into a Merkel tree, performs multiple rounds of verification according to a plurality of random verification serial numbers, and broadcasts private key signatures of the data blocks in the verified servers to all the servers; and 4, after all the servers complete verification, all the servers generate new blocks and construct a Merkel-like tree, and tampering detection is realized through the Merkel-like tree. The data integrity and authenticity and the overall performance and stability of the system are improved, and the risk that the data are illegally tampered is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a high-performance database data tamper-proofing method, device, and system based on blockchain. Background Art

[0002] With the rapid development of information technology, database systems have become an indispensable information storage and processing tool in modern society. However, the data security issues of database systems are becoming increasingly prominent, especially in terms of data tamper prevention, which faces severe challenges.

[0003] Existing database data tamper prevention methods are insufficient in the face of the ever-changing and diverse tampering methods. Traditional methods (such as audit logs, triggers, and SQL monitoring) detect tampering by recording operation logs. These methods can only detect anomalies after data tampering and cannot quickly restore the data. Critical information such as audit logs, hash values, and permission configurations are usually stored in a single central node (such as a log server or metadata management library). If this node is attacked or tampered with (for example, by gaining administrator privileges or inserting malicious code), the entire tamper prevention system can be bypassed or compromised. Summary of the Invention

[0004] In order to solve the problems in the prior art that data cannot be quickly restored after being tampered with and that a single central node is easily attacked or tampered with, resulting in the entire anti-tampering system being bypassed or destroyed, the present invention provides a high-performance database data tamper-proofing method, device and system based on blockchain. The present invention first pre-processes the data uploaded by the client, then verifies the server and data blocks, and constructs a Merkle tree of each server's data. After the verification is completed, a new block is generated according to a preset consensus mechanism and a quasi-Merkle tree is constructed based on the Merkle tree of each server. Anti-tampering detection is implemented based on the quasi-Merkle tree. The present invention realizes comprehensive protection and efficient management of database data, not only improves the integrity and authenticity of the data, but also reduces the risk of data being illegally tampered with. When the data is tampered with, the data can be quickly restored and the problem of the entire anti-tampering system being bypassed or destroyed after the single central node is attacked is avoided.

[0005] In order to achieve the above object, the technical solution of the present invention is:

[0006] The first aspect of the present invention proposes a high-performance database data tamper-proof method based on blockchain, comprising:

[0007] Step 1: The client preprocesses the local data to obtain preprocessed data blocks, and uploads the data blocks to the corresponding server;

[0008] Step 2: The pre-set central program verifies the status of multiple servers under its control and generates multiple random verification number pairs. These random verification number pairs are sent to servers in normal status to ensure that only normal servers are included in the subsequent verification process, effectively avoiding risks that may be caused by faulty servers.

[0009] Step 3: The server constructs the uploaded data block into a Merkle tree and performs multiple rounds of verification based on multiple random verification numbers. The private key signatures of the data blocks in the servers that pass the verification are broadcast to all servers. Servers that fail the verification perform the next round of verification and self-check to ensure the authenticity and integrity of the data, effectively preventing malicious servers from sending false data.

[0010] Step 4: After all servers complete the verification, they generate a new block according to the preset consensus mechanism, and use the Merkle tree to construct a Merkle-like tree in the new block, and implement database data tamper-proof detection through the Merkle-like tree.

[0011] Furthermore, the preprocessing includes:

[0012] Calculate the hash value of the local data separately, integrate the hash value, timestamp and other relevant information of the local data, calculate the overall hash value again, and obtain the data block, so as to obtain the completed data block.

[0013] Furthermore, the sending of the plurality of random verification sequence number pairs to a server in a normal state specifically includes:

[0014] The central program generates multiple random verification number pairs and sends the private key and public key of each random verification number pair to different servers respectively. Each server receives a private key and public key to facilitate mutual verification between servers.

[0015] Furthermore, multiple servers controlled by the central program perform multiple rounds of verification according to multiple random verification serial numbers, broadcast the private key signatures of the data blocks in the servers that pass the verification to all servers, and the servers that fail the verification perform the next round of verification and self-check, specifically including:

[0016] Each server packages the private key signature of the data for a preset time period and sends it to the server that receives the public key corresponding to its private key, facilitating mutual verification between servers;

[0017] The server that receives the data private key signature uses the corresponding public key to verify the data private key signature. If the verification is successful, the server that receives the data private key signature will package the data private key signature and broadcast it to all servers. If the verification fails, the server that sends the data private key signature will perform data self-inspection and correction, and proceed to the next round of verification to ensure the authenticity and integrity of the data and prevent malicious servers from sending false data.

[0018] Furthermore, after all servers complete verification, they generate a new block according to a preset consensus mechanism and construct a Merkle-like tree in the new block using the Merkle tree, specifically including:

[0019] When all servers complete verification, each server receives the Merkle tree of all servers, and all servers generate a new block according to the preset consensus mechanism;

[0020] Each server constructs a Merkle tree using the root node of the Merkle tree in the new block to obtain a Merkle-like tree; wherein the data of the new block points to the root node of the Merkle-like tree, which facilitates tampering detection based on the Merkle-like tree.

[0021] Furthermore, the Merkle-like tree includes multiple Merkle trees, and the root node of the Merkle-like tree includes on-chain data.

[0022] Furthermore, the Merkle tree includes a tree ID, a node ID, a current node hash, a left child node ID, a right child node ID, a left child node hash, a right child node hash, a parent node ID, and a data ID;

[0023] The node IDs are counted starting from 0 from the lower left corner of the tree structure in order from left to right and from the lower layer to the upper layer.

[0024] Furthermore, the implementation of database data tamper-proof detection through a Merkle-like tree specifically includes:

[0025] When the server detects that the hash value in a block is inconsistent with the hash value in the data, the server will discard the block and all subsequent blocks and data;

[0026] The server uses broadcasting to request discarded blocks and data from other servers, and reconstructs the discarded blocks and data based on the data sent by other servers.

[0027] The second aspect of the present invention proposes a high-performance database data tamper-proof device based on blockchain, comprising:

[0028] The preprocessing module is used to enable the client to preprocess the local data, obtain the preprocessed data blocks, and upload the data blocks to the corresponding server;

[0029] The status verification module is used by a preset central program to verify the status of multiple servers under its control and generate multiple random verification sequence number pairs. These random verification sequence number pairs are sent to servers in normal status to ensure that only servers in normal status are included in the subsequent verification process, thereby effectively avoiding the risks that may be caused by faulty servers.

[0030] The server verification module is used to enable the server to construct the uploaded data block into a Merkle tree and perform multiple rounds of verification based on multiple random verification serial numbers. The private key signature of the data block in the server that passed the verification is broadcast to all servers. The server that failed the verification will undergo the next round of verification and self-check to ensure the authenticity and integrity of the data and effectively prevent malicious servers from sending false data.

[0031] The Merkle-like tree module is used to generate a new block according to a preset consensus mechanism after all servers complete verification, and use the Merkle-like tree to construct a Merkle-like tree in the new block, thereby realizing database data tamper-proof detection through the Merkle-like tree.

[0032] The third aspect of the present invention proposes a high-performance database data tamper-proof system based on blockchain, including a client, a server and a central program, wherein the client is provided with a preprocessing module as described in the second aspect above, the server is provided with a server verification module and a Merkle-like tree module as described in the second aspect above, and the central program includes a status verification module as described in the second aspect above.

[0033] Beneficial effects of the present invention:

[0034] This invention achieves comprehensive protection and efficient management of database data, not only improving data integrity and authenticity but also reducing the risk of illegal data tampering. It also allows for rapid data recovery after tampering and avoids the problem of the entire anti-tampering system being bypassed or destroyed if a single central node is attacked. Furthermore, through the collaborative work of the client, server, and central program, rapid data synchronization and consistency are achieved, improving the overall performance and stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A flowchart of a high-performance database data tamper-proofing method based on blockchain provided in an embodiment of the present invention.

[0036] Figure 2 A specific flow chart of a high-performance database data tamper-proofing method based on blockchain provided by an embodiment of the present invention.

[0037] Figure 3 An architectural diagram of a high-performance blockchain-based database data tamper-proof system provided in an embodiment of the present invention.

[0038] Figure 4 A schematic diagram of the layout of the client, server, and central program provided in an embodiment of the present invention.

[0039] Figure 5 Schematic diagram of a Merkle tree provided in an embodiment of the present invention; wherein (a) is a Merkle tree structure diagram in a server, (b) is a data diagram including other servers after each server synchronizes data, and (c) is a Merkle-like tree diagram constructed from all data.

[0040] Figure 6 A schematic diagram of a central program issuing random verification number pairs provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0041] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0042] Example 1

[0043] like Figure 1 As shown, a high-performance database data tamper-proof method based on blockchain includes:

[0044] S101: The client preprocesses local data to obtain preprocessed data blocks, and uploads the data blocks to the corresponding server.

[0045] Specifically, the client first preprocesses the local data that it needs to upload to the server, which includes calculating the hash value of the data separately, integrating the hash value, timestamp and other relevant information, and calculating the overall hash value again to form a complete data block.

[0046] The client preferably generates an encrypted log file locally, detailing the upload operations and corresponding data during that time period. After completing these preparations, the client uploads the data blocks to its physically connected server. The server is responsible for receiving and initially verifying the data blocks from the physically connected client to ensure the initial integrity and accuracy of the data after upload to the server.

[0047] S102: The preset central program verifies the status of multiple servers under its control, generates multiple random verification number pairs, and sends the multiple random verification number pairs to servers in normal status.

[0048] Specifically, before the consensus mechanism triggers the generation of a new block, a pre-set central program first performs a critical task: verifying the current status of all servers. This step ensures that only functioning servers are included in the subsequent random verification process, effectively mitigating the risks posed by faulty servers. After completing server status verification, the central program issues a set of random verification number pairs and sends multiple random verification number pairs to healthy servers, paving the way for subsequent inter-server verification.

[0049] If the server status verification fails, a self-check will be performed and an error will be reported for repair.

[0050] S103: The server constructs the uploaded data block into a Merkle tree and performs multiple rounds of verification based on multiple random verification numbers. The private key signature of the data block in the server that passes the verification is broadcast to all servers. The server that fails the verification performs the next round of verification and self-checks.

[0051] Specifically, after receiving the verification number pair issued by the central program, each server begins constructing a Merkle tree. They organize the data blocks received during the time period into a Merkle tree for efficient data verification. Subsequently, based on the verification number pair, the servers begin mutual authentication. The designated server packages its data with its private key signature and sends it to the verification server, which then verifies it using its public key. This method ensures the authenticity and integrity of the data and effectively prevents malicious servers from sending forged data.

[0052] For data from servers that pass verification, the verification server will package the data with its private key signature and broadcast it to the entire server system to achieve data synchronization and consistency. For servers that fail verification, their data broadcast will be postponed to the next round, and a data self-check program will be initiated to check and correct any problems.

[0053] S104: After all servers complete the verification, all servers generate a new block according to the preset consensus mechanism, and use the Merkle tree to construct a Merkle-like tree in the new block, and implement database data tamper-proof detection through the Merkle-like tree.

[0054] Specifically, once all servers have completed data verification and synchronization, the consensus mechanism triggers the generation of a new block. Within this new block, a Merkle-like tree is constructed using the root node of the Merkle-like tree. The data in the new block points to the root node of the Merkle-like tree, thus representing the integrity and authenticity of all system-wide data during that time period. This design not only ensures data immutability but also provides a solid foundation for the system's subsequent operations.

[0055] like Figure 2As shown, the present invention verifies the status of the server that receives the data block so that only the server that works normally will be included in the subsequent verification process, thereby effectively avoiding the risks that may be caused by the faulty server. Afterwards, each server verifies the server data with each other according to the multiple random verification numbers generated by the central program, and packages the private key signatures of the data of the successfully verified server and broadcasts them to all servers. When all servers have completed the verification, the preset consensus mechanism is triggered to generate a new block, and the Merkle tree of all servers is used to construct a Merkle-like tree in the new block, and tamper detection is performed based on the Merkle-like tree. The present invention realizes comprehensive protection and efficient management of database data, which not only improves the integrity and authenticity of the data, but also reduces the risk of illegal tampering of the data, and can quickly restore the data after it is tampered with, and avoids the problem that the entire anti-tampering system will be bypassed or destroyed after a single central node is attacked.

[0056] Example 2

[0057] Based on the above embodiments, the present invention proposes a specific implementation of a high-performance database data tamper-proof method based on blockchain, which specifically includes:

[0058] As an emerging distributed database technology, blockchain technology, with its unique characteristics of decentralization, data immutability, and transparency, offers a new approach to addressing data security issues. Blockchain packages transaction data into blocks and links them together in chronological order, ensuring that any modification to the data affects the entire chain structure and can be easily detected. Based on blockchain technology, this paper proposes a high-performance database data tamper-proofing method. The specific implementation method is as follows:

[0059] Assume that there are five servers (labeled as S1, S2, S3, S4, S5), each server is physically connected to multiple clients, and the central program is responsible for overall control and coordination.

[0060] Client C1 generates some data and needs to upload it. Client C1 pre-processes the data, calculates a hash value, integrates the timestamp and other relevant information, and calculates the overall hash value again to form a complete data block.

[0061] Client C1 generates an encrypted log file locally, recording the upload operations and corresponding data during the time period. Client C1 uploads the data block to its physically connected server S1. Server S1 receives the data block from client C1 and performs preliminary verification to ensure the initial integrity and accuracy of the data.

[0062] The central program starts and first verifies the status of all servers, ensuring that S1, S2, S3, S4, and S5 are functioning properly. The central program issues a set of random verification number pairs and sends the private and public keys associated with each pair to different servers. Each server receives a private and public key, enabling verification between the two servers. For example, S1 verifies S2, S2 verifies S3, S3 verifies S4, S4 verifies S5, and S5 verifies S1.

[0063] Based on the verification number pair issued by the central program, server S1 starts to build a Merkle tree to organize the data blocks received during this time period.

[0064] S1 verifies S2's data: S2 packages its data with its private key signature and sends it to S1, which then verifies it using S2's public key. If S2's data passes verification, S1 packages its data with its private key signature and broadcasts it to the entire server system (S1, S2, S3, S4, S5). Similarly, S2 verifies S3, S3 verifies S4, S4 verifies S5, and S5 verifies S1, completing the mutual verification and data synchronization process across the entire system.

[0065] For servers that fail verification, for example, if S3 finds data anomalies when verifying S4, S4's data broadcast will be postponed to the next round, and S4's data self-check program will be started to check and correct possible problems.

[0066] Once all servers have completed data verification and synchronization, the consensus mechanism triggers the generation of a new block. The data in the new block will point to the root node of the Merkle-like tree, representing the integrity and authenticity of the entire system's data during that time period. This data is securely recorded on the blockchain, ensuring its immutability.

[0067] Example 3

[0068] Based on the above embodiments, Figure 3 As shown, the present invention proposes a high-performance database data tamper-proof device based on blockchain, comprising:

[0069] The preprocessing module is used to enable the client to preprocess the local data and upload the obtained data blocks to the corresponding server.

[0070] The status verification module is used to enable a preset central program to verify the status of multiple servers under its control, generate multiple random verification serial number pairs, and send the multiple random verification serial number pairs to servers in normal status.

[0071] The server verification module is used to enable the server to construct the uploaded data block into a Merkle tree and perform multiple rounds of verification based on multiple random verification numbers. The private key signature of the data block in the server that has passed the verification is broadcast to all servers. The server that has not passed the verification will perform the next round of verification and self-check.

[0072] The Merkle-like tree module is used to generate a new block according to a preset consensus mechanism after all servers complete verification, and use the Merkle-like tree to construct a Merkle-like tree in the new block, thereby realizing database data tamper-proof detection through the Merkle-like tree.

[0073] It should be noted that the embodiment of the present invention provides a high-performance database data tamper-proof device based on blockchain, which is intended to implement the above-mentioned high-performance database data tamper-proof method based on blockchain. Its specific functions can be referred to the above-mentioned method embodiments, which will not be repeated here.

[0074] Example 4

[0075] Based on the above embodiments, Figure 4 As shown, the present invention provides a high-performance database data tamper-proof system based on blockchain, including a client, a server, and a central program. The server includes N servers, each of which is physically connected to multiple clients to provide services.

[0076] Client function description:

[0077] The client is provided with a pre-processing module as described in the above embodiment. Specifically, the main functions of the client include file upload function, data query function and data self-check function.

[0078] The file upload function is mainly responsible for uploading the data generated by this client to the physically connected server, and at the same time maintains an encrypted data log locally to record the client's upload operations and data during the time period.

[0079] The data query function is mainly responsible for the client's query of server data and sends query requests to the physically connected server.

[0080] The data self-check function is used to start the client's data self-check module when the physically connected server finds that the data within the time period cannot pass the verification. It uses the encrypted data log to check the data uploaded to the physically connected server and upload the correct data again.

[0081] Server function description:

[0082] The server end is provided with a server verification module and a Merkle tree-like module as described in the above embodiment. Specifically, the main functions of the server end include building a Merkle tree function, a verification function, a broadcast function, a group tree function and a recovery function.

[0083] The Merkle tree construction function is responsible for organizing the data uploaded by the client into a special tree structure - the Merkle tree. The Merkle tree construction process involves storing and calculating the basic information and hash value of the data. In this tree structure, each layer of nodes (except the leaf nodes at the bottom) is calculated by the hash value of the nodes below it. This design ensures that any slight modification to the data will affect the hash value of the upper node, so that it can quickly detect whether the integrity of the data has been damaged. Figure 5 As shown in (a), for each node, the present invention is designed as {tree_id (tree ID), nodeID (node ID), currentNodeHash (current node hash), leftID (left child node ID), rightID (right child node ID), leftHash (left child node hash), rightHash (right child node hash), parentID (parent node ID), dataID (data ID)}, in which nodeID refers to the ID of each node in the tree structure. Unlike the traditional notation, nodeID starts counting from 0 at the lower left corner of the tree structure, from left to right, from the lower layer to the upper layer, and so on. tree_id is used to locate and identify the Merkle tree. The present invention adds parentID, that is, the nodeID of the parent node of the child node. This design scheme facilitates the rapid verification of data nodes until the root node.

[0084] Verification function is a key link to ensure the authenticity and integrity of data. It realizes mutual verification between servers based on the random verification serial number issued by the central program. Figure 6 As shown in Figure 1, during the verification process, one server is assigned to verify the data of another server. The verified server packages its data with a private key signature and sends it to the verification server, which then verifies it using its public key. This step effectively prevents malicious servers from sending false data, ensuring the authenticity of the data. For example, in this verification round, the i-th server is assigned by the central program to verify the data of the k-th server within a certain time period, where 1≤i≤N, 1≤k≤N, and i≠k. At this time, the k-th server packages the private key signature of the data within this time period and sends it to the i-th server. The i-th server verifies the data using the k-th server's public key, preventing other malicious servers from sending false data. After verification, the server verifies whether the data within this time period is correct.

[0085] The broadcast function is used to synchronize the verified data to the entire server system to achieve data consistency. When the data of a server passes the verification, the verification server will package the private key signature of its data and broadcast it to all servers. In this way, all servers can synchronize the correct data, ensuring the global consistency and reliability of the data. Figure 5 As shown in (b); the above example illustrates that after the i-th server verifies that the data of the k-th server is correct, the i-th server will replace the data packet of the k-th server with its own signature and broadcast it to the entire server system, so that the entire system can synchronize the correct data of the k-th server.

[0086] Group tree features such as Figure 5 As shown in (c), the Merkle trees of the data broadcast by all servers are merged into a larger tree, here called a quasi-Merkle tree. After receiving all broadcasts, the server has the correct data for the entire system consensus during that time period. At this point, the server constructs a Merkle tree for the root node of the tree structure within this data, forming a quasi-Merkle tree containing all the data. The root node of this quasi-Merkle tree is the data that is ultimately uploaded to the chain, representing the integrity and authenticity of the entire system data during that time period.

[0087] The recovery function is a handling measure for a server chain node that has been tampered with. When it is detected that the hash value of a block is inconsistent with the hash value in the data, the node is considered to have been tampered with. At this time, the server will discard the block and all subsequent blocks and data, and use the broadcast function to request the data of these blocks from other servers in the system. For example, if the current blockchain height is L, and it is found that the current hash value of the jth block is inconsistent with the hash value in the data, the node is considered to have been tampered with. The server will discard the jth block and all blocks and data between j and L, and use the broadcast function to request the jth block and all subsequent block data from other servers in the system; at the same time, this function can also synchronize the latest block data of the entire system for the newly expanded server in a timely manner. The new server only needs to request all blocks. This design ensures that the system can recover quickly and maintain consistency when facing data tampering.

[0088] Center program function description:

[0089] The central program includes the status verification module described in the above embodiment. Specifically, the central program includes the function of verifying the server status and generating a random verification serial number. In addition, the central program also includes the consensus mechanism function and the function of registering or deregistering the server.

[0090] Verifying server status is a crucial pre-processing step before the central program initiates random server verification. It comprehensively checks the status of all servers in the system, ensuring that only functioning servers are included in random verification, effectively mitigating system risks that could arise from faulty servers participating in verification.

[0091] The function of generating random verification numbers is the key to the central program's construction of a closed-loop verification system. In each round of verification, this function randomly assigns a verified serial number pair to all servers in normal status, thus forming a tightly connected verification chain. For example, in a system containing N normal servers, the following verification serial number pairs may be randomly generated: the first server verifies the second server (1, 2), the second server verifies the third server (2, 3), and so on, until the N-1th server verifies the Nth server (N-1, N), and finally the Nth server verifies the first server (N, 1). This design not only ensures the breadth and randomness of verification, but also cleverly constructs a closed-loop verification system, further improving the security and reliability of the system. It should be noted that the above examples are only provided to help understanding and do not represent the specific serial number pair allocation in the actual verification process.

[0092] The consensus mechanism is the core mechanism that ensures that all servers can coordinate and synchronize the generation of new blocks. This mechanism operates within the framework of blockchain technology and ensures the continuity and consistency of system data.

[0093] The server registration and deregistration feature is a flexible mechanism designed to dynamically adjust and maintain the server population. This feature allows the system to easily handle increases and decreases in server capacity, whether adding servers to increase processing capacity or removing servers due to failures.

[0094] In summary, this invention achieves comprehensive protection and efficient management of database data, improving data integrity and authenticity while reducing the risk of illegal data tampering. It also allows for rapid data recovery after tampering and avoids the risk of the entire anti-tampering system being bypassed or compromised by attacks on a single central node. Furthermore, through the collaborative work of the client, server, and central program, rapid data synchronization and consistency are achieved, improving the overall performance and stability of the system.

[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A high-performance database data tamper-proof method based on blockchain, characterized in that: include: Step 1: The client preprocesses the local data to obtain preprocessed data blocks, and uploads the data blocks to the corresponding server; Step 2: The preset central program verifies the status of multiple servers under its control, generates multiple random verification number pairs, and sends the multiple random verification number pairs to servers in normal status; Step 3: The server constructs the uploaded data block into a Merkle tree and performs multiple rounds of verification based on multiple random verification numbers. The private key signatures of the data blocks in the servers that pass the verification are broadcast to all servers. Servers that fail the verification will undergo the next round of verification and self-check. Step 4: After all servers complete the verification, they generate a new block according to the preset consensus mechanism, and use the Merkle tree to construct a Merkle-like tree in the new block, and implement database data tamper-proof detection through the Merkle-like tree.

2. A high-performance database data tamper-proof method based on blockchain according to claim 1, characterized in that: The pretreatment includes: Calculate the hash value of local data separately, integrate the hash value, timestamp and other relevant information of the local data, calculate the overall hash value again, and obtain the data block.

3. A high-performance database data tamper-proof method based on blockchain according to claim 1, characterized in that: The sending of multiple random verification sequence number pairs to a server in a normal state specifically includes: The central program generates multiple random verification number pairs, and sends the private key and public key of each random verification number pair to different servers respectively. Each server receives a private key and a public key.

4. A high-performance database data tamper-proof method based on blockchain according to claim 1, characterized in that: The multiple servers controlled by the central program perform multiple rounds of verification according to multiple random verification serial numbers, broadcast the private key signatures of the data blocks in the servers that pass the verification to all servers, and the servers that fail the verification perform the next round of verification and self-check, specifically including: Each server packages the private key signature of the data for the preset time period and sends it to the server that receives the public key corresponding to its private key; The server that receives the data private key signature uses the corresponding public key to verify the data private key signature. If the verification is successful, the server that receives the data private key signature will package the data private key signature and broadcast it to all servers. If the verification fails, the server that sends the data private key signature will perform data self-inspection and correction and proceed to the next round of verification.

5. A high-performance database data tamper-proof method based on blockchain according to claim 1, characterized in that: After all servers complete verification, they generate a new block according to a preset consensus mechanism and construct a Merkle-like tree in the new block using the Merkle tree, specifically including: When all servers complete verification, each server receives the Merkle tree of all servers, and all servers generate a new block according to the preset consensus mechanism; Each server constructs a Merkle tree using the root node of the Merkle tree in the new block to obtain a Merkle-like tree; wherein the data of the new block points to the root node of the Merkle-like tree.

6. A high-performance database data tamper-proof method based on blockchain according to claim 5, characterized in that: The Merkle-like tree includes multiple Merkle trees, and the root node of the Merkle-like tree includes on-chain data.

7. A high-performance database data tamper-proof method based on blockchain according to claim 1, characterized in that: The Merkle tree includes a tree ID, a node ID, a current node hash, a left child node ID, a right child node ID, a left child node hash, a right child node hash, a parent node ID, and a data ID; The node IDs are counted starting from 0 from the lower left corner of the tree structure in order from left to right and from the lower layer to the upper layer.

8. A high-performance database data tamper-proof method based on blockchain according to claim 1, characterized in that: The implementation of database data tamper-proof detection through a Merkle-like tree specifically includes: When the server detects that the hash value in a block is inconsistent with the hash value in the data, the server will discard the block and all subsequent blocks and data; The server uses broadcasting to request discarded blocks and data from other servers, and reconstructs the discarded blocks and data based on the data sent by other servers.

9. A high-performance database data tamper-proof device based on blockchain, characterized in that: include: The preprocessing module is used to enable the client to preprocess the local data, obtain the preprocessed data blocks, and upload the data blocks to the corresponding server; A status verification module is used to enable a preset central program to verify the status of multiple servers under its control, generate multiple random verification serial number pairs, and send the multiple random verification serial number pairs to servers in normal status; The server verification module is used to enable the server to construct the uploaded data block into a Merkle tree and perform multiple rounds of verification based on multiple random verification serial numbers. The private key signatures of the data blocks in the servers that pass the verification are broadcast to all servers. Servers that fail the verification will undergo the next round of verification and self-check. The Merkle-like tree module is used to generate a new block according to a preset consensus mechanism after all servers complete verification, and use the Merkle-like tree to construct a Merkle-like tree in the new block, thereby realizing database data tamper-proof detection through the Merkle-like tree.

10. A high-performance database data tamper-proof system based on blockchain, client, server and central program, characterized in that: The client is provided with the preprocessing module as claimed in claim 9, the server verification module and the Merkle tree-like module as claimed in claim 9 are provided on the server, and the central program includes the status verification module as claimed in claim 9.