Block data storage method and device and storage medium

By grouping nodes in the blockchain and broadcasting node ID information and new block data, the performance consumption problem caused by the large number of nodes in the blockchain is solved, and efficient and secure data storage is achieved.

CN121367700APending Publication Date: 2026-01-20MIGU CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511310328.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-12
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

In blockchains with a large number of nodes, existing technologies require broadcasting new block data to other nodes separately, which increases the performance overhead of data storage.

Method used

By grouping nodes in the blockchain, obtaining node ID information from the first node, identifying multiple information receiving nodes, and broadcasting the node ID information and new block data to these nodes, the new block data is stored only to the corresponding nodes in multiple second node groups, reducing the number of broadcasts.

Benefits of technology

It reduces the performance consumption of blockchain data storage, improves the efficiency and security of data storage, and increases the difficulty for attackers to launch attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121367700A_ABST
    Figure CN121367700A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a block data storage method and device and a storage medium, and the method comprises the steps: obtaining the node number information of a first node in a first node group through employing the first node under the condition that the first node in the first node group in a block chain receives new block data; the first node is any node in the block chain; determining a plurality of information receiving nodes for receiving the broadcast information in a plurality of second node groups in the block chain by using the first node; the plurality of second node groups are node groups except the first node group in the block chain; the plurality of second node groups are in one-to-one correspondence with the plurality of information receiving nodes; and respectively broadcasting the node number information and the new block data to the plurality of information receiving nodes by using the first node, so as to respectively store the new block data to the nodes corresponding to the node number information in the plurality of second node groups by using the plurality of information receiving nodes. Through the method and the device, the performance consumption during block chain data storage can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of blockchains, and in particular to a block data storage method, device and storage medium. BACKGROUND

[0002] In related technologies, when any one node in a blockchain uploads new block data, the any one node will broadcast the new block data to other nodes in the blockchain in turn, so that the other nodes in the blockchain also store the new block data. In the case of a large number of nodes in the blockchain, the any one node needs to broadcast the new block data to the other nodes in the blockchain in turn, which increases the performance consumption when storing the blockchain data. SUMMARY

[0003] To solve the above technical problems, the embodiments of the present application aim to provide a block data storage method, device and storage medium, which can reduce the performance consumption when storing the blockchain data.

[0004] The technical solution of the present application is implemented as follows:

[0005] The embodiments of the present application provide a block data storage method, which comprises:

[0006] When a first node in a first node group in a blockchain receives new block data, the first node obtains node number information of the first node in the first node group by using the first node; the first node is any one node in the blockchain;

[0007] The first node determines a plurality of information receiving nodes receiving broadcast information in a plurality of second node groups in the blockchain by using the first node; the plurality of second node groups are node groups other than the first node group in the blockchain; the plurality of second node groups correspond to the plurality of information receiving nodes one by one;

[0008] The first node broadcasts the node number information and the new block data to the plurality of information receiving nodes respectively by using the first node, so that the plurality of information receiving nodes store the new block data to nodes corresponding to the node number information in the plurality of second node groups respectively.

[0009] The embodiments of the present application provide an electronic device, which comprises a processor and a memory for storing a computer program capable of running on the processor,

[0010] When the processor runs the computer program, the processor performs the steps of the block data storage method described above.

[0011] The embodiment of the present application provides a storage medium, which stores a computer program, and the computer program is characterized in that the computer program is executed by a processor to realize the steps of the block data storage method.

[0012] The embodiment of the present application further provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to realize the steps of the block data storage method.

[0013] The embodiment of the present application provides a block data storage method, equipment and storage medium, the block data storage method comprises the following steps: in the case that a first node in a first node group in a block chain receives new block data, the first node obtains node number information of the first node in the first node group; the first node is any node in the block chain; the first node determines a plurality of information receiving nodes receiving broadcast information in a plurality of second node groups in the block chain; the plurality of second node groups are node groups other than the first node group in the block chain; the plurality of second node groups correspond to the plurality of information receiving nodes one by one; the first node broadcasts the node number information and the new block data to the plurality of information receiving nodes respectively, so that the plurality of information receiving nodes respectively store the new block data into nodes corresponding to the node number information in the plurality of second node groups. The method achieves the following effects: in the case that the first node in the first node group of the block chain receives the new block data, the first node determines a plurality of information receiving nodes receiving broadcast information in a plurality of second node groups other than the first node group in the block chain; then, the new block data and the node number information of the first node are broadcast to the plurality of information receiving nodes in the node group, so that the plurality of information receiving nodes respectively store the new block data into nodes corresponding to the node number information in the plurality of second node groups, that is, the new block data is only broadcast to one node in the plurality of second node groups, and the new block data does not need to be broadcast to other nodes in the block chain except the first node, thereby reducing the performance consumption when the block chain data is stored. BRIEF DESCRIPTION OF DRAWINGS

[0014] Figure 1 It is a block data storage method schematic diagram in the prior art;

[0015] Figure 2 It is a block data storage method flowchart provided by the embodiment of the present application;

