Data processing method and device, electronic equipment and computer readable storage medium

By filtering target nodes in the blockchain network and performing data synchronization, the problem that synchronous nodes cannot guarantee data privacy when data synchronization is synchronized is solved, precise communication and resource optimization are achieved, and data security is ensured.

CN119939642APending Publication Date: 2025-05-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311458838.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-02
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the blockchain network, synchronous nodes cannot guarantee data privacy when synchronizing data, resulting in data leakage and waste of resources.

Method used

By sending information synchronization requests to at least two sending nodes, obtaining their block height and synchronization rule information, filtering out the target node, and sending data synchronization requests to the target node to obtain their block data, and verifying and adding the data to the data set of the synchronization node.

Benefits of technology

Data synchronization based on synchronization rules and effective block height is realized, ensuring accurate communication between blockchain nodes, avoiding the waste of network and storage resources, and ensuring the privacy and security of block data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119939642A_ABST
    Figure CN119939642A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of block chains. The method comprises the following steps: sending an information synchronization request to at least two sending nodes to obtain block heights of the at least two sending nodes and rule information of corresponding synchronization nodes inquired from the sending nodes; based on the rule identifier of the synchronization rule and the effective block height, screening out a target node from each sending node; sending a data synchronization request to a target node to obtain block data of the target node; and verifying the block data, and adding the block data passing the verification into a data set of the synchronization node. According to the embodiment of the invention, the corresponding synchronization rule is configured for the synchronization node, data synchronization based on the synchronization rule and the effective block height of the synchronization rule is realized, the block data can be acquired in a targeted manner according to the synchronization rule, and the privacy and security of the block data are guaranteed.
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. Specifically, the present application relates to a data processing method, device, electronic device and computer-readable storage medium. Background Art

[0002] Blockchain technology is a distributed database technology that can be used to record data on every blockchain node in the network, thus forming a secure and reliable distributed database. If you want to modify the information in the blockchain, you must obtain the consent of more than half of the nodes and modify the information in all nodes. These nodes are usually in the hands of different entities, so it is extremely difficult to tamper with the information in the blockchain. Compared with traditional networks, the information recorded in the blockchain is more authentic and reliable, which can solve the problems of data fairness and security.

[0003] The blockchain network generally ensures the consistency of the data recorded by each blockchain node through a consensus mechanism. For non-consensus nodes, i.e. synchronization nodes, data needs to be synchronized from the blockchain network in real time. In the prior art, the synchronization node can obtain the block data of the sending node based on the block height of the sending node to achieve data synchronization; however, data synchronization based on the block height will cause the synchronization node to obtain the complete data of the entire block at a certain block height, resulting in redundancy of the obtained block data, and data privacy cannot be guaranteed during data synchronization. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, device, electronic device, and computer-readable storage medium, which can solve the problem that data privacy cannot be guaranteed when data is synchronized in a blockchain network. The technical solution is as follows:

[0005] According to one aspect of an embodiment of the present application, a data processing method is provided, which is applied to a synchronization node in a blockchain network, and the method includes:

[0006] Sending information synchronization requests to at least two sending nodes to obtain the block heights of at least two sending nodes and the rule information of the corresponding synchronization nodes queried from each sending node; wherein the rule information of each synchronization node includes the rule identifier of the synchronization rule configured by the synchronization node and the effective block height of the synchronization rule;

[0007] Based on the rule identifier and effective block height of the synchronization rule, the target node is selected from each sending node; wherein the block height of the target node is greater than the effective block height corresponding to the synchronization node queried by the target node;

[0008] Send a data synchronization request to the target node to obtain the block data of the target node;

[0009] Verify the block data and add the verified block data to the data set of the synchronization node.

[0010] In a possible implementation, the rule identifier and effective block height based on the synchronization rule are used to select the target node from each sending node, including:

[0011] Query the rule information corresponding to each sending node, and take the sending nodes whose corresponding rule identifiers are not empty as candidate sending nodes;

[0012] The target node is obtained by screening from the candidate sending nodes; wherein the target node is a candidate sending node whose block height is greater than the effective block height corresponding to the queried synchronization node.

[0013] In a possible implementation, the synchronization node is configured as follows:

[0014] Determine the historical rule information corresponding to the blockchain node to be configured;

[0015] Receiving a height indication for a blockchain node to be configured, and generating a target rule corresponding to the blockchain node to be configured based on the historical rule information and the height indication; wherein the height indication represents an effective block height of the rule configured for the blockchain node to be configured;

[0016] Configure the blockchain nodes to be configured based on the target rules and generate synchronization nodes.

[0017] In another possible implementation, the target rule corresponding to the blockchain node to be configured is generated based on the historical rule information and the height indication, including:

[0018] Query the historical rule information. When there is a historical rule identifier in the historical rule information, obtain the current block height of the blockchain network; based on the current block height and the effective block height, update the historical rule information to obtain the updated rule information; generate the target rule corresponding to the starting block height according to the updated rule information;

[0019] When the historical rule identifier does not exist in the historical rule information, a new rule identifier is generated; and a target rule corresponding to the starting block height is generated according to the new rule identifier.

[0020] In another possible implementation, configuring the blockchain node to be configured based on the target rule and generating the synchronization node includes:

[0021] When there is a historical synchronization rule corresponding to the effective block height in the historical rule information, the historical synchronization rule corresponding to the effective block height is replaced with the target rule to update the rule information of the blockchain node to be configured, and the updated blockchain node to be configured is used as the synchronization node;

[0022] When there is no historical synchronization rule corresponding to the effective block height in the historical rule information, the target rule is added to the rule information of the blockchain node to be configured to update the rule information of the blockchain node to be configured, and the updated blockchain node to be configured is used as the synchronization node.

[0023] According to another aspect of an embodiment of the present application, a data processing method is provided, which is applied to a sending node in a blockchain network, and the method includes:

[0024] Receive information synchronization request sent by synchronization node;

[0025] In response to the information synchronization request, query the rule information configured by the synchronization node based on the node identifier of the synchronization node; wherein the rule information includes the rule identifier of the synchronization rule configured by the synchronization node, and the effective block height of the synchronization rule;

[0026] Send the rule information and the block height of the sending node to the synchronization node;

[0027] Receive a data synchronization request sent by a synchronization node; wherein the data synchronization request is sent by the synchronization node based on the block height of the sending node and the rule information corresponding to the synchronization node queried by the sending node; the block height of the sending node is greater than the effective block height in the rule information;

[0028] In response to the data synchronization request, return data of the information synchronization request is determined based on the rule information, and the return data is sent to the synchronization node.

[0029] In another possible implementation, the above-mentioned determining the return data of the information synchronization request based on the rule information includes:

[0030] Obtain candidate block data from the sending node’s data set based on the synchronization node’s requested block height;

[0031] Screening candidate block data based on rule information to obtain target block data;

[0032] The target block data is returned.

[0033] According to another aspect of an embodiment of the present application, a data processing device is provided, the device comprising:

