A data synchronization method and related device based on blockchain

By adopting a blockchain-based distributed verification mechanism in cloud-edge collaboration data synchronization, the data synchronization security problem caused by insufficient security at edge nodes is solved, and higher data synchronization security is achieved.

CN114710508BActive Publication Date: 2025-04-25BEIJING 21VIANET DATA CENT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210367814.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-08
Publication Date
2025-04-25
Estimated Expiration
2042-04-08

AI Technical Summary

Technical Problem

During the data synchronization process of cloud-edge collaboration, the security measures of edge nodes are weak, resulting in low security of data synchronization. Especially after the edge node is broken, it may cause the risk of the entire system data being monitored and stolen.

Method used

The blockchain-based data synchronization method is adopted, and any core cloud node responds to the data synchronization request of the edge node, verifies the hash value in the data synchronization request, and obtains the hash value verification results of other core cloud nodes. Based on the verification results of multiple core cloud nodes, the node verification results of the edge node are determined, and then decides whether to perform data synchronization.

Benefits of technology

Through the distributed verification and authentication mechanism, the security of data synchronization is improved. Even if the edge nodes are compromised, they cannot pass the authentication of all core cloud nodes, thereby effectively preventing data from being stolen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114710508B_ABST
    Figure CN114710508B_ABST
Patent Text Reader

Abstract

The present application relates to the field of blockchain technology, and in particular to a blockchain-based data synchronization method and related devices. The blockchain network includes multiple core cloud nodes and edge computing nodes. Any core cloud node responds to a data synchronization request sent by the edge node, verifies the hash value in the data synchronization request, and determines a hash value verification result corresponding to the hash value; wherein the data synchronization request includes the data to be synchronized and the hash value obtained by the edge node; the hash value verification results corresponding to each of the other core cloud nodes are obtained, and based on each hash value verification result, the node verification result of the edge node is determined; based on the node verification result, the data to be synchronized is synchronized, so that the security of data synchronization can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a blockchain-based data synchronization method and related devices. Background Art

[0002] With the development of Internet technology, more and more applications need to be deployed to the edge to achieve closer to users and faster interaction. Cloud-edge collaboration is a very important feature and requirement in edge computing, including resource collaboration, application collaboration, data collaboration, intelligent collaboration and other types of collaboration.

[0003] In cloud-edge collaborative data synchronization, due to the large number of edge nodes and the weaker security measures for edge nodes than for core cloud nodes, the data security is not high during the data synchronization process.

[0004] In related technologies, when performing data synchronization for cloud-edge collaboration, an encrypted transmission method is usually adopted between nodes to encrypt the channel between the edge node and the core cloud node. When the data reaches the core cloud node, the core cloud node decrypts and uploads it, thereby achieving data synchronization.

[0005] However, since the relevant technology encrypts the channel between an edge node and a core cloud node, when the edge computing node is compromised, it can send illegal data synchronization requests to the core cloud node, causing the entire system data to be monitored and stolen. Therefore, verifying and decrypting the edge node only through a core cloud node will reduce the security of data synchronization. Summary of the invention

[0006] The embodiments of the present application provide a blockchain-based data synchronization method and related devices to improve the security of data synchronization.

[0007] The specific technical solutions provided by the embodiments of this application are as follows:

[0008] A data synchronization method based on blockchain, wherein the blockchain network includes multiple core cloud nodes and edge nodes, and the method includes:

[0009] Any core cloud node verifies the hash value in the data synchronization request in response to the data synchronization request sent by the edge node, and determines the hash value verification result corresponding to the hash value; wherein the data synchronization request includes the data to be synchronized and the hash value obtained by the edge node;

[0010] Obtaining hash value verification results corresponding to each other core cloud node, and determining the node verification result of the edge node based on each hash value verification result;

[0011] Based on the node verification result, data synchronization is performed on the data to be synchronized.

[0012] Optionally, verifying the hash value in the data synchronization request to determine a hash value verification result corresponding to the hash value specifically includes:

[0013] Based on the node identifier corresponding to any one of the core cloud nodes, determine the corresponding hash value sequence information;

[0014] Based on the hash value sequence information, determining a corresponding node hash value from the hash values, wherein the hash values ​​include a node hash value corresponding to each core cloud node, and each node hash value is arranged based on a preset order;

[0015] Based on the node hash value and in combination with preset hash value authentication rules, a hash value verification result is determined.

[0016] Optionally, determine the hash value verification result, including:

[0017] If it is determined that the node hash value is the same as the pre-stored standard node hash value, then the corresponding hash value verification result is determined to be passed;

[0018] If it is determined that the node hash value is different from the standard node hash value, the corresponding hash value verification result is determined to be failed.

[0019] Optionally, based on each hash value verification result, determining a node verification result of the edge node specifically includes:

[0020] From each hash value verification result, determine the number of hash value verification results that pass as the number of results corresponding to the edge node;

[0021] If it is determined that the number of results is not less than a preset number threshold, determining that the node verification result corresponding to the edge node is passed;

[0022] If it is determined that the number of results is less than a preset number threshold, then it is determined that the node verification result corresponding to the edge node is failed.

[0023] Optionally, based on the node verification result, synchronizing the data to be synchronized specifically includes:

[0024] If it is determined that the node verification result is passed, a preset data synchronization method is used to synchronize the data to be synchronized;