[0016] Figure 3 It is a schematic diagram of node grouping in a block chain provided by the embodiment of the present application;

[0017] Figure 4 It is a schematic diagram of node number information in a plurality of node groups provided by the embodiment of the present application;

[0018] Figure 5 This is an exemplary schematic diagram illustrating the determination of node numbering information for an embodiment of this application.

[0019] Figure 6 An exemplary block data storage method provided in this application embodiment is illustrated. Figure 1 ;

[0020] Figure 7 An exemplary block data storage method provided in this application embodiment is illustrated. Figure 2 ;

[0021] Figure 8 An exemplary block data storage method provided in this application embodiment is illustrated. Figure 3 ;

[0022] Figure 9 A schematic diagram illustrating the composition structure of a blockchain network service platform provided in this application embodiment;

[0023] Figure 10 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0025] Block data storage methods in related technologies, such as Figure 1 As shown: Any node in the blockchain (e.g. Figure 1 If node a) uploads new block data, that node will broadcast the new block data to other nodes in the blockchain in sequence (e.g., ...). Figure 1 The new block data is then broadcast to nodes b, c, d, ... in the blockchain, allowing other nodes in the blockchain to also store the new block data. When there are many nodes in the blockchain, each node needs to broadcast the new block data to the other nodes in the blockchain sequentially, increasing the performance overhead of blockchain data storage.

[0026] The problems existing in the related technologies can be solved by means of the methods in the following embodiments.

[0027] This application provides a method for storing block data. Figure 2 A flowchart of a block data storage method provided in this application embodiment is shown below. Figure 2 As shown, block data storage methods may include:

[0028] S101, in the case that the first node in the first node group receives new block data in the blockchain, the first node obtains node number information of the first node in the first node group.

[0029] The block data storage method provided by the embodiment of the present application is suitable for the scenario of storing new block data in the blockchain.

[0030] The block data storage method is applied to a blockchain network service platform or a large-scale node blockchain system, for example, and the number of nodes can be determined according to actual conditions, which is not limited in the embodiment of the present application.

[0031] It should be noted that the first node is any node in the blockchain.

[0032] In the embodiment of the present application, the blockchain includes a plurality of node groups, and the first node group is any one of the plurality of node groups.

[0033] In the embodiment of the present application, the first node group includes a plurality of nodes, and the plurality of nodes include the first node. The plurality of nodes in the first node group are all provided with corresponding node number information, and the node number information of each node in the first node group is different.

[0034] It should be noted that the node number information in the first node group is sorted in ascending order.

[0035] It should be noted that each node group in the plurality of node groups includes a plurality of nodes, that is, the number of nodes in any two node groups in the plurality of node groups is the same. And the node number information of the plurality of nodes in each node group in the plurality of node groups is sorted in ascending order.

[0036] It should also be noted that the codes of the nodes in any two node groups in the plurality of node groups are the same. For example, there are three nodes in node group 1 and node group 2, the code information of the first node in node group 1 is 1, the code information of the second node in node group 1 is 2, and the code information of the first node in node group 1 is 3; the code information of the first node in node group 2 is 1, the code information of the second node in node group 2 is 2, and the code information of the first node in node group 2 is 3.

[0037] It should be noted that the number of nodes can be three, the number of nodes can also be five, and the number of nodes can also be other numbers. The number of nodes can be determined according to actual conditions, which is not limited in the embodiment of the present application.

[0038] In the embodiment of the present application, the new block data is new data to be stored by using the blockchain.

[0039] In the embodiments of the present application, the blockchain includes a public chain, a private chain, or an alliance chain, and the specific blockchain can be determined according to actual conditions, and the embodiments of the present application do not limit this.

[0040] In the embodiments of the present application, before the first node in the first node group of the blockchain network service platform receives the new block data, the first node obtains the single-group capacity information for grouping the nodes in the blockchain; the nodes in the blockchain are grouped according to the single-group capacity information, to obtain a plurality of node groups; a plurality of target nodes are determined in the plurality of node groups, and the plurality of target nodes are used to generate node numbers for each node in the plurality of node groups; and a plurality of node group information corresponding to the plurality of node groups is generated according to the plurality of node groups and the nodes in the blockchain.

[0041] It should be noted that the plurality of node groups includes the first node group and a plurality of second node groups.

[0042] In the embodiments of the present application, the nodes in the blockchain can be grouped when the blockchain network service platform is started. Before performing the grouping operation, the single-group capacity information for grouping the nodes in the blockchain needs to be obtained.

[0043] It should be noted that the single-group capacity information includes the number of nodes in the group, such as the number of nodes in each group.

[0044] In the embodiments of the present application, the single-group capacity information can be obtained from the information acquisition of the configuration information, or can be obtained from other devices, or can be generated or obtained by other means, and the specific way of obtaining the single-group capacity information can be determined according to actual conditions, and the embodiments of the present application do not limit this.