[0034] A first sending module, used to send an information synchronization request to at least two sending nodes to obtain the block heights of the at least two sending nodes and the rule information of the corresponding synchronization node queried from each sending node; wherein the rule information of each synchronization node includes a rule identifier of the synchronization rule configured by the synchronization node and an effective block height of the synchronization rule;

[0035] A screening module is used to screen out a target node from each sending node based on the rule identifier and effective block height of the synchronization rule; wherein the block height of the target node is greater than the effective block height corresponding to the synchronization node queried by the target node;

[0036] The second sending module is used to send a data synchronization request to the target node to obtain the block data of the target node;

[0037] The verification module is used to verify the block data and add the verified block data to the data set of the synchronization node.

[0038] In a possible implementation, when the screening module screens out the target node from each sending node based on the rule identifier and the effective block height of the synchronization rule, it is used to:

[0039] Query the rule information corresponding to each sending node, and take the sending nodes whose corresponding rule identifiers are not empty as candidate sending nodes;

[0040] The target node is obtained by screening from the candidate sending nodes; wherein the target node is a candidate sending node whose block height is greater than the effective block height corresponding to the queried synchronization node.

[0041] In a possible implementation, the apparatus further includes a configuration module, configured to:

[0042] Determine the historical rule information corresponding to the blockchain node to be configured;

[0043] Receiving a height indication for a blockchain node to be configured, and generating a target rule corresponding to the blockchain node to be configured based on the historical rule information and the height indication; wherein the height indication represents an effective block height of the rule configured for the blockchain node to be configured;

[0044] Configure the blockchain nodes to be configured based on the target rules and generate synchronization nodes.

[0045] In another possible implementation, when the configuration module generates a target rule corresponding to the blockchain node to be configured based on the historical rule information and the height indication, it is used to:

[0046] Query the historical rule information. When there is a historical rule identifier in the historical rule information, obtain the current block height of the blockchain network; based on the current block height and the effective block height, update the historical rule information to obtain the updated rule information; generate the target rule corresponding to the starting block height according to the updated rule information;

[0047] When the historical rule identifier does not exist in the historical rule information, a new rule identifier is generated; and a target rule corresponding to the starting block height is generated according to the new rule identifier.

[0048] In another possible implementation, when configuring the blockchain node to be configured based on the target rule and generating the synchronization node, the configuration module is used to:

[0049] When there is a historical synchronization rule corresponding to the effective block height in the historical rule information, the historical synchronization rule corresponding to the effective block height is replaced with the target rule to update the rule information of the blockchain node to be configured, and the updated blockchain node to be configured is used as the synchronization node;

[0050] When there is no historical synchronization rule corresponding to the effective block height in the historical rule information, the target rule is added to the rule information of the blockchain node to be configured to update the rule information of the blockchain node to be configured, and the updated blockchain node to be configured is used as the synchronization node.

[0051] According to another aspect of an embodiment of the present application, a data processing device is provided, the device comprising:

[0052] A first receiving module, used for receiving an information synchronization request sent by a synchronization node;

[0053] A query module, used to query and obtain the rule information configured by the synchronization node based on the node identifier of the synchronization node in response to the information synchronization request; wherein the rule information includes the rule identifier of the synchronization rule configured by the synchronization node and the effective block height of the synchronization rule;

[0054] The third sending module is used to send the rule information and the block height of the sending node to the synchronization node;

[0055] A second receiving module is used to receive a data synchronization request sent by a synchronization node; wherein the data synchronization request is sent by the synchronization node based on the block height of the sending node and the rule information corresponding to the synchronization node queried by the sending node; the block height of the sending node is greater than the effective block height in the rule information;

[0056] The return module is used to respond to the data synchronization request, determine the return data of the information synchronization request based on the rule information, and send the return data to the synchronization node.

[0057] In another possible implementation, when the return module determines the return data of the information synchronization request based on the rule information, it is used to:

[0058] Obtain candidate block data from the sending node’s data set based on the synchronization node’s requested block height;

[0059] Screening candidate block data based on rule information to obtain target block data;

[0060] The target block data is returned.

[0061] According to another aspect of an embodiment of the present application, an electronic device is provided, which includes: a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the method shown in the first aspect of the embodiment of the present application.

[0062] According to another aspect of the embodiments 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 steps of the method shown in the first aspect of the embodiments of the present application are implemented.

[0063] According to one aspect of an embodiment of the present application, a computer program product is provided, which includes a computer program, and when the computer program is executed by a processor, the steps of the method shown in the first aspect of the embodiment of the present application are implemented.

[0064] The beneficial effects of the technical solution provided by the embodiment of the present application are:

[0065] In an embodiment of the present application, the synchronization node sends an information synchronization request to at least two sending nodes to obtain the block heights of at least two sending nodes, as well as the rule information of the corresponding synchronization node queried from each sending node; then, based on the rule identifier and effective block height of the corresponding synchronization rule in the rule information, the target node is screened out from each sending node; and a data synchronization request is sent to the target node to obtain the block data of the target node; then the synchronization node verifies the block data, and adds the verified block data to the data set of the synchronization node. The embodiment of the present application configures the synchronization node with corresponding synchronization rules, realizes data synchronization based on the synchronization rules and the effective block height of the synchronization rules, can screen the sending nodes according to the synchronization rules, and the block height of the screened target node is greater than the effective block height corresponding to the synchronization node queried by the target node, effectively ensuring accurate communication between blockchain nodes without wasting network and storage resources. Different from the prior art in which complete data of the entire block at a certain block height is obtained based on the block height of the node, the synchronization node in the embodiment of the present application can obtain block data in a targeted manner based on the synchronization rules, which will not cause data leakage of the entire block, thereby ensuring the privacy and security of the block data. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.

[0067] Figure 1 A schematic diagram of an application scenario of a data processing method provided in an embodiment of the present application;

[0068] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;

[0069] Figure 3 A schematic diagram of a process for configuring a synchronization node in a data processing method provided in an embodiment of the present application;

[0070] Figure 4 A schematic diagram of a flow chart of generating target rules for node configuration in a data processing method provided in an embodiment of the present application;

[0071] Figure 5 A schematic diagram of a flow chart of generating update rule information in a data processing method provided in an embodiment of the present application;

[0072] Figure 6 A schematic diagram of another process of configuring a synchronization node in a data processing method provided in an embodiment of the present application;

[0073] Figure 7 A schematic diagram of a flow chart of a data processing method provided in an embodiment of the present application;

[0074] Figure 8 A timing diagram of an exemplary data processing method provided in an embodiment of the present application;

[0075] Fig. 9 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application;

[0076] Fig.10 A schematic diagram of the structure of another data processing device provided in an embodiment of the present application;

[0077] Fig.11 A schematic diagram of the structure of a data processing electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0078] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.

[0079] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" may be implemented as "A", or as "B", or as "A and B".