[0025] If it is determined that the node verification result is failed, the edge node is determined to be a problem node, and based on the node verification result, an alarm message is generated, and the alarm message is sent to the client for display.

[0026] Optionally, a preset data synchronization method is used to synchronize the data to be synchronized, including:

[0027] Read the node permission type, where the node permission type is either with packaging permission or without permission;

[0028] If it is determined that the node permission type has packaging permission, the data to be synchronized is packaged to obtain updated data, and the updated data is stored in a preset system database;

[0029] If it is determined that the node authority type is no authority, a synchronization instruction is sent to the core cloud node whose node authority type is with packaging authority, so that the core cloud node whose node authority type is with packaging authority packages the data to be synchronized, obtains updated data, and stores the updated data in the system database.

[0030] A data synchronization method based on blockchain, wherein the blockchain network includes multiple core cloud nodes and edge computing nodes, and the method includes:

[0031] The edge node obtains the data to be synchronized, and determines a hash value;

[0032] Generate a data synchronization request including the data to be synchronized and the hash value;

[0033] The data synchronization request is sent to the multiple core cloud nodes respectively, so that the multiple core cloud nodes respectively respond to the data synchronization request sent by the edge node, verify the hash value in the data synchronization request, determine the hash value verification result corresponding to the hash value, obtain the hash value verification result corresponding to each other core cloud node, and determine the node verification result of the edge node based on each hash value verification result, and synchronize the data to be synchronized based on the node verification result.

[0034] A data synchronization device based on blockchain, wherein the blockchain network includes multiple core cloud nodes and edge nodes, and the device is applied to any core cloud node, and the device includes:

[0035] A verification module, used for any core cloud node to respond to the data synchronization request sent by the edge node, verify the hash value in the data synchronization request, and determine the hash value verification result corresponding to the hash value; wherein the data synchronization request includes the data to be synchronized and the hash value obtained by the edge node;

[0036] A determination module, used to obtain the hash value verification results corresponding to each other core cloud node, and determine the node verification result of the edge node based on each hash value verification result;

[0037] A processing module is used to synchronize the data to be synchronized based on the node verification result.

[0038] Optionally, the hash value in the data synchronization request is verified to determine a hash value verification result corresponding to the hash value, and the verification module is further used to:

[0039] Based on the node identifier corresponding to any one of the core cloud nodes, determine the corresponding hash value sequence information;

[0040] Based on the hash value sequence information, determining a corresponding node hash value from the hash values, wherein the hash values ​​include a node hash value corresponding to each core cloud node, and each node hash value is arranged based on a preset order;

[0041] Based on the node hash value and in combination with preset hash value authentication rules, a hash value verification result is determined.

[0042] Optionally, when determining the hash value verification result, the verification module is further used to:

[0043] If it is determined that the node hash value is the same as the pre-stored standard node hash value, then the corresponding hash value verification result is determined to be passed;

[0044] If it is determined that the node hash value is different from the standard node hash value, the corresponding hash value verification result is determined to be failed.

[0045] Optionally, when determining the node verification result of the edge node based on each hash value verification result, the determination module is further used to:

[0046] From each hash value verification result, determine the number of hash value verification results that pass as the number of results corresponding to the edge node;

[0047] If it is determined that the number of results is not less than a preset number threshold, determining that the node verification result corresponding to the edge node is passed;

[0048] If it is determined that the number of results is less than a preset number threshold, then it is determined that the node verification result corresponding to the edge node is failed.

[0049] Optionally, the processing module is further used for:

[0050] If it is determined that the node verification result is passed, a preset data synchronization method is used to synchronize the data to be synchronized;

[0051] If it is determined that the node verification result is failed, the edge node is determined to be a problem node, and based on the node verification result, an alarm message is generated, and the alarm message is sent to the client for display.

[0052] Optionally, when synchronizing the data to be synchronized using a preset data synchronization method, the processing module is further configured to:

[0053] Read the node permission type, where the node permission type is either with packaging permission or without permission;

[0054] If it is determined that the node permission type has packaging permission, the data to be synchronized is packaged to obtain updated data, and the updated data is stored in a preset system database;

[0055] If it is determined that the node authority type is no authority, a synchronization instruction is sent to the core cloud node whose node authority type is with packaging authority, so that the core cloud node whose node authority type is with packaging authority packages the data to be synchronized, obtains updated data, and stores the updated data in the system database.

[0056] A data synchronization device based on blockchain, wherein the blockchain network includes multiple core cloud nodes and edge nodes, and the device is applied to the edge nodes, and the device includes:

[0057] An acquisition module, used to acquire data to be synchronized and determine a hash value;

[0058] A generating module, used for generating a data synchronization request including the data to be synchronized and the hash value;

[0059] A processing module is used to send the data synchronization request to the multiple core cloud nodes respectively, so that the multiple core cloud nodes respectively respond to the data synchronization request sent by the edge node, verify the hash value in the data synchronization request, determine the hash value verification result corresponding to the hash value, obtain the hash value verification result corresponding to each other core cloud node, and determine the node verification result of the edge node based on each hash value verification result, and synchronize the data to be synchronized based on the node verification result.

[0060] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned blockchain-based data synchronization method when executing the program.

[0061] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-mentioned blockchain-based data synchronization method.