[0045] For example, the single-group capacity information can be generated and stored first, and then obtained from the storage area before grouping the nodes in the blockchain, and then the nodes in the blockchain are grouped according to the single-group capacity information to obtain a plurality of node groups.

[0046] In the embodiments of the present application, after the single-group capacity information including the number of nodes in the group is determined, the nodes in the blockchain can be randomly grouped according to the number of nodes in the group, to obtain a plurality of node groups. For example, as shown in Figure 3 The blockchain includes 30 nodes, and the number of nodes in the group in the single-group capacity information is 3, so that the 30 nodes in the blockchain are randomly grouped in groups of 3 nodes, and 10 node groups are obtained, that is, the number of the plurality of node groups is 10.

[0047] It should be noted that the data amount of the nodes in the blockchain is a multiple of the number of nodes in the single group capacity information. In this way, according to the grouping manner of the nodes in the blockchain according to the number of nodes in the single group capacity information, it can be ensured that the number of nodes in each node group is the same. For example, if the blockchain includes 30 nodes and the number of nodes in the single group capacity information is 3, then after grouping, each group contains 3 nodes, and a total of 10 node groups are formed.

[0048] In the embodiment of the present application, in each of the plurality of node groups, any node in the group can be taken as a target node, thereby obtaining a plurality of target nodes. For example, in each of the plurality of node groups, a node is randomly determined as a target node, thereby obtaining a plurality of target nodes; or in each of the plurality of node groups, the first node allocated to the group is taken as a target node, thereby determining a plurality of target nodes; or the target nodes can be determined in other manners. The specific manner of determining the target nodes can be determined according to actual conditions, and the embodiment of the present application does not limit this.

[0049] It should be noted that the number of the plurality of node groups is the same as the number of the plurality of target nodes, that is, one node group corresponds to one target node.

[0050] In the embodiment of the present application, the process of generating node numbers for each node in the plurality of node groups by using the plurality of target nodes respectively includes: generating node numbers for the nodes in the first node group corresponding to the first target node in the plurality of target nodes by using the first target node; generating node numbers for the nodes in the second node group corresponding to the second target node in the plurality of target nodes by using the second target node; generating node numbers for the nodes in the third node group corresponding to the third target node in the plurality of target nodes by using the third target node; and so on; and generating node numbers for the nodes in the last node group corresponding to the last target node in the plurality of target nodes by using the last target node.

[0051] In the embodiment of the present application, the process of generating node numbers for the nodes in the node group to which the target node belongs by using the target node includes: generating first node number information for the first node allocated to the node group, generating second node number information for the second node allocated to the node group, generating third node number information for the third node allocated to the node group, and so on, and generating last node number information for the last node allocated to the node group. The number value corresponding to the first node number information is the smallest, the number value corresponding to the last node number information is the largest, and the node number information from the first node number information to the last node number information is sequentially sorted in ascending order.

[0052] For example, the first target node generates node number information for nodes in the first node group in the following way: the first target node generates first node number information for the first node in the first node group, generates second node number information for the second node in the first node group, generates third node number information for the third node in the first node group, and so on.

[0053] It should be noted that each of the plurality of target nodes generates node number information for nodes in the node group to which the target node belongs in the same way. For example, each of the plurality of target nodes generates node number information for nodes in the node group to which the target node belongs in the same way as the first target node generates node number information for nodes in the first node group.

[0054] For example, as shown in FIG. 1, a target node generates node number information for nodes in the node group to which the target node belongs in the following way: the target node generates first node number information for the first node in the node group (order 1), generates second node number information for the second node in the node group (order 2), and generates third node number information for the third node in the node group (order 3). Figure 4 In an embodiment of the present application, the nodes in the blockchain further include node information. The node information of each node is supplemented in the plurality of node groups according to the node information, so as to obtain a plurality of sets of node information.

[0055] It should be noted that the node information further includes a node address. When broadcasting, the first node can broadcast information to the node according to the node address.

[0056] It should be noted that the plurality of node groups correspond to the plurality of sets of node group information one-to-one, that is, one node group corresponds to one set of node group information.

[0057] In an embodiment of the present application, after the nodes in each of the plurality of node groups generate node numbers, the nodes in each node group are sorted in descending order (or in ascending order) according to the node numbers.

[0058] It should be noted that each of the plurality of target nodes generates node number information for nodes in the node group to which the target node belongs in the same way. For example, each of the plurality of target nodes generates node number information for nodes in the node group to which the target node belongs in the same way as the first target node generates node number information for nodes in the first node group.

[0059] It should be noted that each of the plurality of target nodes generates node number information for nodes in the node group to which the target node belongs in the same way. For example, each of the plurality of target nodes generates node number information for nodes in the node group to which the target node belongs in the same way as the first target node generates node number information for nodes in the first node group.In the embodiment of the present application, the process of generating node numbers for each node in the plurality of node groups by the plurality of target nodes includes: generating a set of positive integers by each of the plurality of target nodes to obtain a plurality of sets of positive integers; sorting each set of positive integers in the plurality of sets of positive integers to obtain a plurality of sets of sorted positive integers; and determining the node number of each node in the plurality of node groups according to the plurality of sets of sorted positive integers.