[0080] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0081] The blockchain is a chain of blocks, each of which stores certain information. They are connected in the order of their generation. This chain is stored in all servers. As long as there is one server in the entire system that can work, the entire blockchain is safe. These servers are called nodes in the blockchain system, and they provide storage space and computing power support for the entire blockchain system. In a narrow sense, the blockchain is a chain data structure that combines data blocks in a sequential manner in chronological order, and a distributed ledger that is tamper-proof and unforgeable by cryptography. In a broad sense, blockchain technology is a new distributed infrastructure and computing paradigm that uses block chain data structures to verify and store data, uses distributed node consensus algorithms to generate and update data, uses cryptography to ensure the security of data transmission and access, and uses smart contracts composed of automated script codes to program and operate data.

[0082] The blockchain consensus mechanism is one of the important mechanisms to ensure the security and reliability of the blockchain. It is implemented through algorithms and protocols between network nodes to ensure the consistency of data and transactions on the blockchain among all nodes, thereby preventing double payments and other malicious behaviors. The consensus mechanism can prevent nodes in the network from tampering with data or performing other malicious behaviors, making the blockchain more secure and reliable. The implementation of the consensus mechanism requires collaboration between multiple nodes, thereby improving the degree of decentralization of the blockchain. Under the action of the consensus mechanism, there is no need for nodes to trust any centralized organization, which makes the blockchain more decentralized and democratic. The consensus mechanism can be applied to digital currency, smart contracts, supply chain management, medical record management and other fields, providing reliable technical support for the development and application of these fields. The implementation of the consensus mechanism requires the use of digital technologies such as computers and networks. Therefore, the development and application of the consensus mechanism has promoted the development of the digital economy. The continuous optimization and innovation of the consensus mechanism will provide more reliable and secure technical support for the development of the digital economy.

[0083] The blockchain consensus mechanism can be used to ensure the consistency of data recorded by each blockchain node. In the prior art, when each blockchain node is started, it broadcasts the block height information of other nodes at a fixed time, and adds the obtained node status data to the node cache pool; then the synchronization node selects the sending node whose block height is higher than the local block height from the sending node cache pool to obtain the block data of the node. The inventor found that in the prior art, each time the synchronization node requests to obtain the block data of a certain height, it is the complete data of the entire block, which will cause two major defects:

[0084] First, the synchronization node will obtain data that it does not need, resulting in excessive useless data occupying unnecessary storage and network resources;

[0085] Secondly, the synchronization node will obtain data that it should not obtain, causing the data of the sending node to be leaked, destroying the privacy of the data and failing to guarantee the security of the data.

[0086] The data processing method, device, electronic device and computer-readable storage medium provided in this application are intended to solve the above technical problems in the prior art.

[0087] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.

[0088] like Figure 1 As shown, the data processing method of the present application can be applied to Figure 1In the scenario shown, the sending server 101 can serve as a sending node in the blockchain network, and the synchronization server 102 can serve as a synchronization node in the blockchain network; specifically, the synchronization server 102 sends an information synchronization request to at least two sending servers 101, and the sending server 101 responds to the information synchronization request by sending the block height of the sending server and the rule information of the corresponding synchronization server queried from the sending server 101 to the synchronization server 102; the synchronization server 102 filters out the target server from each sending server 101 based on the rule identifier and the effective block height of the synchronization rule in the received rule information; then the synchronization server sends a data synchronization request to the target server, and in response to the request, the target server sends its block data to the synchronization server 102; after receiving the block data, the synchronization server 102 verifies the block data and adds the verified block data to the data set of the synchronization server 102.

[0089] Figure 1 In the scenario shown, the above data processing method can be performed in a server, and in other scenarios, it can also be performed in a terminal.

[0090] Those skilled in the art can understand that the "terminal" used here includes but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc.; "server" can be implemented with an independent server or a server cluster composed of multiple servers. The embodiments of the present invention can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, etc.

[0091] The present application provides a data processing method, such as Figure 2 As shown, it can be applied to a synchronization node in a blockchain network, and the method includes:

[0092] S201, sending an information synchronization request to at least two sending nodes to obtain the block heights of the at least two sending nodes and the rule information of the corresponding synchronization node queried from each sending node.

[0093] The rule information of each synchronization node includes the rule identifier of the synchronization rule configured by the synchronization node and the effective block height of the synchronization rule. The information synchronization request is used to request the node information data of the sending node.

[0094] Furthermore, the node information data of the sending node in the blockchain may include the block height of the node, the rule information of the synchronization node known by the node, that is, the rule information of the synchronization node that can be queried from the node.

[0095] In an embodiment of the present application, each synchronization node is configured with a synchronization rule, and the synchronization rule is used to filter data when the block data is synchronized. Each synchronization rule corresponds to a rule identifier, an effective block height, and a rule content. The node identifier of the synchronization node and the latest rule identifier corresponding to the synchronization node can be stored in the form of a key-value pair. For example, the node ID (Identity document) corresponding to each synchronization node can be stored in correspondence with the latest rule ID. Among them, each synchronization node can correspond to at least one synchronization rule, and the rule ID of the synchronization rule can be incremented in sequence based on the configuration time sequence, and the latest rule ID is the rule identifier with the largest ID number.

[0096] Specifically, the synchronization node can send an information synchronization request to at least two sending nodes. Each sending node responds to the information synchronization request by sending the block height of the sending node and the rule information of the corresponding synchronization node that can be queried from the sending node to the synchronization node.

[0097] S202, based on the rule identifier and effective block height of the synchronization rule, select the target node from each sending node.

[0098] Among them, the block height of the target node is greater than the effective block height corresponding to the synchronization node queried by the target node.

[0099] Specifically, the synchronization node may filter out target nodes whose block heights are greater than the corresponding effective block heights from each sending node based on the obtained effective block heights and rule identifiers of the synchronization rules corresponding to each sending node.

[0100] In some embodiments, the synchronization node can screen the effective block heights of the synchronization rules corresponding to each sending node to obtain candidate sending nodes whose block heights are greater than the corresponding effective block heights; then query the rule information corresponding to each candidate sending node, and take the candidate sending nodes whose rule identifiers are not empty as target nodes.

[0101] In other implementations, the synchronization node may query the rule information corresponding to each sending node, and use the sending nodes whose rule identifiers are not empty as candidate sending nodes; then the effective block heights of the synchronization rules corresponding to each candidate sending node are screened to obtain the target node.

[0102] In an embodiment of the present application, when the target node cannot be filtered out from each sending node, each sending node is filtered and queried again after a preset time interval until the target node is obtained.

[0103] S203, sending a data synchronization request to the target node to obtain the block data of the target node.

[0104] The data synchronization request is used to request the acquisition of the block data of the target node. The block data is obtained by the target node after filtering the original block data of the target node based on the rule information corresponding to the queried synchronization node.

[0105] Specifically, after determining the target node, the synchronization node can send a data synchronization request to the target node. In response to the data synchronization request, the target node filters the original block data of the target node according to the rule information corresponding to the queried synchronization node to obtain the block data; the target node returns the block data to the synchronization node.