[0062] In the embodiment of the present application, any core cloud node responds to the data synchronization request sent by the edge node, verifies the hash value in the data synchronization request, determines the hash value verification result corresponding to the hash value, the data synchronization request includes the data to be synchronized and the hash value obtained by the edge node, obtains the hash value verification results corresponding to each other core cloud node, and determines the node verification result of the edge node based on each hash value verification result, and synchronizes the data to be synchronized based on the node verification result. In this way, when the edge node initiates a data synchronization request, it is necessary to determine the node verification result of the edge node based on the hash value verification result corresponding to each core cloud node in the group, and realize data synchronization based on the node verification result, converting the single-point authentication into distributed authentication. Even if the edge node is hacked, it cannot pass the authentication of all core cloud nodes, thereby improving the security of data synchronization. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 A schematic diagram of a scenario of a data synchronization method based on blockchain in an embodiment of the present application;

[0064] Figure 2 This is a flowchart of a data synchronization method based on blockchain in an embodiment of the present application;

[0065] Figure 3 This is a diagram of the blockchain block structure in the embodiment of this application;

[0066] Figure 4 Another flow chart of the data synchronization method based on blockchain in an embodiment of the present application;

[0067] Figure 5 This is a schematic diagram of the structure of a data synchronization device based on blockchain in an embodiment of the present application;

[0068] Figure 6 This is a schematic diagram of the structure of another blockchain-based data synchronization device in an embodiment of the present application;

[0069] Figure 7 Schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0070] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0071] With the digital transformation and upgrading of enterprises and the rapid development of industrial Internet, more and more applications need to be deployed at the edge to achieve closer proximity to users, faster interaction, and more lossless information transmission, such as telemedicine, industrial control, and Internet of Vehicles. Edge cloud is a major trend in the current development of cloud computing.

[0072] Edge cloud enables distributed deployment of computing, storage, and network capabilities closer to users. In edge computing in cloud-edge collaboration scenarios, a large amount of information needs to be transmitted between core cloud nodes and edge nodes. Cloud-edge collaboration is a very important feature and requirement in edge computing, including resource collaboration, application collaboration, data collaboration, and intelligent collaboration.

[0073] In cloud-edge collaborative data synchronization, due to the large number of edge nodes and the relatively weaker security measures of edge nodes compared to core cloud nodes, the risks of leakage from edge nodes and illegal data uploading from edge nodes must be prevented and controlled during data synchronization.

[0074] In the related art, when performing data synchronization in cloud-edge collaboration, data synchronization can usually be achieved through the following two methods.

[0075] The first method: The edge node uploads and synchronizes the data transmitted from the user side to the nearest core cloud node through an encrypted channel, or uploads and synchronizes to the core cloud node to which it belongs. Then, the core cloud node receives the data through the encrypted channel, and when it verifies that there is no problem with the received data, it stores the data in the system database. Based on the actual requirements of the system and application, the core cloud node decides whether to synchronize the data to other edge nodes.

[0076] The second method: The edge node uploads and synchronizes the data transmitted from the user side to the nearest core cloud node through data encryption, or uploads and synchronizes to the core cloud node to which it belongs. Then, the core cloud node decrypts the received data and stores the data in the system database when it verifies that there is no problem with the received data. Based on the actual requirements of the system and application, the core cloud node decides whether to synchronize the data to other edge nodes.

[0077] However, the data synchronization method of the cloud-edge collaboration scenario in the related technology is essentially still a single-point verification update method, which also encrypts the channel between an edge node and a core cloud node, or encrypts the data transmitted between an edge node and a core cloud node. Therefore, when the edge node is compromised, it can initiate illegal data synchronization requests to the core cloud node, causing the entire system data to be tampered with, damaged, or eavesdropped and stolen, which poses a greater security risk and reduces the security of data synchronization.

[0078] In order to solve the above problems, in an embodiment of the present application, a data synchronization method based on blockchain is provided, in which any core cloud node responds to a data synchronization request sent by an edge node, verifies the hash value in the data synchronization request, and determines the hash value verification result corresponding to the hash value. The data synchronization request includes the data to be synchronized and the hash value obtained by the edge node, obtains the hash value verification results corresponding to each other core cloud node, and determines the node verification result of the edge node based on each hash value verification result, and synchronizes the data to be synchronized based on the node verification result. In this way, data synchronization changes from single-point encryption and single-point authentication to distributed verification and authentication. Any edge node that initiates a data synchronization request needs to be verified by all core cloud nodes in the group before data synchronization can be performed, thereby improving the security of data synchronization.

[0079] Based on the above embodiments, see Figure 1 As shown, it is a schematic diagram of a scenario of a data synchronization method based on blockchain in an embodiment of the present application, which specifically includes:

[0080] The core cloud nodes and edge nodes in the original cloud computing are grouped and classified, and each edge node belongs to a group of core cloud nodes. Therefore, the blockchain network contains multiple node groups, and each node group contains an edge node and multiple core cloud nodes.

[0081] like Figure 1 As shown, the core cloud nodes in the blockchain network are A, B, C, D, and E, and the edge nodes are a, b, c, d, e, f, g, h, i, j, and k. The core cloud nodes and edge nodes are grouped and classified. Edge node a, core cloud node A, core cloud node B, and core cloud node C are grouped into one group, edge node f, core cloud node B, core cloud node C, and core cloud node D are grouped into one group, and edge node j, core cloud node C, core cloud node D, and core cloud node E are grouped into one group.