[0060] In the embodiment of the present application, the process of generating a set of positive integers by each of the plurality of target nodes to obtain a plurality of sets of positive integers includes: generating a set of positive integers by a first target node in the plurality of target nodes to obtain a first set of positive integers; generating a set of positive integers by a second target node in the plurality of target nodes to obtain a second set of positive integers; and generating a set of positive integers by a last target node in the plurality of target nodes to obtain a last set of positive integers.

[0061] It should be noted that the process of generating a set of positive integers by a target node can be that a first preset integer is taken as starting data, a second preset integer is taken as data update step, the first preset integer is updated by the second preset integer one by one from the first preset integer as starting data, and a set of positive integers is obtained one by one. For example, the first preset integer can be 1, and the second preset integer can also be 1. The first positive integer generated can be 1. The second positive integer generated can be the sum of the first preset integer (1) and the second preset integer (1), i.e. 2. The third positive integer generated can be the sum of the second preset integer (2) and the second preset integer (1), i.e. 3. The fourth positive integer generated can be the sum of the third preset integer (3) and the second preset integer (1), i.e. 4.

[0062] In the embodiment of the present application, each set of positive integers in the plurality of sets of positive integers can be sorted in ascending order of data values to obtain a plurality of sets of sorted positive integers. Alternatively, each set of positive integers in the plurality of sets of positive integers can be sorted in descending order of data values to obtain a plurality of sets of sorted positive integers. The specific implementation manner can be determined according to actual conditions, and the embodiment of the present application does not limit the same.

[0063] In the embodiment of the present application, the plurality of sets of sorted positive integers correspond to the plurality of node groups one by one, i.e. one set of sorted positive integers corresponds to one node group.

[0064] In this embodiment, a set of sorted positive integers can be used to determine the node number of the nodes in the node group according to the order in which they are assigned to the nodes in the node group; or the node number of the nodes in the node group can be determined by selecting any positive integer from a set of sorted positive integers without replacement. The specific implementation method can be determined according to the actual situation, and this embodiment does not limit it.

[0065] For example, such as Figure 5 As shown: A target node generates a set of positive integers. Sorting these positive integers yields sorted positive integers. For each node in the node group to which the target node belongs, each node in the group can randomly select any number from the sorted positive integers without replacement, thus determining the node's corresponding number. For example, if the node group contains 3 nodes, and the sorted positive integers include sequence 1, sequence 2, and sequence 3, then for the number 1, all 3 nodes can randomly select without replacement; for the number 2, all 3 nodes can randomly select without replacement; and so on. Ultimately, one node in the group uses the number 1 as its node number, another node uses the number 2 as its node number, and the last node in the group uses the number 3 as its node number.

[0066] In this embodiment, the blockchain network service platform groups the nodes in the blockchain according to the single-group capacity information to obtain multiple node groups. Upon receiving new node information, the platform groups the new nodes corresponding to the new node information according to the number of nodes in the group indicated by the single-group capacity information to obtain at least one new group. If the number of nodes in any of the at least one new group is less than the number of nodes in the group, and the first node receives the new block data, the first node broadcasts the new block data and node number information to each node in the group so that each node in the group can store the new block data.

[0067] In this embodiment of the application, the newly added block data is the block data received by the first node after receiving the new block data and storing the new block data in accordance with the block data storage method in this application.

[0068] In the embodiment of the present application, in the case that the received new node information corresponds to less than or equal to the number of nodes in the group, the new nodes corresponding to the new node information are directly grouped into one new group to obtain at least one new group; in the case that the received new node information corresponds to more than the number of nodes in the group, the number of nodes in the group is first used to group the new nodes, and if the number of new nodes is not an integer multiple of the number of nodes in the group, the last remaining nodes after grouping are also grouped into one new group, and the number of nodes in the remaining new groups is the number of nodes in the group. In the case that the received new node information corresponds to more than the number of nodes in the group and the number of new nodes is an integer multiple of the number of nodes in the group, the number of nodes in the group is directly used to group the new nodes to obtain at least one new group, and the number of nodes in each new group is the number of nodes in the group.

[0069] In the embodiment of the present application, in the case that the number of nodes in the group indicated by the single-group capacity information is 3 and the new node information indicates that one new node is added, the one new node is grouped into one new group, and at least one new group is obtained; in the case that the number of nodes in the group indicated by the single-group capacity information is 3 and the new node information indicates that two new nodes are added, the two new nodes are grouped into one new group, and at least one new group is obtained; in the case that the number of nodes in the group indicated by the single-group capacity information is 3 and the new node information indicates that three new nodes are added, the three new nodes are grouped into one new group, and at least one new group is obtained; in the case that the number of nodes in the group indicated by the single-group capacity information is 3 and the new node information indicates that four new nodes are added, three of the four new nodes are grouped into one new group, and the remaining one new node is grouped into another new group to obtain at least two groups; and so on.