[0106] Furthermore, the original block data may be filtered according to the rule content in the rule information; this is explained by taking the block data as transfer data as an example.

[0107] In some implementations, the rule content may be that the initiator of the transfer is object A, and the transfer triggers contract X. Then, data in which the transfer initiator is A and the transfer operation triggers contract X may be filtered out from the original block data as block data.

[0108] In other implementations, when the original block data of the target node does not meet the rule content, the attribute information such as the transfer ID and the transfer hash value in the original block data can be obtained and used as the block data. The attribute information can be used to verify the legitimacy of the block data.

[0109] S204, verify the block data, and add the verified block data to the data set of the synchronization node.

[0110] Among them, when the block data includes the original block data, the compliance and security of the block data can be directly verified, and the verified block data can be added to the data set of the synchronization node; when the block data includes the attribute information of the original block data, the compliance and security of the attribute information can be verified, and the verified block data can be added to the data set of the synchronization node.

[0111] In an embodiment of the present application, the synchronization node sends an information synchronization request to at least two sending nodes to obtain the block heights of at least two sending nodes, as well as the rule information of the corresponding synchronization node queried from each sending node; then, based on the rule identifier and effective block height of the corresponding synchronization rule in the rule information, the target node is screened out from each sending node; and a data synchronization request is sent to the target node to obtain the block data of the target node; then the synchronization node verifies the block data, and adds the verified block data to the data set of the synchronization node. The embodiment of the present application configures the synchronization node with corresponding synchronization rules, realizes data synchronization based on the synchronization rules and the effective block height of the synchronization rules, can screen the sending nodes according to the synchronization rules, and the block height of the screened target node is greater than the effective block height corresponding to the synchronization node queried by the target node, effectively ensuring accurate communication between blockchain nodes without wasting network and storage resources. Different from the prior art in which complete data of the entire block at a certain block height is obtained based on the block height of the node, the synchronization node in the embodiment of the present application can obtain block data in a targeted manner based on the synchronization rules, which will not cause data leakage of the entire block, thereby ensuring the privacy and security of the block data.

[0112] In an embodiment of the present application, a possible implementation method is provided, wherein the rule identifier and effective block height based on the synchronization rule are used to filter out the target node from each sending node, including:

[0113] S301, querying the rule information corresponding to each sending node, and taking the sending nodes whose corresponding rule identifiers are not empty as candidate sending nodes.

[0114] Among them, when the rule identifier corresponding to the rule information is empty, the rule identifier, i.e., the rule ID, can be set to 0; when the rule identifier included in the rule information is not empty, the rule identifier, i.e., the rule ID, can include multiple ones, and the rule ID can be incremented in sequence based on the configuration time. For example, the sending node can query and obtain the rule set of the synchronization node, and the synchronization rule with the rule ID of 1 in the rule set is the synchronization rule configured for the first time by the synchronization node; the synchronization rule with the rule ID of 2 in the rule set is the synchronization rule configured by the synchronization node after configuring the rule with the rule ID of 1.

[0115] Specifically, the synchronization node may query the rule information corresponding to each sending node in the node cache to obtain the candidate sending nodes whose corresponding rule identifiers are not empty.

[0116] S302, screening out a target node from candidate sending nodes.

[0117] Among them, the target node is a candidate sending node whose block height is greater than the effective block height corresponding to the queried synchronization node.

[0118] In an embodiment of the present application, before the synchronization node joins the blockchain network, a transaction for rule configuration can be initiated to the blockchain to ensure the consistency of the rule information of the synchronization node seen by different sending nodes, that is, the synchronization node that can be queried. Then when the synchronization node is started, the synchronization node can broadcast and obtain the block height information of each sending node, as well as the rule information of the synchronization node that the sending node can query, and save the above information obtained to the node cache of the synchronization node. When performing data synchronization, the synchronization node can query the rule information corresponding to each sending node from the node cache, and filter out the target node whose rule ID is not 0 and whose block height is greater than the effective block height.

[0119] Furthermore, if the rule ID corresponding to the sending node is 0, it means that the block height of the sending node has not reached the block height when the synchronization node joins the blockchain network. In this case, the sending node does not provide synchronization data services for the synchronization node to avoid block data confusion caused by inconsistent rules queried by multiple sending nodes.

[0120] The embodiment of the present application queries the rule information corresponding to each sending node, screens out the sending nodes whose corresponding rule identifiers are not empty as candidate sending nodes, and then screens out the candidate sending nodes whose block heights are greater than the effective block heights corresponding to the queried synchronization nodes as target nodes; it implements the screening of sending nodes by combining the rule identifier, the effective block height of the rule and the node block height, and effectively ensures the validity and reliability of the synchronization data.

[0121] A possible implementation method is provided in the embodiment of the present application, such as Figure 3 As shown, the above synchronization nodes are configured based on the following method:

[0122] S401, determine the historical rule information corresponding to the blockchain node to be configured.

[0123] The historical rule information may include the rule identifier, rule content, and effective block height of at least one historical synchronization rule configured for the blockchain node to be configured. If the blockchain node has not been configured with a historical synchronization rule, the historical rule information is empty.

[0124] S402, receiving a height indication for the blockchain node to be configured, and generating a target rule corresponding to the blockchain node to be configured based on the historical rule information and the height indication.

[0125] Among them, the height indication represents the effective block height of the rules configured by the blockchain node to be configured, and the height indication can be triggered based on the user's operation on the configuration client.

[0126] Specifically, the synchronization node may receive the altitude indication sent by the configuration client, and generate a corresponding target rule based on the historical rule information and the altitude indication.

[0127] In some embodiments, the configuration terminal may query the historical rule information, determine the historical synchronization rule of the blockchain node to be configured based on the historical rule information, and generate the target rule based on the historical synchronization rule and the effective block height corresponding to the height indication. The detailed steps of generating the target rule will be described in detail below.

[0128] S403, configuring the blockchain node to be configured based on the target rules and generating a synchronization node.

[0129] Specifically, the rule identifier, effective block height and rule content of the target rule can be added to the rule set of the blockchain node to be configured, and the rule identifier of the target rule, that is, the latest rule identifier, and the node identifier of the blockchain node to be configured are stored in the form of a key-value pair, and the configured blockchain node to be configured is used as a synchronization node.

[0130] The embodiment of the present application generates a target rule through historical rule information and height indication, and configures the blockchain node to be configured based on the target rule to generate a synchronization node; wherein the height indication can be used to characterize the effective block height of the target rule, and the historical rule information can be used to determine the rule identifier of the target rule. The embodiment of the present application realizes the precise configuration of the synchronization rule based on the historical rule information of the node, making the synchronization data more accurate.

[0131] A possible implementation method is provided in the embodiment of the present application, such as Figure 4 As shown, the above generates the target rules corresponding to the blockchain node to be configured based on the historical rule information and the height indication, including:

[0132] In some implementations, historical rule information is queried, and when a historical rule identifier exists in the historical rule information, the current block height of the blockchain network is obtained; based on the current block height and the effective block height, the historical rule information is updated to obtain updated rule information; and a target rule corresponding to the starting block height is generated according to the updated rule information.

[0133] Specifically, when the effective block height is greater than the current block height, the configuration terminal can generate a new rule identifier based on the historical rule identifier in the historical rule information to determine the update rule information based on the effective block height and the new rule identifier; when the effective height is not greater than the current block height, the configuration rule is invalid and the configuration terminal can terminate the configuration operation.

[0134] For example, Figure 5As shown, the effective block height is BeginHeight, the current block height is LastHeight, and the historical rule identifier in the historical rule information is LastID; when BeginHeight>LastHeight, the new rule identifier is LastID+1, and the effective block height BeginHeight remains unchanged, so as to generate updated rule information based on LastID+1 and BeginHeight.

[0135] When BeginHeight≤LastHeight, it indicates that the configuration operation is invalid and the rule configuration process is terminated, which can effectively avoid the problem of inconsistent rules of synchronization nodes seen by each sending node at the same height and ensure the effectiveness of data synchronization.

[0136] In other implementations, when there is no historical rule identifier in the historical rule information, a new rule identifier is generated; and a target rule corresponding to the starting block height is generated according to the new rule identifier.

[0137] Among them, the newly added rule identifier can be a rule identifier with ID 0, that is, LastID = 0. At this time, the update rule information can be generated based on LastID + 1 and BeginHeight. In other words, when the blockchain node to be configured is first configured with rules, the effective block height can be less than the current block height, so that when the synchronization node is newly added to the blockchain network, it can apply the synchronization rules from the starting block.

[0138] The embodiment of the present application also provides a possible implementation method. When no height indication for the blockchain node to be configured is received, the effective block height can be determined based on the current block height, and the target rule corresponding to the blockchain node to be configured is generated based on the historical rule information and the effective block height. For example, the effective block height can be the current block height plus the preset unit height, that is, BeginHeight=LastHeight+1.

[0139] A possible implementation method is provided in the embodiment of the present application, such as Figure 6 As shown, the above configuration of the blockchain node to be configured based on the target rule and the generation of the synchronization node include:

[0140] When there are historical synchronization rules corresponding to the effective block height in the historical rule information, the historical synchronization rules corresponding to the effective block height are replaced with the target rules to update the rule information of the blockchain node to be configured, and the updated blockchain node to be configured is used as the synchronization node.

[0141] When there is no historical synchronization rule corresponding to the effective block height in the historical rule information, the target rule is added to the rule information of the blockchain node to be configured to update the rule information of the blockchain node to be configured, and the updated blockchain node to be configured is used as the synchronization node.

[0142] The embodiment of the present application determines whether the node to be configured has been configured with a synchronization rule that is highly consistent with the effective block of the target rule by comparing the historical rule information; when the historical rule information is queried and it is determined that there is already a historical synchronization rule that is highly consistent with the effective block of the target rule, the target rule can be used to replace the historical synchronization rule; when the historical rule information is queried and it is determined that there is no historical synchronization rule that is highly consistent with the effective block of the target rule, the target rule can be directly added to the rule information of the node to update the generated synchronization node. The embodiment of the present application implements node update and configuration based on the effective block height, which can ensure the consistency and effectiveness of the synchronization rules configured by the synchronization node, and lay a good foundation for the stability of subsequent data synchronization.

[0143] The present application provides a data processing method, such as Figure 7 As shown, it can be applied to a sending node in a blockchain network, and the method includes:

[0144] S501, receiving an information synchronization request sent by a synchronization node.

[0145] The above information synchronization request is used to request to obtain the node information data of the sending node.

[0146] Specifically, the sending node and the synchronization node can be connected for communication based on a wired or wireless network; the sending node and the synchronization node can be servers that can communicate with each other in the blockchain system.

[0147] S502: In response to the information synchronization request, query and obtain rule information configured by the synchronization node based on the node identifier of the synchronization node.

[0148] The rule information includes the rule identifier of the synchronization rule configured by the synchronization node and the effective block height of the synchronization rule.

[0149] In the embodiment of the present application, each synchronization node is configured with a synchronization rule, which is used to filter data when synchronizing block data. Each synchronization rule corresponds to a rule identifier, an effective block height, and a rule content. The node identifier of the synchronization node and the latest rule identifier corresponding to the synchronization node can be stored in the form of a key-value pair, for example, the node ID corresponding to each synchronization node can be stored in correspondence with the latest rule ID.

[0150] Specifically, the synchronization node can send an information synchronization request to at least two sending nodes. Each sending node responds to the information synchronization request, determines the rule information of the corresponding synchronization node that can be queried from the sending node based on the node identifier of the synchronization node, and sends the above rules to the synchronization node.

[0151] S503, sending the rule information and the block height of the sending node to the synchronization node.

[0152] In some implementations, the sending node sends the rule information and the block height of the sending node to the synchronization node, and the synchronization node can filter out the target node from each sending node based on the rule identifier and effective block height of the received synchronization rule.

[0153] S504: Receive a data synchronization request sent by the synchronization node.

[0154] Among them, the data synchronization request is sent by the synchronization node based on the block height of the sending node and the rule information corresponding to the synchronization node queried by the sending node; the block height of the sending node is greater than the effective block height in the rule information.

[0155] In some implementations, the synchronization node may screen the effective block heights of the synchronization rules corresponding to each sending node to obtain candidate sending nodes whose block heights are greater than the corresponding effective block heights; then query the rule information corresponding to each candidate sending node, and use the candidate sending node whose rule identifier is not empty as the target node;

[0156] In other implementations, the synchronization node may query the rule information corresponding to each sending node, and use the sending nodes whose rule identifiers are not empty as candidate sending nodes; then the effective block heights of the synchronization rules corresponding to each candidate sending node are screened to obtain the target node.

[0157] After determining that the sending node is the target node, the synchronization node may send a data synchronization request to the target node.

[0158] S505 , in response to the data synchronization request, determining the return data of the information synchronization request based on the rule information, and sending the return data to the synchronization node.

[0159] The data synchronization request may include the requested block height of the synchronization node.

[0160] Specifically, the sending node responds to the data synchronization request, and according to the rule information corresponding to the queried synchronization node, filters the original block data of the sending node to obtain the block data; then the sending node returns the block data to the synchronization node. The synchronization node that receives the returned data verifies the returned data and adds the verified block data to the data set of the synchronization node.

[0161] Furthermore, the original block data may be filtered according to the rule content in the rule information; this is explained by taking the block data as transfer data as an example.

[0162] In some implementations, the rule content may be that the initiator of the transfer is object A, and the transfer triggers contract X. Then, data in which the transfer initiator is A and the transfer operation triggers contract X may be filtered out from the original block data as block data.