[0082] Each core cloud node in a group, as a shareholder node of the blockchain, specifies and authorizes a part of the core cloud nodes in a group to have the power of blockchain accounting and data storage. Each core cloud node verifies the hash value in the data synchronization request, determines the hash value verification result corresponding to the hash value, obtains the hash value verification result corresponding to each other core cloud node in the group, and determines the node verification result of the edge node based on each hash value verification result, and synchronizes the data to be synchronized based on the node verification result.

[0083] The edge computing nodes in a group, as ordinary nodes of the blockchain, receive the data to be synchronized from the user or automatically obtained from the system, generate data synchronization requests based on the data to be synchronized, and send data synchronization requests to each core cloud node in a group.

[0084] Based on the above embodiments, see Figure 2 As shown, it is a flowchart of a data synchronization method based on blockchain in an embodiment of the present application, which specifically includes:

[0085] S20: Any core cloud node verifies the hash value in the data synchronization request in response to the data synchronization request sent by the edge node, and determines a hash value verification result corresponding to the hash value.

[0086] The data synchronization request includes the data to be synchronized and the hash value obtained by the edge node.

[0087] In an embodiment of the present application, the blockchain network includes multiple core cloud nodes and one edge node. The edge node sends a data synchronization request to each core cloud node in the blockchain network. Therefore, after receiving the data synchronization request sent by the edge node, any core cloud node responds to the received data synchronization request and verifies the hash value in the data synchronization request, thereby obtaining a hash value verification result corresponding to the hash value.

[0088] The data to be synchronized is update data received by the edge node from the user or automatically acquired by the system. The update data may be, for example, local temperature, humidity and other information acquired by industrial sensors, which is not limited in the embodiments of the present application.

[0089] Optionally, in an embodiment of the present application, a possible implementation method is provided for determining a hash value verification result corresponding to a hash value. The process of determining the hash value verification result in an embodiment of the present application is described in detail below, specifically including:

[0090] S201: Based on the node identifier corresponding to any core cloud node, determine the corresponding hash value sequence information.

[0091] In the embodiment of the present application, since each core cloud node in the blockchain network corresponds to a node hash value, and the hash value is generated by arranging the node hash values ​​corresponding to each core cloud node in a preset order, each core cloud node is associated with corresponding hash value sequence information, so that the hash value sequence information associated with any core cloud node can be determined based on the node identifier corresponding to the core cloud node.

[0092] It should be noted that the hash value sequence information in the embodiment of the present application is used to indicate the order of the node hash value corresponding to a core cloud node in the hash value.

[0093] In addition, it should be noted that in the embodiment of the present application, each core cloud node corresponds to a hash value sequence information. For example, the node identifier of core cloud node A is 1, and the hash value sequence information associated with node identifier 1 is the first. Then the node hash value corresponding to the core cloud node is arranged in the first place among the hash values ​​of each node.

[0094] S202: Based on the hash value sequence information, determine the corresponding node hash value from the hash value.

[0095] The hash value includes the node hash value corresponding to each core cloud node, and the node hash values ​​are arranged based on a preset order.

[0096] In the embodiment of the present application, after obtaining the hash value sequence information, the corresponding node hash value can be determined from the node hash values ​​arranged in sequence.

[0097] For example, assuming that the hash values ​​are 99, 100, 20, and 31, the node identifier corresponding to core cloud node A is 1, the node identifier corresponding to core cloud node B is 2, the node identifier corresponding to core cloud node C is 3, and the node identifier corresponding to core cloud node D is 4. If the core cloud node is core cloud node B, then according to the node identifier 2 corresponding to core cloud node B, the corresponding hash value sequence information is determined to be the third, and therefore, according to the hash value sequence information, the node hash value corresponding to the core cloud node is determined to be 20 from the hash value.

[0098] It should be noted that in the embodiment of the present application, different core cloud nodes in the group are each set with a different blockchain verification password, and the node hash value is generated based on the blockchain verification password corresponding to the core cloud node in combination with the hash algorithm. Since the blockchain verification password in the embodiment of the present application is transmitted after being calculated by the hash algorithm, rather than transmitted in plain text, the security of data synchronization can be improved.

[0099] S203: Determine a hash value verification result based on the node hash value and in combination with a preset hash value authentication rule.

[0100] In an embodiment of the present application, a hash value verification result is determined based on a node hash value in combination with a preset hash value authentication rule. Specifically, the hash value verification result can be determined by a corresponding node hash value verification result.

[0101] Optionally, in an embodiment of the present application, a possible implementation method is provided for determining the hash value verification result. The process of determining the hash value verification result in an embodiment of the present application is described in detail below, specifically including:

[0102] S203-1: If it is determined that the node hash value is the same as the pre-stored standard node hash value, then the corresponding hash value verification result is determined to be passed.

[0103] In an embodiment of the present application, it is determined whether the node hash value is the same as the pre-stored standard node hash value. If it is determined that the node hash value is the same as the pre-stored standard node hash value, the corresponding hash value verification result is determined to be passed.

[0104] S203-2: If it is determined that the node hash value is different from the standard node hash value, the corresponding hash value verification result is determined to be failed.

[0105] In an embodiment of the present application, it is determined whether the node hash value is the same as a pre-stored standard node hash value. If it is determined that the node hash value is different from the pre-stored standard node hash value, the corresponding hash value verification result is determined to be failed.