[0070] In the embodiment of the present application, in the case that the received new node information corresponds to more than the number of nodes in the group and the number of new nodes is not an integer multiple of the number of nodes in the group, the number of nodes in at least one new group obtained finally is less than the number of nodes in the group. In this case, in the case that the first node receives the new block data, the first node broadcasts the new block data and node number information to each node in the new group (the new group with a number of nodes less than the number of nodes in the group) to store the new block data in each node in any group. Alternatively, in the case that the first node receives the new block data, the first node directly broadcasts the new block data to each node in the new group (the new group with a number of nodes less than the number of nodes in the group) to store the new block data in each node in any group.

[0071] In the embodiment of the present application, the blockchain network service platform groups the new nodes corresponding to the new node information according to the number of nodes in the group indicated by the single-group capacity information, obtains at least one new group, and in the case that the number of nodes in any one of the at least one new group is equal to the number of nodes in the group, determines the new target node in the any one group; the new target node is used to generate node number for each node in the any one group; in the case that the first node receives new block data, the first node is used to broadcast the new block data and node number information to the new target node in the any one group, so that the new target node stores the new block data in the node corresponding to the node number information.

[0072] In the embodiment of the present application, the way of determining the new target node in any one group is the same as the way of determining the target node in any one of the plurality of node groups. For details, please refer to the way of determining the target node in any one of the plurality of node groups.

[0073] In the embodiment of the present application, the way of generating node number for each node in the any one group by the new target node is the same as the way of generating node number for each node in the plurality of node groups by the plurality of target nodes. For details, please refer to the way of generating node number for each node in the plurality of node groups by the plurality of target nodes.

[0074] In the embodiment of the present application, in the case that the first node receives new block data, the first node is used to broadcast the new block data and node number information to the new target node in the any one group, so that the new target node stores the new block data in the node corresponding to the node number information. Alternatively, the first node is used to determine a new information receiving node receiving broadcast information from the any one group, and then the first node is used to broadcast the new block data and node number information to the new information receiving node in the any one group, so that the new information receiving node stores the new block data in the node corresponding to the node number information.

[0075] In the embodiment of the present application, the way of determining the new information receiving node receiving broadcast information from the any one group is the same as the way of determining the information receiving node in each of the plurality of second node groups. For details, please refer to the way of determining the information receiving node in the second node.

[0076] In the embodiment of the present application, the process in which the blockchain network service platform uses the first node to obtain the node number information of the first node in the first node group also includes: using the first node to store the new block data.

[0077] In the embodiment of the present application, in the case that the first node in the blockchain receives new block data, the first node is also used to store the new block data.

[0078] In the embodiment of the present application, the blockchain network service platform determines, by using the first node, a plurality of information receiving nodes in the plurality of second node groups in the blockchain that receive the broadcast information after obtaining the node number information of the first node in the first node group.

[0079] In the embodiment of the present application, the blockchain network service platform determines, by using the first node, a plurality of information receiving nodes in the plurality of second node groups in the blockchain that receive the broadcast information after obtaining the node number information of the first node in the first node group.

[0080] It should be noted that the plurality of second node groups correspond to the plurality of information receiving nodes one-to-one, that is, one second node group corresponds to one information receiving node.

[0081] In the embodiment of the present application, the plurality of node groups of the blockchain include the first node group and the plurality of second node groups.

[0082] In the embodiment of the present application, the first node can determine the nodes in each of the plurality of second node groups from the plurality of node group information, and determine one node in each of the plurality of second node groups as an information receiving node, thereby obtaining the plurality of information receiving nodes; the first node can also determine the nodes in each of the plurality of second node groups as the information receiving nodes according to the plurality of node group information, thereby obtaining the plurality of information receiving nodes; the first node can also determine the plurality of information receiving nodes in the plurality of second node groups by other ways, and the specific implementation manner can be determined according to actual conditions, which is not limited in the embodiment of the present application.

[0083] In the embodiment of the present application, the process that the blockchain network service platform determines, by using the first node, the plurality of information receiving nodes in the plurality of second node groups in the blockchain that receive the broadcast information includes: obtaining a plurality of second node group information corresponding to the plurality of second node groups; and selecting any node in each of the plurality of second node group information as an information receiving node, thereby obtaining the plurality of information receiving nodes.

[0084] It should be noted that the plurality of second node group information is part of the plurality of node group information.

[0085] In the embodiment of the present application, the first node can obtain the plurality of second node group information from the plurality of node group information.

[0086] In the embodiments of the present application, the first node can determine, from each of the multiple sets of second node group information, a node with the same node number information as that of the first node as an information receiving node, thereby obtaining multiple information receiving nodes; the first node can also randomly select, from each of the multiple sets of second node group information, a node as an information receiving node, thereby obtaining multiple information receiving nodes; the first node can also determine, from each of the multiple sets of second node group information, a node with the smallest node coding information in the group as an information receiving node, thereby obtaining multiple information receiving nodes; the first node can also determine, from each of the multiple sets of second node group information, a node with the largest node coding information in the group as an information receiving node, thereby obtaining multiple information receiving nodes; the specific manner in which the first node selects any node from each of the multiple sets of second node group information as an information receiving node to obtain multiple information receiving nodes can be determined according to actual conditions, which is not limited in the embodiments of the present application.