[0163] In other implementations, when the original block data of the sending node does not meet the content of the rule, the attribute information such as the transfer ID and the transfer hash value in the original block data can be obtained and used as the block data. The attribute information can be used to verify the legitimacy of the block data.

[0164] In an embodiment of the present application, the synchronization node sends an information synchronization request to at least two sending nodes to obtain the block heights of at least two sending nodes, as well as the rule information of the corresponding synchronization node queried from each sending node; then, based on the rule identifier and effective block height of the corresponding synchronization rule in the rule information, the target node is screened out from each sending node; and a data synchronization request is sent to the target node to obtain the block data of the target node; then the synchronization node verifies the block data, and adds the verified block data to the data set of the synchronization node. The embodiment of the present application configures the synchronization node with corresponding synchronization rules, realizes data synchronization based on the synchronization rules and the effective block height of the synchronization rules, can screen the sending nodes according to the synchronization rules, and the block height of the screened target node is greater than the effective block height corresponding to the synchronization node queried by the target node, effectively ensuring accurate communication between blockchain nodes without wasting network and storage resources. Different from the prior art in which complete data of the entire block at a certain block height is obtained based on the block height of the node, the synchronization node in the embodiment of the present application can obtain block data in a targeted manner based on the synchronization rules, which will not cause data leakage of the entire block, thereby ensuring the privacy and security of the block data.

[0165] In an embodiment of the present application, a possible implementation method is provided, wherein the return data of the information synchronization request is determined based on the rule information, including:

[0166] S601, obtaining candidate block data from the data set of the sending node according to the requested block height of the synchronization node.

[0167] Among them, the requested block height is smaller than the block height of the sending node and larger than the block height of the synchronization node.

[0168] In the embodiment of the present application, the requested block height may be the block height of the synchronization node plus a preset unit value. For example, if the block height of the synchronization node is Height, the requested block height may be Height+1.

[0169] S602, screening the candidate block data based on the rule information to obtain target block data; and using the target block data as return data.

[0170] Specifically, the sending node may screen the candidate block data according to the rule content in the rule information to obtain the target block data; and use the target block data as the return data.

[0171] In some implementations, the rule content may be that the initiator of the transfer is object A, and the transfer triggers contract X. Then, data in which the transfer initiator is A and the transfer operation triggers contract X may be filtered out from the original block data as block data.

[0172] The embodiment of the present application obtains candidate block data from the data set of the sending node through the request block height of the synchronization node, and then screens the candidate block data based on the rule content in the rule information to obtain the target block data as the return data of the synchronization node, thereby realizing block data screening based on synchronization rules, improving the pertinence and accuracy of data synchronization, avoiding the waste of network and storage resources, and effectively protecting the privacy and security of block data.

[0173] In order to better understand the above data processing method, Figure 8 An example of a data processing method of the present application is described in detail, the method comprising the following steps:

[0174] S701, a synchronization node may send an information synchronization request to at least two sending nodes.

[0175] The above information synchronization request is used to request to obtain the node information data of the sending node.

[0176] S702, each sending node responds to the information synchronization request, determines the rule information of the corresponding synchronization node that can be queried from the sending node based on the node identifier of the synchronization node, and sends the rule information to the synchronization node.

[0177] The rule information of each synchronization node includes the rule identifier of the synchronization rule configured by the synchronization node and the effective block height of the synchronization rule. The rule information may be pre-configured to the synchronization node by the configuration terminal.

[0178] In an embodiment of the present application, each synchronization node is configured with a synchronization rule, which is used to filter data when synchronizing block data. Each synchronization rule corresponds to a rule identifier, an effective block height, and rule content. The node identifier of the synchronization node and the latest rule identifier corresponding to the synchronization node can be stored in the form of a key-value pair. For example, the node ID corresponding to each synchronization node and the latest rule ID can be stored in correspondence; then the sending node can find the corresponding rule information based on the node identifier of the synchronization node, i.e., the node ID.

[0179] S703, after receiving the rule information returned by each sending node, the synchronization node screens the effective block height of the synchronization rule corresponding to each sending node, and obtains the candidate sending nodes whose block height is greater than the corresponding effective block height; then queries the rule information corresponding to each candidate sending node, and takes the candidate sending node whose rule identifier is not empty as the target node.

[0180] S704, the synchronization node sends a data synchronization request to the target node, and the target node filters out candidate block data from the target node's data set according to the requested block height of the synchronization node.

[0181] S705, the target node screens the candidate block data according to the rule content in the rule information to obtain the target block data; and uses the target block data as the return data and sends the return data to the synchronization node

[0182] In some implementations, the rule content may be that the initiator of the transfer is object A, and the transfer triggers contract X. Then, data in which the transfer initiator is A and the transfer operation triggers contract X may be filtered out from the original block data as block data.

[0183] In other implementations, when the original block data of the target node does not meet the rule content, the attribute information such as the transfer ID and the transfer hash value in the original block data can be obtained and used as the block data. The attribute information can be used to verify the legitimacy of the block data.

[0184] S706, the synchronization node verifies the obtained return data, and adds the verified return data to the data set of the synchronization node.

[0185] Among them, when the block data includes the original block data, the compliance and security of the block data can be directly verified, and the verified block data can be added to the data set of the synchronization node; when the block data includes the attribute information of the original block data, the compliance and security of the attribute information can be verified, and the verified block data can be added to the data set of the synchronization node.

[0186] In an embodiment of the present application, the synchronization node sends an information synchronization request to at least two sending nodes to obtain the block heights of at least two sending nodes, as well as the rule information of the corresponding synchronization node queried from each sending node; then, based on the rule identifier and effective block height of the corresponding synchronization rule in the rule information, the target node is screened out from each sending node; and a data synchronization request is sent to the target node to obtain the block data of the target node; then the synchronization node verifies the block data, and adds the verified block data to the data set of the synchronization node. The embodiment of the present application configures the synchronization node with corresponding synchronization rules, realizes data synchronization based on the synchronization rules and the effective block height of the synchronization rules, can screen the sending nodes according to the synchronization rules, and the block height of the screened target node is greater than the effective block height corresponding to the synchronization node queried by the target node, effectively ensuring accurate communication between blockchain nodes without wasting network and storage resources. Different from the prior art in which complete data of the entire block at a certain block height is obtained based on the block height of the node, the synchronization node in the embodiment of the present application can obtain block data in a targeted manner based on the synchronization rules, which will not cause data leakage of the entire block, thereby ensuring the privacy and security of the block data.

[0187] The present application embodiment provides a data processing device, such as Fig. 9 As shown, the data processing device 90 may include: a first sending module 901, a screening module 902, a second sending module 903 and a verification module 904;

[0188] The first sending module 901 is used to send an information synchronization request to at least two sending nodes to obtain the block heights of at least two sending nodes and the rule information of the corresponding synchronization node queried from each sending node; wherein the rule information of each synchronization node includes the rule identifier of the synchronization rule configured by the synchronization node and the effective block height of the synchronization rule;