[0106] It should be noted that in the embodiment of the present application, the legality and compliance of the data to be synchronized in this application will also be verified to ensure that the data to be synchronized is legal data.

[0107] S21: Obtain the hash value verification results corresponding to each other core cloud node, and determine the node verification result of the edge node based on each hash value verification result.

[0108] In an embodiment of the present application, the hash value verification results corresponding to each other core cloud node are obtained, and based on each hash value verification result, the node verification result of the edge node is determined.

[0109] Optionally, in an embodiment of the present application, a possible implementation method is provided to determine the hash value verification results corresponding to each core cloud node. The process of determining the node verification result of the edge node in an embodiment of the present application is described in detail below, specifically including:

[0110] S211: Determine the number of hash value verification results that pass from each hash value verification result as the number of results corresponding to the edge node.

[0111] In the embodiment of the present application, since the hash value verification results are divided into pass and fail, the number of hash value verification results that are pass is counted among the hash value verification results, and the determined number is used as the result number corresponding to the edge node.

[0112] For example, assuming that the hash value verification result corresponding to core cloud node A is passed, the hash value verification result corresponding to core cloud node B is passed, the hash value verification result corresponding to core cloud node C is failed, and the hash value verification result corresponding to core cloud node D is passed, then the number of hash value verification results that pass is determined to be 3, and therefore, the number of results corresponding to edge nodes is 3.

[0113] S212: If the number of determination results is not less than a preset number threshold, then the node verification result corresponding to the edge node is determined to be passed.

[0114] In the embodiment of the present application, it is determined whether the number of results is not less than a preset number threshold. If it is determined that the number of results is not less than the preset number threshold, the node verification result corresponding to the edge node is determined to be passed.

[0115] For example, assuming that the number of results is 10 and the preset number threshold is 9, it is determined that the node verification result corresponding to the edge node is passed.

[0116] It should be noted that the quantity threshold in the embodiment of the present application is determined based on the number of core cloud nodes and the verification success percentage.

[0117] For example, assuming that the number of core cloud nodes is 20 and the verification success percentage is 90%, the calculated quantity threshold is 18, that is, if the number of determination results is greater than or equal to 18, the node verification result corresponding to the edge node is determined to be passed; if the number of determination results is less than 18, the node verification result corresponding to the edge node is determined to be failed.

[0118] S213: If the number of determination results is less than a preset number threshold, it is determined that the node verification result corresponding to the edge node is failed.

[0119] In the embodiment of the present application, it is determined whether the number of results is not less than a preset number threshold. If it is determined that the number of results is less than the preset number threshold, the node verification result corresponding to the edge node is determined to be failed.

[0120] For example, assuming that the number of results is 7 and the preset number threshold is 9, it is determined that the node verification result corresponding to the edge node is failed.

[0121] Optionally, in an embodiment of the present application, a possible implementation method is also provided for determining the node verification result corresponding to the edge node, specifically: counting the number of passed results of each hash value verification result, and determining the ratio between the passed number and the number of nodes of all core cloud nodes based on the number of results corresponding to the passed results of each hash value verification result; if it is determined that the calculated ratio is not less than a preset ratio threshold, then the node verification result corresponding to the edge node is determined to be passed; if it is determined that the calculated ratio is less than the preset ratio threshold, then the node verification result corresponding to the edge node is determined to be failed.

[0122] For example, assuming that the number of passed results of each hash value verification is 10, and there are 20 core cloud nodes in total, then the number of results corresponding to the passed results of each hash value verification is 10, and the ratio between the calculated passed number and the number of all core cloud nodes is 0.5. It is determined that the calculated ratio 0.5 is less than the preset ratio threshold 0.8, then the node verification result corresponding to the edge node is determined to be failed.

[0123] For another example, assuming that the number of hash value verification results passed is 9, and there are 10 core cloud nodes in total, then the number of results corresponding to the passing results of each hash value verification result is 9, and the ratio between the calculated passing number and the number of all core cloud nodes is 0.9. It is determined that the calculated ratio 0.9 is greater than the preset ratio threshold value 0.8, then it is determined that the hash value verification results of the core cloud nodes in the group have reached the ratio threshold, and the node verification result corresponding to the edge node is determined to be passed, and the edge node passes the authentication.

[0124] S22: Based on the node verification result, synchronize the data to be synchronized.

[0125] In the embodiment of the present application, after obtaining the node verification result, data synchronization can be performed on the data to be synchronized in the data synchronization request based on the node verification result.

[0126] Optionally, in an embodiment of the present application, a possible implementation method is provided for synchronizing the data to be synchronized based on the node verification result. The following is a detailed description of the data synchronization process for the data to be synchronized in an embodiment of the present application, specifically including:

[0127] S221: If it is determined that the node verification result is passed, a preset data synchronization method is used to synchronize the data to be synchronized.

[0128] S2211: Read node permission type.

[0129] Among them, the node permission types are packaging permission and no permission.

[0130] In the embodiment of the present application, each core cloud node corresponds to a node permission type, and the node permission type is divided into packaging permission and no permission. Therefore, its own node permission type is read.

[0131] Among them, the specific packaging authority represents that the core cloud node has the authority to package the data to be synchronized, and the no-authority represents that the core cloud node does not have the authority to package the data to be synchronized.