[0087] In the embodiments of the present application, after the blockchain network service platform determines, by using the first node, multiple information receiving nodes in multiple second node groups in the blockchain to receive broadcast information, the first node is used to broadcast node number information and new block data to the multiple information receiving nodes respectively.

[0088] In the embodiments of the present application, after the blockchain network service platform determines, by using the first node, multiple information receiving nodes in multiple second node groups in the blockchain to receive broadcast information, the first node is used to broadcast node number information and new block data to the multiple information receiving nodes respectively.

[0089] In the embodiments of the present application, the manner in which the first node broadcasts node number information and new block data to the multiple information receiving nodes in turn can be determined according to actual conditions, which is not limited in the embodiments of the present application.

[0090] In the embodiments of the present application, after the first node broadcasts node number information and new block data to the multiple information receiving nodes in turn, the multiple information receiving nodes all receive the node number information and the new block data, each information receiving node in the multiple information receiving nodes obtains its own node number information, in the case that the node number information of each information receiving node is different from the received node number information, each information receiving node transmits the new block data to the node in the group corresponding to the received node number information, and stores the new block data by using the node corresponding to the received node number information; in the case that the node number information of each information receiving node is the same as the received node number information, each information receiving node directly stores the new block data.

[0091] It is understandable that by using the first node to broadcast node number information and new block data to multiple information receiving nodes, the new block data can be stored in multiple second node groups at the nodes corresponding to the node number information. This allows the corresponding node to be quickly located based on the node number information storing the block data when acquiring or updating new block data, thus improving the efficiency of acquiring or updating new block data.

[0092] It is also understandable that, when the first node in the first node group of the blockchain receives new block data, this application uses the first node to broadcast the node number information of the first node group and the new block data to multiple second node groups. The new block data is stored by the nodes in the multiple second node groups that have the same node number information. In the event that an attacker attacks the new block data stored in the blockchain, since the attacker does not know the node number information in each node group and which node in the node group the new block data is stored in, it increases the difficulty for the attacker to attack the new block data and provides higher security for blockchain data storage.