[0189] The screening module 902 is used to screen out the target node from each sending node based on the rule identifier and the effective block height of the synchronization rule; wherein the block height of the target node is greater than the effective block height corresponding to the synchronization node queried by the target node;

[0190] The second sending module 903 is used to send a data synchronization request to the target node to obtain the block data of the target node;

[0191] The verification module 904 is used to verify the block data and add the verified block data to the data set of the synchronization node.

[0192] In an embodiment of the present application, a possible implementation method is provided. When the screening module 902 screens out the target node from each sending node based on the rule identifier and the effective block height of the synchronization rule, it is used to:

[0193] Query the rule information corresponding to each sending node, and take the sending nodes whose corresponding rule identifiers are not empty as candidate sending nodes;

[0194] The target node is obtained by screening from the candidate sending nodes; wherein the target node is a candidate sending node whose block height is greater than the effective block height corresponding to the queried synchronization node.

[0195] A possible implementation method is provided in an embodiment of the present application. The above-mentioned device further includes a configuration module, which is used to:

[0196] Determine the historical rule information corresponding to the blockchain node to be configured;

[0197] Receiving a height indication for a blockchain node to be configured, and generating a target rule corresponding to the blockchain node to be configured based on the historical rule information and the height indication; wherein the height indication represents an effective block height of the rule configured for the blockchain node to be configured;

[0198] Configure the blockchain nodes to be configured based on the target rules and generate synchronization nodes.

[0199] In an embodiment of the present application, a possible implementation method is provided. When the configuration module generates a target rule corresponding to the blockchain node to be configured based on the historical rule information and the height indication, it is used to:

[0200] Query the historical rule information. When there is a historical rule identifier in the historical rule information, obtain the current block height of the blockchain network; based on the current block height and the effective block height, update the historical rule information to obtain the updated rule information; generate the target rule corresponding to the starting block height according to the updated rule information;

[0201] When the historical rule identifier does not exist in the historical rule information, a new rule identifier is generated; and a target rule corresponding to the starting block height is generated according to the new rule identifier.

[0202] In an embodiment of the present application, a possible implementation method is provided. When the configuration module configures the blockchain node to be configured based on the target rule and generates the synchronization node, it is used to:

[0203] When there is a historical synchronization rule corresponding to the effective block height in the historical rule information, the historical synchronization rule corresponding to the effective block height is replaced with the target rule to update the rule information of the blockchain node to be configured, and the updated blockchain node to be configured is used as the synchronization node;

[0204] When there is no historical synchronization rule corresponding to the effective block height in the historical rule information, the target rule is added to the rule information of the blockchain node to be configured to update the rule information of the blockchain node to be configured, and the updated blockchain node to be configured is used as the synchronization node.

[0205] The present application embodiment provides a data processing device, such as Fig.10 As shown, the data processing device 100 may include: a first receiving module 1001, a query module 1002, a third sending module 1003, a second receiving module 1004 and a returning module 1005;

[0206] Wherein, the first receiving module 1001 is used to receive an information synchronization request sent by a synchronization node;

[0207] The query module 1002 is used to query and obtain the rule information configured by the synchronization node based on the node identifier of the synchronization node in response to the information synchronization request; wherein the rule information includes the rule identifier of the synchronization rule configured by the synchronization node and the effective block height of the synchronization rule;

[0208] The third sending module 1003 is used to send the rule information and the block height of the sending node to the synchronization node;

[0209] The second receiving module 1004 is used to receive a data synchronization request sent by the synchronization node; wherein the data synchronization request is sent by the synchronization node based on the block height of the sending node and the rule information corresponding to the synchronization node queried by the sending node; the block height of the sending node is greater than the effective block height in the rule information;

[0210] The return module 1005 is used to respond to the data synchronization request, determine the return data of the information synchronization request based on the rule information, and send the return data to the synchronization node.

[0211] In an embodiment of the present application, a possible implementation is provided. When the return module 1005 determines the return data of the information synchronization request based on the rule information, it is used to:

[0212] Obtain candidate block data from the sending node’s data set based on the synchronization node’s requested block height;

[0213] Screening candidate block data based on rule information to obtain target block data;

[0214] The target block data is returned.

[0215] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.

[0216] In an embodiment of the present application, the synchronization node sends an information synchronization request to at least two sending nodes to obtain the block heights of at least two sending nodes, as well as the rule information of the corresponding synchronization node queried from each sending node; then, based on the rule identifier and effective block height of the corresponding synchronization rule in the rule information, the target node is screened out from each sending node; and a data synchronization request is sent to the target node to obtain the block data of the target node; then the synchronization node verifies the block data, and adds the verified block data to the data set of the synchronization node. The embodiment of the present application configures the synchronization node with corresponding synchronization rules, realizes data synchronization based on the synchronization rules and the effective block height of the synchronization rules, can screen the sending nodes according to the synchronization rules, and the block height of the screened target node is greater than the effective block height corresponding to the synchronization node queried by the target node, effectively ensuring accurate communication between blockchain nodes without wasting network and storage resources. Different from the prior art in which complete data of the entire block at a certain block height is obtained based on the block height of the node, the synchronization node in the embodiment of the present application can obtain block data in a targeted manner based on the synchronization rules, which will not cause data leakage of the entire block, thereby ensuring the privacy and security of the block data.

[0217] In an embodiment of the present application, an electronic device is provided, including a memory, a processor and a computer program stored in the memory, and the processor executes the above-mentioned computer program to implement the steps of the data processing method, which can be implemented compared with the related art: In an embodiment of the present application, the synchronization node sends an information synchronization request to at least two sending nodes to obtain the block height of at least two sending nodes, and the rule information of the corresponding synchronization node queried from each sending node; then based on the rule identifier and the effective block height of the corresponding synchronization rule in the rule information, the target node is screened out from each sending node; and a data synchronization request is sent to the target node to obtain the block data of the target node; then the synchronization node verifies the block data and adds the verified block data to the data set of the synchronization node. The embodiment of the present application configures the corresponding synchronization rules for the synchronization node, realizes data synchronization based on the synchronization rules and the effective block height of the synchronization rules, can screen the sending nodes according to the synchronization rules, and the block height of the screened target node is greater than the effective block height corresponding to the synchronization node queried by the target node, effectively ensuring the accurate communication between the blockchain nodes, and will not cause waste of network and storage resources. Different from the prior art in which complete data of the entire block at a certain block height is obtained based on the block height of the node, the synchronization node in the embodiment of the present application can obtain block data in a targeted manner based on the synchronization rules, which will not cause data leakage of the entire block, thereby ensuring the privacy and security of the block data.

[0218] In an alternative embodiment, an electronic device is provided, such as Fig.11 As shown, Fig.11 The electronic device 110 shown includes: a processor 1101 and a memory 1103. The processor 1101 and the memory 1103 are connected, such as through a bus 1102. Optionally, the electronic device 110 may also include a transceiver 1104, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 1104 is not limited to one, and the structure of the electronic device 110 does not constitute a limitation on the embodiments of the present application.