[0132] S2212: If it is determined that the node permission type has packaging permission, the data to be synchronized is packaged to obtain updated data, and the updated data is stored in a preset system database.

[0133] In an embodiment of the present application, if it is determined that the node permission type has packaging permission, the data to be synchronized in the data synchronization request is packaged and uploaded to the chain, the updated data is obtained, and the updated data is stored in a preset system database.

[0134] S2213: If it is determined that the node permission type is no permission, a synchronization instruction is sent to the core cloud node whose node permission type is with packaging permission, so that the core cloud node whose node permission type is with packaging permission packages the data to be synchronized, obtains the updated data, and stores the updated data in the system database.

[0135] In an embodiment of the present application, if it is determined that the node permission type is no permission, a synchronization instruction is sent to the core cloud node whose node permission type is with packaging permission, so that the core cloud node corresponding to the node permission type with packaging permission packages the data to be synchronized, obtains the updated data, and stores the updated data in the system database, thereby realizing the synchronous processing of the data to be synchronized.

[0136] For example, see Figure 3 As shown, it is a diagram of the blockchain block composition in an embodiment of the present application. Each block is used to package verification and data update information, and the hash value is composed of the hash value of each node.

[0137] S222: If it is determined that the node verification result is failed, the edge node is determined to be a problem node, and based on the node verification result, an alarm message is generated, and the alarm message is sent to the client for display.

[0138] In an embodiment of the present application, if it is determined whether the node verification result is failed, the edge node is determined to be a problem node, and relevant alarm information is generated based on the node verification result. The generated alarm information is sent to the client for display, so that the administrator can determine the working status of the edge node and decide whether the edge node needs to be removed from service.

[0139] In the embodiment of the present application, the data synchronization process is changed from the original single-point encryption and single-point authentication to distributed verification and authentication. Any edge node that initiates data synchronization needs to be verified by all core cloud nodes in the group. Only when the number of core cloud nodes whose hash value verification results pass exceeds the preset number threshold can the data be synchronized, thereby ensuring the security of data synchronization. In addition, in the embodiment of the present application, multi-password hash authentication is adopted, and the verification password of each core cloud node is different. Therefore, the node hash value of each core cloud node is different, avoiding the risk of a single verification password being easily attacked and cracked. In addition, in the embodiment of the present application, in the data synchronization request, the verification password is not sent in plain text, and the hash value results of each node are arranged in order. Even if the message is intercepted in time, the password cannot be cracked, further improving the security of data synchronization.

[0140] Based on the above embodiments, see Figure 4 As shown, it is another flow chart of the data synchronization method based on blockchain in an embodiment of the present application, which specifically includes:

[0141] S40: Acquire the data to be synchronized, and determine the hash value.

[0142] In an embodiment of the present application, the edge node receives the data to be synchronized, and determines the hash value corresponding to each core cloud node.

[0143] It should be noted that when edge nodes receive data to be synchronized, there are two ways: the first way is to receive data to be synchronized uploaded by users; the second way is to receive data to be synchronized automatically acquired by the system.

[0144] The data to be synchronized may be, for example, local temperature, humidity and other information obtained by industrial sensors, which is not limited in the embodiments of the present application.

[0145] S41: Generate a data synchronization request including the data to be synchronized and the hash value.

[0146] In the embodiment of the present application, a data synchronization request is generated based on the data to be synchronized and the hash value. Therefore, the generated data synchronization request includes the data to be synchronized and the hash value.

[0147] S42: Send data synchronization requests to multiple core cloud nodes respectively, so that the multiple core cloud nodes respectively respond to the data synchronization requests sent by the edge node, verify the hash value in the data synchronization request, determine the hash value verification result corresponding to the hash value, obtain the hash value verification results corresponding to each other core cloud node, and determine the node verification result of the edge node based on each hash value verification result, and synchronize the data to be synchronized based on the node verification result.

[0148] In an embodiment of the present application, data synchronization requests are sent to multiple core cloud nodes in the group respectively, so that after receiving the data synchronization requests, the multiple core cloud nodes respectively respond to the data synchronization requests sent by the edge node, verify the hash value in the data synchronization request, determine the hash value verification result corresponding to the hash value, and then obtain the hash value verification results corresponding to each of the other core cloud nodes, and determine the node verification result corresponding to the edge node based on each hash value verification result, so that it can be determined based on the node verification result whether the data to be synchronized uploaded by the edge node can be synchronized.

[0149] Furthermore, in the embodiment of the present application, the edge node can also receive data sent by the core cloud node, which is not limited in the embodiment of the present application.

[0150] Based on the same inventive concept, the embodiment of the present application also provides a data synchronization device based on blockchain, which can be a hardware structure, a software module, or a hardware structure plus a software module. Figure 5 As shown, the structural diagram of the data synchronization device based on blockchain in the embodiment of the present application specifically includes:

[0151] A verification module 500 is used for any core cloud node to respond to the data synchronization request sent by the edge node, verify the hash value in the data synchronization request, and determine the hash value verification result corresponding to the hash value; wherein the data synchronization request includes the data to be synchronized and the hash value obtained by the edge node;

[0152] The determination module 510 is used to obtain the hash value verification results corresponding to each other core cloud node, and determine the node verification result of the edge node based on each hash value verification result;

[0153] The processing module 520 is used to synchronize the data to be synchronized based on the node verification result.