[0093] For example, such as Figure 6 As shown, the first node in the first node group in the blockchain ( Figure 5 When the node numbered 1 in the first node group on the left of the first row receives new block data, it uses the first node to obtain the node number information (order 1) of the first node in the first node group; it uses the first node to determine multiple second node groups in the blockchain. Figure 5 Multiple information receiving nodes (excluding the first node group on the left of the first row) receive broadcast information from the remaining node groups; the first node broadcasts node number information (order) and new block data (data) to the multiple information receiving nodes respectively. Figure 7 As shown, when multiple information receiving nodes receive new block data and node number information, they respectively store the new block data to the nodes corresponding to the node number information in multiple second node groups. That is, in the first node group, the node with the number information in sequence 1 receives and stores the new block data, and correspondingly, in multiple second node groups, the node with the number information in sequence 1 is also used to store the new block data.

[0094] In this application embodiment, an exemplary block data storage method is as follows: Figure 8 As shown:

[0095] Step A: Divide several nodes into a group: First, obtain the capacity information of a single group for grouping the nodes in the blockchain; from the nodes in the blockchain, the nodes whose number of nodes in the group indicated by the single group capacity information are a node group.

[0096] Step B: nodes in a group are forced to be sorted: determine the target node in the one node group (i.e. one target node); use the target node to generate a set of positive integers for the nodes in the one node group; sort the data in the set of positive integers to obtain sorted positive integers; determine the node number of each node in the one node group according to the sorted positive integers; and sort the one node group according to the node number of each node in the one node group.

[0097] Step C: divide all nodes in the blockchain into multiple node groups: divide all nodes in the blockchain into multiple node groups according to the manner of steps A and B.

[0098] Step D: broadcast and store data based on node groups.

[0099] It can be understood that in the case that the first node in the first node group of the blockchain receives new block data, the first node is used to determine a plurality of information receiving nodes in a plurality of second node groups in the blockchain to receive broadcast information; and then the new block data and the node number information of the first node are broadcast to the plurality of information receiving nodes respectively in units of node groups, so that the plurality of information receiving nodes respectively store the new block data to the nodes corresponding to the node number information in the plurality of second node groups, that is, only the new block data is broadcast to one node in the plurality of second node groups, and the new block data does not need to be broadcast to other nodes in the blockchain except the first node, thereby reducing the performance consumption of the blockchain data storage.

[0100] Based on the same inventive concept as the above block data storage method, the embodiment of the present application provides a blockchain network service platform 1, corresponding to a block data storage method; Figure 9 The composition structure diagram of the blockchain network service platform provided by the embodiment of the present application is shown in the figure, and the blockchain network service platform 1 can include:

[0101] The acquisition unit 11 is configured to, in the case that the first node in the first node group of the blockchain receives new block data, acquire the node number information of the first node in the first node group by using the first node; and the first node is any node in the blockchain;

[0102] The determination unit 12 is configured to determine a plurality of information receiving nodes in a plurality of second node groups in the blockchain to receive broadcast information by using the first node; the plurality of second node groups are node groups in the blockchain except the first node group; and the plurality of second node groups correspond to the plurality of information receiving nodes one by one;

[0103] ​The broadcast unit 13 is configured to broadcast the node number information and the new block data to the plurality of information receiving nodes respectively by using the first node, so as to store the new block data to the nodes corresponding to the node number information in the plurality of second node groups by using the plurality of information receiving nodes respectively.

[0104] In some embodiments of the present application, the blockchain network service platform further comprises a grouping unit and a generating unit;

[0105] The obtaining unit 11 is configured to obtain single-group capacity information of grouping nodes in a blockchain;

[0106] The grouping unit is configured to group the nodes in the blockchain according to the single-group capacity information to obtain a plurality of node groups; the plurality of node groups comprise the first node group and the plurality of second node groups;

[0107] The determining unit 12 is configured to determine a plurality of target nodes in the plurality of node groups respectively;

[0108] The generating unit is configured to generate a node number for each node in the plurality of node groups by using the plurality of target nodes respectively; and generate a plurality of groups of node group information corresponding to the plurality of node groups according to the plurality of node groups and the nodes in the blockchain.

[0109] In some embodiments of the present application, the blockchain network service platform further comprises a sorting unit;

[0110] The generating unit is configured to generate a group of positive integers by using each target node in the plurality of target nodes to obtain a plurality of groups of positive integers;

[0111] The sorting unit is configured to sort each group of positive integers in the plurality of groups of positive integers to obtain a plurality of groups of sorted positive integers;

[0112] The determining unit 12 is configured to determine a node number of each node in the plurality of node groups according to the plurality of groups of sorted positive integers.

[0113] In some embodiments of the present application, the grouping unit is configured to, in a case where new node information is received, group a new node corresponding to the new node information according to a number of nodes in a group indicated by the single-group capacity information to obtain at least one new group;

[0114] The broadcast unit 13 is configured to, in a case where the number of nodes in any one of the at least one new group is less than the number of nodes in the group and the first node receives new block data, broadcast, by the first node, the new block data and the node number information to each node in the any one group, so that each node in the any one group respectively stores the new block data.

[0115] In some embodiments of the present application, the determination unit 12 is configured to, in a case where the number of nodes in any one of the at least one new group is equal to the number of nodes in the group, determine a new target node in the any one group.

[0116] The generation unit is configured to generate, by the new target node, node numbers for each node in the any one group.

[0117] The broadcast unit 13 is configured to, in a case where the first node receives new block data, broadcast, by the first node, the new block data and the node number information to the new target node in the any one group, so that the new target node stores the new block data to the node corresponding to the node number information.

[0118] In some embodiments of the present application, the blockchain network service platform further comprises a selection unit.

[0119] The acquisition unit 11 is configured to acquire a plurality of groups of second node group information corresponding to the plurality of second node groups; the plurality of groups of second node group information is part of the plurality of groups of node group information.

[0120] The selection unit is configured to select any one node as an information receiving node from each group of second node group information of the plurality of groups of second node group information, to obtain a plurality of information receiving nodes.

[0121] In some embodiments of the present application, the blockchain network service platform further comprises a storage unit.

[0122] The storage unit is configured to store, by the first node, the new block data.

[0123] It should be noted that in actual application, the above-mentioned acquisition unit 11, determination unit 12 and broadcast unit 13 can be realized by a processor 14 on an electronic device, specifically, a CPU (Central Processing Unit), an MPU (Microprocessor Unit), a DSP (Digital Signal Processing) or an FPGA (Field Programmable Gate Array) and the like; and the above-mentioned data storage can be realized by a memory 15 on the electronic device.

[0124] The embodiments of the present application also provide an electronic device, as shown in the accompanying drawings, which comprises a processor 14, a memory 15 and a communication bus 16, the memory 15 communicates with the processor 14 through the communication bus 16, and the memory 15 stores a program executable by the processor 14, when the program is executed, the block data storage method as described above is executed by the processor 14. Figure 10

[0125] In actual application, the above-mentioned memory 15 can be a volatile memory, such as a RAM (Random-Access Memory), or a non-volatile memory, such as a ROM (Read-Only Memory), a flash memory, a HDD (Hard Disk Drive) or a SSD (Solid-State Drive), or a combination of the above-mentioned memories, and provides instructions and data to the processor 14.

[0126] The embodiments of the present application provide a computer readable storage medium, which has a computer program, when the program is executed by the processor 14, the block data storage method as described above is realized.

[0127] Exemplarily, the embodiments of the present application also provide a computer program product, which comprises a computer program, the computer program can be executed by the processor 14 in an electronic device to complete the steps of the above-mentioned block data storage method.

[0128] ​It can be understood that, in the case that the first node in the first node group of the blockchain receives the to-be-new-block data, the first node is used to determine a plurality of information receiving nodes receiving the broadcast information in a plurality of second node groups other than the first node group in the blockchain; then the new block data and the node number information of the first node are broadcast to the plurality of information receiving nodes respectively in the unit of node groups, so that the plurality of information receiving nodes respectively store the new block data to the nodes corresponding to the node number information in the plurality of second node groups, that is, the new block data is broadcast to only one node in the plurality of second node groups, and the new block data does not need to be broadcast to all the nodes other than the first node in the blockchain, thereby reducing the performance consumption of the blockchain data storage.

[0129] Those skilled in the art will understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage, etc.) containing computer-usable program code.