[0219] Processor 1101 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 1101 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0220] The bus 1102 may include a path to transmit information between the above components. The bus 1102 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 1102 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.11 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0221] The memory 1103 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.

[0222] The memory 1103 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 1101. The processor 1101 is used to execute the computer program stored in the memory 1103 to implement the steps shown in the above method embodiment.

[0223] The electronic devices include, but are not limited to, mobile terminals such as mobile phones, notebook computers, PADs, etc. and fixed terminals such as digital TVs, desktop computers, etc.

[0224] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.

[0225] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that when the computer device executes the computer instructions, the following conditions are achieved:

[0226] Sending information synchronization requests to at least two sending nodes to obtain the block heights of at least two sending nodes and the rule information of the corresponding synchronization nodes queried from each sending node; wherein the rule information of each synchronization node includes the rule identifier of the synchronization rule configured by the synchronization node and the effective block height of the synchronization rule;

[0227] Based on the rule identifier and effective block height of the synchronization rule, the target node is selected from each sending node; wherein the block height of the target node is greater than the effective block height corresponding to the synchronization node queried by the target node;

[0228] Send a data synchronization request to the target node to obtain the block data of the target node;

[0229] Verify the block data and add the verified block data to the data set of the synchronization node.

[0230] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.

[0231] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios at the execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.

[0232] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.

Claims

1. A data processing method, applied to a synchronization node in a blockchain network, characterized in that: include: Sending an information synchronization request to at least two sending nodes to obtain the block heights of the at least two sending nodes and the rule information of the corresponding synchronization nodes queried from each of the sending nodes; wherein the rule information of each synchronization node includes a rule identifier of the synchronization rule configured by the synchronization node and an effective block height of the synchronization rule; Based on the rule identifier and the effective block height of the synchronization rule, a target node is screened out from each of the sending nodes; wherein the block height of the target node is greater than the effective block height corresponding to the synchronization node queried by the target node; Sending a data synchronization request to the target node to obtain the block data of the target node; The block data is verified, and the block data that passes the verification is added to the data set of the synchronization node.

2. The method according to claim 1, characterized in that The step of selecting a target node from each of the sending nodes based on the rule identifier and the effective block height of the synchronization rule includes: Querying the rule information corresponding to each of the sending nodes, and taking the sending nodes whose corresponding rule identifiers are not empty as candidate sending nodes; A target node is obtained by screening from the candidate sending nodes; wherein the target node is a candidate sending node whose block height is greater than the effective block height corresponding to the queried synchronization node.

3. The method according to claim 1, characterized in that The synchronization node is configured based on the following method: Determine the historical rule information corresponding to the blockchain node to be configured; Receiving a height indication for the blockchain node to be configured, and generating a target rule corresponding to the blockchain node to be configured based on the historical rule information and the height indication; wherein the height indication represents the effective block height of the rule configured for the blockchain node to be configured; The blockchain node to be configured is configured based on the target rule to generate a synchronization node.

4. The method according to claim 3, characterized in that The generating, based on the historical rule information and the height indication, a target rule corresponding to the blockchain node to be configured includes: Query the historical rule information, and when there is a historical rule identifier in the historical rule information, obtain the current block height of the blockchain network; based on the current block height and the effective block height, update the historical rule information to obtain updated rule information; generate a target rule corresponding to the starting block height according to the updated rule information; When the historical rule identifier does not exist in the historical rule information, a new rule identifier is generated; and a target rule corresponding to the starting block height is generated according to the new rule identifier.

5. The method according to claim 3, characterized in that: The configuring the blockchain node to be configured based on the target rule to generate a synchronization node includes: When the historical rule information contains a historical synchronization rule corresponding to the effective block height, the target rule is used to replace the historical rule corresponding to the effective block height, so as to update the rule information of the blockchain node to be configured, and the updated blockchain node to be configured is used as the synchronization node; When the historical synchronization rule corresponding to the effective block height does not exist in the historical rule information, the target rule is added to the rule information of the blockchain node to be configured to update the rule information of the blockchain node to be configured, and the updated blockchain node to be configured is used as the synchronization node.

6. A data processing method, applied to a sending node in a blockchain network, characterized in that: include: Receive information synchronization request sent by synchronization node; In response to the information synchronization request, querying based on the node identifier of the synchronization node to obtain the rule information configured by the synchronization node; wherein the rule information includes the rule identifier of the synchronization rule configured by the synchronization node, and the effective block height of the synchronization rule; Send the rule information and the block height of the sending node to the synchronization node; Receive a data synchronization request sent by a synchronization node; wherein the data synchronization request is sent by the synchronization node based on the block height of the sending node and the rule information corresponding to the synchronization node queried by the sending node; the block height of the sending node is greater than the effective block height in the rule information; In response to the data synchronization request, return data of the information synchronization request is determined based on the rule information, and the return data is sent to a synchronization node.

7. The method according to claim 6, characterized in that The determining the return data of the information synchronization request based on the rule information includes: Acquire candidate block data from the data set of the sending node according to the requested block height of the synchronization node; Screening the candidate block data based on the rule information to obtain target block data; The target block data is used as the returned data.

8. A data processing device, characterized in that: include: A first sending module, used to send an information synchronization request to at least two sending nodes to obtain the block heights of the at least two sending nodes and the rule information of the corresponding synchronization node queried from each of the sending nodes; wherein the rule information of each synchronization node includes a rule identifier of the synchronization rule configured by the synchronization node and an effective block height of the synchronization rule; A screening module, configured to screen out a target node from each of the sending nodes based on the rule identifier and the effective block height of the synchronization rule; wherein the block height of the target node is greater than the effective block height corresponding to the synchronization node queried by the target node; A second sending module, used for sending a data synchronization request to the target node to obtain the block data of the target node; The verification module is used to verify the block data and add the verified block data to the data set of the synchronization node.

9. A data processing device, characterized in that: include: A first receiving module, used for receiving an information synchronization request sent by a synchronization node; A query module, configured to query and obtain the rule information configured by the synchronization node based on the node identifier of the synchronization node in response to the information synchronization request; wherein the rule information includes the rule identifier of the synchronization rule configured by the synchronization node and the effective block height of the synchronization rule; A third sending module, used to send the rule information and the block height of the sending node to the synchronization node; A second receiving module is used to receive a data synchronization request sent by a synchronization node; wherein the data synchronization request is sent by the synchronization node based on the block height of the sending node and the rule information corresponding to the synchronization node queried by the sending node; the block height of the sending node is greater than the effective block height in the rule information; A return module is used to respond to the data synchronization request, determine the return data of the information synchronization request based on the rule information, and send the return data to the synchronization node.

10. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.

11. 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 7 are implemented.

12. A computer program product, comprising a computer program, 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 7 are implemented.