[0154] Optionally, the hash value in the data synchronization request is verified to determine a hash value verification result corresponding to the hash value, and the verification module 500 is further used to:

[0155] Based on the node identifier corresponding to any one of the core cloud nodes, determine the corresponding hash value sequence information;

[0156] Based on the hash value sequence information, determining a corresponding node hash value from the hash values, wherein the hash values ​​include a node hash value corresponding to each core cloud node, and each node hash value is arranged based on a preset order;

[0157] Based on the node hash value and in combination with preset hash value authentication rules, a hash value verification result is determined.

[0158] Optionally, when determining the hash value verification result, the verification module 500 is further used to:

[0159] If it is determined that the node hash value is the same as the pre-stored standard node hash value, then the corresponding hash value verification result is determined to be passed;

[0160] If it is determined that the node hash value is different from the standard node hash value, the corresponding hash value verification result is determined to be failed.

[0161] Optionally, when determining the node verification result of the edge node based on each hash value verification result, the determination module 510 is further used to:

[0162] From each hash value verification result, determine the number of hash value verification results that pass as the number of results corresponding to the edge node;

[0163] If it is determined that the number of results is not less than a preset number threshold, determining that the node verification result corresponding to the edge node is passed;

[0164] If it is determined that the number of results is less than a preset number threshold, then it is determined that the node verification result corresponding to the edge node is failed.

[0165] Optionally, the processing module 520 is further used for:

[0166] If it is determined that the node verification result is passed, a preset data synchronization method is used to synchronize the data to be synchronized;

[0167] If it is determined that the node verification result is failed, the edge node is determined to be a problem node, and based on the node verification result, an alarm message is generated, and the alarm message is sent to the client for display.

[0168] Optionally, when synchronizing the data to be synchronized using a preset data synchronization method, the processing module 520 is further used to:

[0169] Read the node permission type, where the node permission type is either with packaging permission or without permission;

[0170] If it is determined that the node permission type has packaging permission, the data to be synchronized is packaged to obtain updated data, and the updated data is stored in a preset system database;

[0171] If it is determined that the node authority type is no authority, a synchronization instruction is sent to the core cloud node whose node authority type is with packaging authority, so that the core cloud node whose node authority type is with packaging authority packages the data to be synchronized, obtains updated data, and stores the updated data in the system database.

[0172] Based on the same inventive concept, another blockchain-based data synchronization device is also provided in the embodiment of the present application. The blockchain-based data synchronization device can be a hardware structure, a software module, or a hardware structure plus a software module. Figure 6 As shown, a structural diagram of another data synchronization device based on blockchain in an embodiment of the present application specifically includes:

[0173] The acquisition module 600 is used to acquire the data to be synchronized and determine the hash value;

[0174] A generating module 610, configured to generate a data synchronization request including the data to be synchronized and the hash value;

[0175] Processing module 620 is used to send the data synchronization request to the multiple core cloud nodes respectively, so that the multiple core cloud nodes respectively respond to the data synchronization request sent by the edge node, verify the hash value in the data synchronization request, determine the hash value verification result corresponding to the hash value, obtain the hash value verification result corresponding to each other core cloud node, and determine the node verification result of the edge node based on each hash value verification result, and synchronize the data to be synchronized based on the node verification result.

[0176] Based on the above embodiments, see Figure 7 Shown is a schematic diagram of the structure of an electronic device in an embodiment of the present application.

[0177] An embodiment of the present application provides an electronic device, which may include a processor 710 (Center Processing Unit, CPU), a memory 720, an input device 730 and an output device 740, etc. The input device 730 may include a keyboard, a mouse, a touch screen, etc., and the output device 740 may include a display device, such as a liquid crystal display (Liquid Crystal Display, LCD), a cathode ray tube (Cathode Ray Tube, CRT), etc.

[0178] The memory 720 may include a read-only memory (ROM) and a random access memory (RAM), and provides the processor 710 with program instructions and data stored in the memory 720. In an embodiment of the present application, the memory 720 may be used to store a program of any blockchain-based data synchronization method in an embodiment of the present application.

[0179] The processor 710 calls the program instructions stored in the memory 720, and the processor 710 is used to execute any blockchain-based data synchronization method in the embodiments of the present application according to the obtained program instructions.

[0180] Based on the above embodiments, in an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the blockchain-based data synchronization method in any of the above method embodiments is implemented.

[0181] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0182] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0183] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0184] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0185] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data synchronization method based on blockchain, characterized in that: The blockchain network includes multiple core cloud nodes and edge nodes, and the method includes: Any core cloud node responds to the data synchronization request sent by the edge node, verifies the hash value in the data synchronization request, and determines the hash value verification result corresponding to the hash value; wherein the data synchronization request includes the data to be synchronized and the hash value obtained by the edge node, verifies the hash value in the data synchronization request, and determines the hash value verification result corresponding to the hash value, specifically including: based on the node identifier corresponding to any core cloud node, determining the corresponding hash value sequence information, based on the hash value sequence information, determining the corresponding node hash value from the hash value, wherein the hash value includes the node hash value corresponding to each core cloud node, and each node hash value is arranged based on a preset order, and based on the node hash value, combined with a preset hash value authentication rule, determines the hash value verification result; Obtaining hash value verification results corresponding to each other core cloud node, and determining the node verification result of the edge node based on each hash value verification result; Based on the node verification result, data synchronization is performed on the data to be synchronized.