[0130] The present application is described with reference to flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks. Figure 1 The functions specified in one flow or multiple flows and / or blocks.

[0131] These computer program instructions can also be stored in a computer-readable memory that can guide the computer or other programmable data processing devices to work in a specific way, so that the instructions stored in the computer-readable memory produce a manufactured product including instruction devices that implement the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks. Figure 1 The functions specified in one flow or multiple flows and / or blocks.

[0132] These computer program instructions can also be loaded into a computer or other programmable data processing device, so that a series of operation steps are performed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide a process for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1one or more processes and / or blocks Figure 1 the steps of a function specified in one or more blocks.

[0133] The above descriptions are only the preferred embodiments of the application, not intended to limit the protection scope of the application.

Claims

1. A method of storing block data, characterized by, The method comprises: In the case that a first node in a first node group receives new block data in a blockchain, the first node obtains node number information of the first node in the first node group; the first node is any node in the blockchain; Using the first node, a plurality of information receiving nodes receiving broadcast information in a plurality of second node groups in the blockchain are determined; the plurality of second node groups are node groups other than the first node group in the blockchain; the plurality of second node groups correspond to the plurality of information receiving nodes one by one; Using the first node, the node number information and the new block data are broadcast to the plurality of information receiving nodes respectively, so that the plurality of information receiving nodes respectively store the new block data to the nodes corresponding to the node number information in the plurality of second node groups.

2. The method of claim 1, wherein, Before the first node in the first node group receives the new block data in the blockchain, the method further comprises: Obtaining single-group capacity information for grouping nodes in a blockchain; Grouping nodes in the blockchain according to the single-group capacity information to obtain a plurality of node groups; the plurality of node groups include the first node group and the plurality of second node groups; Determining a plurality of target nodes in the plurality of node groups respectively, and generating node numbers for each node in the plurality of node groups using the plurality of target nodes respectively; According to the plurality of node groups and the nodes in the blockchain, generating a plurality of node group information corresponding to the plurality of node groups.

3. The method of claim 2, wherein, The method further comprises: Generating a set of positive integers using each target node in the plurality of target nodes to obtain a plurality of sets of positive integers; Sorting each set of positive integers in the plurality of sets of positive integers to obtain a plurality of sets of sorted positive integers; According to the plurality of sets of sorted positive integers, determining the node number of each node in the plurality of node groups.

4. The method of claim 2, wherein, After the nodes in the blockchain are grouped according to the single-group capacity information to obtain a plurality of node groups, the method further comprises: In the case that new node information is received, grouping the new nodes corresponding to the new node information according to the number of nodes in the group indicated by the single-group capacity information to obtain at least one new group; In the case that the number of nodes in any one group in the at least one new group is less than the number of nodes in the group, and the first node receives new block data, the first node broadcasts the new block data and the node number information to each node in the any one group, so that each node in the any one group stores the new block data respectively.

5. The method of claim 4, wherein, After the new nodes corresponding to the new node information are grouped according to the number of nodes in the group indicated by the single-group capacity information to obtain at least one new group, the method further comprises: In a case that the number of nodes in at least one of the added groups is equal to the number of nodes in the group, determine an added target node in the at least one group; Generate a node number for each node in the at least one group by using the added target node; In a case that the first node receives added block data, broadcast the added block data and the node number information to the added target node in the at least one group by using the first node, so as to store the added block data to the node corresponding to the node number information by using the added target node.

6. The method of claim 1, wherein, The method further includes: Obtain a plurality of groups of second node group information corresponding to the plurality of groups of second nodes; the plurality of groups of second node group information is part of the plurality of groups of node group information; Select any node from each group of second node group information as an information receiving node to obtain the plurality of information receiving nodes.

7. The method of claim 1, wherein, The method further includes: Store the new block data by using the first node.

8. An electronic device, comprising: The method further includes: a processor and a memory for storing a computer program capable of running on the processor, wherein the processor is configured to execute the steps of the method according to any one of claims 1 to 7 when running the computer program.

9. A storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor to implement the steps of the method according to any one of claims 1 to 7.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method according to any one of claims 1 to 7.