2. The method according to claim 1, characterized in that Determine the hash value verification result, including: If it is determined that the node hash value is the same as the pre-stored standard node hash value, then the corresponding hash value verification result is determined to be passed; If it is determined that the node hash value is different from the standard node hash value, the corresponding hash value verification result is determined to be failed.

3. The method according to claim 2, characterized in that Based on the hash value verification results, determining the node verification result of the edge node specifically includes: From each hash value verification result, determine the number of hash value verification results that pass as the number of results corresponding to the edge node; If it is determined that the number of results is not less than a preset number threshold, determining that the node verification result corresponding to the edge node is passed; If it is determined that the number of results is less than a preset number threshold, then it is determined that the node verification result corresponding to the edge node is failed.

4. The method according to claim 1, characterized in that Based on the node verification result, data synchronization is performed on the data to be synchronized, specifically including: If it is determined that the node verification result is passed, a preset data synchronization method is used to synchronize the data to be synchronized; If it is determined that the node verification result is failed, the edge node is determined to be a problem node, and based on the node verification result, an alarm message is generated, and the alarm message is sent to the client for display.

5. The method according to claim 4, characterized in that Use the preset data synchronization method to synchronize the data to be synchronized, including: Read the node permission type, where the node permission type is either with packaging permission or without permission; If it is determined that the node permission type has packaging permission, the data to be synchronized is packaged to obtain updated data, and the updated data is stored in a preset system database; If it is determined that the node authority type is no authority, a synchronization instruction is sent to the core cloud node whose node authority type is with packaging authority, so that the core cloud node whose node authority type is with packaging authority packages the data to be synchronized, obtains updated data, and stores the updated data in the system database.

6. A data synchronization method based on blockchain, characterized in that: The blockchain network includes multiple core cloud nodes and edge nodes, and the method includes: The edge node obtains the data to be synchronized, and determines a hash value; Generate a data synchronization request including the data to be synchronized and the hash value; The data synchronization request is sent to the multiple core cloud nodes respectively, so that the multiple core cloud nodes respectively respond to the data synchronization request sent by the edge node, verify the hash value in the data synchronization request, determine the hash value verification result corresponding to the hash value, obtain the hash value verification result corresponding to each other core cloud node, and determine the node verification result of the edge node based on each hash value verification result, and synchronize the data to be synchronized based on the node verification result, wherein the hash value in the data synchronization request is verified and the hash value verification result corresponding to the hash value is determined, specifically including: based on the node identifier corresponding to any one of the core cloud nodes, determining the corresponding hash value sequence information, based on the hash value sequence information, determining the corresponding node hash value from the hash value, wherein the hash value includes the node hash value corresponding to each core cloud node, and each node hash value is arranged based on a preset order, and based on the node hash value, the hash value verification result is determined in combination with a preset hash value authentication rule.

7. A data synchronization device based on blockchain, characterized in that: The blockchain network includes multiple core cloud nodes and edge nodes. The device is applied to any core cloud node. The device includes: A verification module, for any core cloud node to respond to a data synchronization request sent by the edge node, verify the hash value in the data synchronization request, and determine the hash value verification result corresponding to the hash value; wherein the data synchronization request includes the data to be synchronized and the hash value obtained by the edge node, and the hash value in the data synchronization request is verified to determine the hash value verification result corresponding to the hash value, specifically including: based on the node identifier corresponding to any core cloud node, determining the corresponding hash value sequence information, based on the hash value sequence information, determining the corresponding node hash value from the hash value, wherein the hash value includes the node hash value corresponding to each core cloud node, and each node hash value is arranged based on a preset order, and based on the node hash value, the hash value verification result is determined in combination with a preset hash value authentication rule; A determination module, used to obtain the hash value verification results corresponding to each other core cloud node, and determine the node verification result of the edge node based on each hash value verification result; A processing module is used to synchronize the data to be synchronized based on the node verification result.

8. A data synchronization device based on blockchain, characterized in that: The blockchain network includes multiple core cloud nodes and edge nodes, and the device is applied to the edge nodes, and the device includes: An acquisition module, used to acquire data to be synchronized and determine a hash value; A generating module, used for generating a data synchronization request including the data to be synchronized and the hash value; A processing module is used to send the data synchronization request to the multiple core cloud nodes respectively, so that the multiple core cloud nodes respectively respond to the data synchronization request sent by the edge node, verify the hash value in the data synchronization request, determine the hash value verification result corresponding to the hash value, obtain the hash value verification result corresponding to each other core cloud node, and determine the node verification result of the edge node based on each hash value verification result, and synchronize the data to be synchronized based on the node verification result, wherein the hash value in the data synchronization request is verified and the hash value verification result corresponding to the hash value is determined, specifically including: based on the node identifier corresponding to any one of the core cloud nodes, determining the corresponding hash value sequence information, based on the hash value sequence information, determining the corresponding node hash value from the hash value, wherein the hash value includes the node hash value corresponding to each core cloud node, and each node hash value is arranged based on a preset order, and based on the node hash value, the hash value verification result is determined in combination with a preset hash value authentication rule.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • APPROXIMATE HASH VERIFICATION for blockchains

    CN112019586A

  • Model management method and device based on block chain

    CN112231401A