Block chain node updating method and device, electronic equipment and readable medium
By grouping and sorting verification nodes in the blockchain, gradually updating and conducting business capability detection, the problem of complex and high cost of blockchain node update paths is solved, and a simpler and safer update process is achieved.
Patent Information
- Application Number
- CN202311466439.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-06
- Publication Date
- 2025-05-06
AI Technical Summary
There are many blockchain nodes, the update paths during the rolling upgrade process are complex, difficult and work-intensive, which increases the risk and maintenance costs of blockchain updates.
By obtaining the network connection relationship of multiple verification nodes in the blockchain, dividing them into multiple node packets and sorting them, gradually updating, and conducting business capability detection within each packet to ensure that the update is successful and the next packet is updated.
It reduces the difficulty and workload of blockchain updates, reduces update risks and maintenance costs, and simplifies the update path.
Smart Images

Figure CN119938675A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device and readable medium for updating a blockchain node. Background Art
[0002] With the rapid development of blockchain technology, more and more offline businesses are being transferred online through the combination of blockchain business. For some businesses, different locations or different node providers are required to have access to different data. In the blockchain, payment verification nodes can be used to achieve data clearing and isolation.
[0003] In the related art, when the payment verification node in the blockchain needs to be updated, each node in the blockchain will be rolled out.
[0004] However, there are a large number of nodes in the blockchain, and the update path of the nodes is complex during the rolling upgrade of each node. The update process is difficult and labor-intensive, which increases the risk and maintenance cost of blockchain updates. Summary of the invention
[0005] Based on the above technical problems, the present application provides a blockchain node update method, device, electronic device and readable medium to reduce the risk and maintenance cost of blockchain updates.
[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0007] According to one aspect of an embodiment of the present application, a method for updating a blockchain node is provided, comprising:
[0008] Get the network connection relationship of multiple verification nodes in the blockchain;
[0009] According to the network connection relationship of the multiple verification nodes, the multiple verification nodes are divided into multiple node groups and sorted to obtain a node group sequence, wherein the verification nodes included in each node group in the multiple node groups are different;
[0010] Updating each verification node in the current node group in the node group sequence;
[0011] After each verification node in the current node group is updated, performing a service capability test on each verification node in the current node group;
[0012] If each verification node in the current node group passes the service capability detection, each verification node in the first subsequent node group is updated, and the first subsequent node group is the next node group adjacent to the current node group in the node group sequence.
[0013] According to one aspect of an embodiment of the present application, a device for updating a blockchain node is provided, including:
[0014] A relationship acquisition module, configured to acquire network connection relationships of multiple verification nodes in the blockchain;
[0015] A node grouping module, configured to divide the plurality of verification nodes into a plurality of node groups and sort them according to the network connection relationship of the plurality of verification nodes to obtain a node grouping sequence, wherein the verification nodes contained in each of the plurality of node groups are different;
[0016] A first updating module is configured to update each verification node in a current node group in the node grouping sequence;
[0017] A capability detection module, configured to perform a service capability detection on each verification node in the current node group after each verification node in the current node group is updated;
[0018] The second update module is configured to update each verification node in the first subsequent node group if each verification node in the current node group passes the business capability detection, and the first subsequent node group is the next node group adjacent to the current node group in the node group sequence.
[0019] In some embodiments of the present application, based on the above technical solution, the node grouping module is specifically configured to: determine the network level of each verification node according to the network connection relationship; divide the verification nodes of the same network level among the multiple verification nodes into the same group to obtain multiple node groups, and each node group corresponds to a different network level; sort the multiple node groups according to the order of the network level to obtain a node group sequence.
[0020] In some embodiments of the present application, based on the above technical solution, the node grouping module is further configured to: determine the number of verification nodes in each node group; and determine the order of the network hierarchy according to the number of nodes in each node group.
[0021] In some embodiments of the present application, based on the above technical solution, the blockchain data contained in the verification nodes in the same network layer is different; the node grouping module is also configured to: determine the data volume of each node group according to the blockchain data contained in each verification node in each node group; determine the order of the network layer according to the data volume of each node group.
[0022] In some embodiments of the present application, based on the above technical solution, the node grouping module is specifically configured to: determine the administrative district to which each verification node belongs according to the network connection relationship; divide the hierarchical relationship between the administrative districts to which each verification node belongs, and divide the verification nodes of the administrative districts with subordinate relationships into the same node group to obtain multiple node groups, each node group corresponding to the highest-level administrative district contained in the node group; sort the multiple node groups according to the order of the administrative districts to obtain a node group sequence.
[0023] In some embodiments of the present application, based on the above technical solution, the node grouping module is further configured to: determine the number of verification nodes in the node grouping corresponding to each administrative district; and determine the order of the administrative districts according to the number of nodes in each administrative district.
[0024] In some embodiments of the present application, based on the above technical solution, the node grouping module is also configured to: determine the amount of data corresponding to each administrative district according to the blockchain data contained in each verification node in the node group corresponding to each administrative district; determine the order of the administrative districts according to the amount of data corresponding to each administrative district.
[0025] In some embodiments of the present application, based on the above technical solution, the first update module is specifically configured to: stop each verification node in the current node group, and perform node update according to the update data corresponding to each verification node; re-establish the node connection between the updated verification node and other blockchain nodes in the blockchain.
[0026] In some embodiments of the present application, based on the above technical solution, the second update module is further configured to: after the update of each verification node in the first subsequent node group is completed, a business capability test is performed on each verification node in the first subsequent node group; if each verification node in the first subsequent node group passes the business capability test, each verification node in the second subsequent node group is updated until all verification nodes in each node group in the node grouping sequence are updated, and the second subsequent node group is the next node group adjacent to the first subsequent node group in the node grouping sequence.
[0027] In some embodiments of the present application, based on the above technical solution, the second update module is further configured to: if there is a verification node in the first subsequent node group that fails the business capability detection, then a node update rollback is performed on each verification node in the first subsequent node group.
[0028] In some embodiments of the present application, based on the above technical solution, the second update module is further configured to: if each verification node in the current node group passes the business capability detection, then each verification node in the previous node group is updated until each verification node in each node group in the node group sequence is updated, and the previous node group is the previous node group adjacent to the current node group in the node group sequence.
[0029] According to one aspect of an embodiment of the present application, an electronic device is provided, which includes: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute a blockchain node update method as in the above technical solution by executing the executable instructions.
[0030] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, a method for updating a blockchain node in the above technical solution is implemented.
[0031] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being 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 the computer device executes the update method of the blockchain node provided in the above-mentioned various optional implementations.
[0032] In the embodiment of the present application, the verification nodes are grouped according to the network connection relationship between the verification nodes, and each verification node in each group is updated. After each verification node in the group is updated, the service capability of each verification node in the group is tested. If all verifications are passed, the verification node in the next group is updated. By grouping and updating the verification nodes, since there are fewer nodes in each group, the update path is simpler, the difficulty and workload of blockchain updates are reduced, thereby reducing the risk and maintenance cost of blockchain updates.
[0033] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0035] Figure 1 This is a system architecture for an update solution applied to blockchain nodes according to an embodiment of the present application.
[0036] Figure 2 This is a schematic diagram of a blockchain network in an embodiment of the present application.
[0037] Figure 3 This is a schematic diagram of blocks in a blockchain network in an embodiment of the present application.
[0038] Figure 4 The present invention is a flowchart of a method for updating a blockchain node according to an embodiment of the present application.
[0039] Figure 5 The present invention is a flowchart of a method for updating a blockchain node according to an embodiment of the present application.
[0040] Figure 6 This is a schematic diagram of grouping according to network level in an embodiment of the present application.
[0041] Figure 7 The present invention is a flowchart of a method for updating a blockchain node according to an embodiment of the present application.
[0042] Figure 8 This is a schematic diagram of grouping according to administrative regions in an embodiment of the present application.
[0043] Fig. 9 The present invention is a flowchart of a method for updating a blockchain node according to an embodiment of the present application.
[0044] Fig.10 The block diagram schematically shows the composition of the updating device of the blockchain node in the embodiment of the present application.
[0045] Fig.11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0046] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0047] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0048] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0049] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0050] It should be understood that the solution of the present application can be applied to online business implementation scenarios based on blockchain, and specifically applied to online bill systems based on blockchain for issuing electronic bills. Such bill systems are usually deployed across administrative regions, each administrative region has its own blockchain node, and the connection relationship between the corresponding blockchain nodes is constructed according to the subordinate relationship between different administrative regions. For example, there are nodes corresponding to City A and nodes corresponding to District B of City A in the blockchain. Since District B is an administrative district belonging to City A, the node of District B is connected to the node of City A. The blockchain can also include nodes corresponding to District D of City C. Since District D is not an administrative district of City A, the node of District D is not connected to the node of City A. In the online bill system, the data between administrative districts of the same level and between administrative districts without a subordinate relationship are usually isolated from each other and invisible. For example, the nodes in District B of City A and the nodes in District E of City A belong to the nodes of the same administrative district, so they are isolated from each other and the data is not visible, while the nodes in City A and the nodes in District D of City C belong to the nodes of administrative districts without subordinate relationships, and they also need to be isolated from each other and the data is not visible. However, the nodes in District B of City A and the nodes in City A belong to the nodes of administrative districts with subordinate relationships, so the nodes of the two will not be isolated from each other, and the data of the district-level District B nodes are visible to the nodes in City A with a higher administrative level. These nodes that need to be isolated and invisible from each other can use light node verification nodes, referred to as verification nodes in this article. Light node verification nodes are nodes that must store complete blockchain data. These nodes will download data from the consensus nodes in the blockchain when they need it. In this application, they can also be downloaded from the nodes at the next higher level. The verification nodes in this application only contain the bill data related to the corresponding administrative area, so as to achieve the effect of mutual isolation and invisible data.
[0051] With the rapid development of blockchain technology, more and more offline businesses are being transferred online through the combination of blockchain business. For some businesses, different locations or different node providers are required to have access to different data. In the blockchain, payment verification nodes can be used to achieve data clearing and isolation. In related technologies, when the payment verification nodes in the blockchain need to be updated, each node in the blockchain will be rolled up. However, there are a large number of nodes in the blockchain. In the process of rolling up each node, the update path of the node is complicated, the update process is difficult and the workload is large, which increases the risk and maintenance cost of blockchain updates.
[0052] Based on this, the technical solution of the embodiment of the present application proposes a blockchain node update solution. This processing solution can be applied to a blockchain with a verification node and executed by an update management system of the blockchain node. Specifically, Figure 1As shown, the system architecture 100 of the update solution applied to the blockchain node according to the embodiment of the present application may include a consensus node in the consensus network and a verification node in the verification node network. It can be understood that Figure 1 The number of nodes in the example is only an example. This application does not limit the number of consensus nodes and verification nodes in the blockchain. Figure 1 It can be seen that the nodes in the consensus network are complete nodes in the blockchain, which contain all the data in the blockchain. These consensus nodes are usually deployed at the headquarters of the online bill system of the electronic bill, and the verification nodes of each administrative region are deployed in the bill center of each administrative region, such as Figure 1 As shown in the figure, a regional headquarters sets up a first-level verification node, and each provincial region under the regional headquarters sets up a second-level verification node to be responsible for the bill circulation management within each province. The third-level verification node is deployed in the bill center of each city, responsible for the bill circulation management within the city, and the fourth-level verification node is deployed in the bill center of each district, responsible for the bill circulation management within the district. The upper and lower verification nodes have data affiliation and clearing functions. For example, the provincial verification node has the bill data in the municipal verification node, and two verification nodes in different provinces cannot see each other's bill data. Figure 1 As shown, due to the affiliation between the verification nodes, the verification node network is generally in a tree structure, and each branch corresponds to a province under the region. It can be understood that according to the different administrative regions covered by the blockchain, the levels of the corresponding administrative regions and the administrative regions corresponding to the branches are also different. For example, the first-level verification node can correspond to the provincial administrative region, and each branch in the verification node network can correspond to a municipal administrative region.
[0053] Blockchain is a peer-to-peer distributed ledger consisting of multiple nodes. Each node contains all transaction records, and all nodes need to verify each transaction. Each node in the blockchain network can be a full node or a local blockchain node. A full node can be connected to other nodes, while a local blockchain node refers to an independent node running in the blockchain and is not connected to other nodes. A local blockchain node does not participate in the consensus mechanism of the blockchain network like a full node, but it can independently verify transactions and create new blocks. The confidential information sent by the second node to the first node can only be decrypted by the first node to obtain the content, thereby achieving confidential communication between the two nodes.
[0054] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks (i.e. blocks) generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain is maintained by the nodes in the blockchain network. For example, Figure 1 The specific structure of the consensus network shown in can be as follows Figure 2 As shown. Figure 2 The blockchain network shown may include multiple nodes 201, and the multiple nodes 201 may be the various clients forming the blockchain network. Each node 201 may receive input information during normal operation, and maintain the shared data in the blockchain network based on the received input information. In order to ensure the information intercommunication within the blockchain network, there may be an information connection between each node in the blockchain network, and information may be transmitted between nodes through the above information connection. For example, when any node in the blockchain network receives input information, other nodes in the blockchain network obtain the input information according to the consensus algorithm, and store the input information as shared data, so that the data stored on all nodes in the blockchain network are consistent.
[0055] The physical device of node 201 may include a smart phone, a tablet computer, a laptop computer, an intelligent voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, etc. The physical device of node 201 may also be a server that provides various services, which may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The nodes 201 may communicate with each other through a network, and the network may be a communication medium of various connection types that can provide communication links between nodes 201, such as a wired communication link or a wireless communication link.
[0056] According to the implementation needs, the system architecture in the embodiment of the present application can have any number of terminal devices, networks and servers. For example, node 201 can be a server group composed of multiple server devices. In addition, the technical solution provided in the embodiment of the present application can be applied to the terminal device or server of any node, or can be implemented by the terminal device and the server together, and the present application does not make special restrictions on this.
[0057] Each node in the blockchain network has a corresponding node identifier, and each node in the blockchain network can store the node identifiers of other nodes, so that the generated blocks can be broadcast to other nodes in the blockchain network according to the node identifiers of other nodes. A node identifier list can be maintained in each node, and the node name and node identifier are stored in the node identifier list accordingly. The node identifier can be an IP (Internet Protocol, a protocol for interconnecting networks) address or any other information that can be used to identify the node.
[0058] Each node in the blockchain network stores the same blockchain. The blockchain consists of multiple blocks, see Figure 3 As shown, the blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores input information feature values, version numbers, timestamps, and difficulty values, and the block body stores input information. The next block of the genesis block uses the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores input information feature values of the current block, feature values of the block header of the parent block, version numbers, timestamps, and difficulty values, and so on. This ensures that the block data stored in each block in the blockchain is associated with the block data stored in the parent block, thereby ensuring the security of the input information in the block.
[0059] The implementation details of the technical solution of the embodiment of the present application are described in detail below: Figure 4 A flowchart of a method for updating a blockchain node according to an embodiment of the present application is shown. The method for updating a blockchain node can be specifically executed by a device for managing verification nodes in a blockchain, such as a server or terminal device where an update management system for verification nodes is located. Figure 4 As shown, the updating method of the blockchain node at least includes steps S410 to S450, which are described in detail as follows:
[0060] Step S410, obtaining the network connection relationship of multiple verification nodes in the blockchain.
[0061] In an embodiment of the present application, the update management system will obtain the network connection relationship of multiple verification nodes in the blockchain. The network connection relationship can be specifically as follows Figure 1The network topology diagram shown. Specifically, the update management system can first obtain the node network information of each verification node in the blockchain, such as the node network information including the IP address of the node, the identification of the verification node, the identification of the computer room where the node server is located, and the identification of the network layer where the verification node is located, and construct the network topology diagram of the verification node network based on this information. It can be understood that the network topology diagram is only a form of information organization and presentation of network connection relationships, and the solution of the present application can also be adopted in other ways, such as tables or charts.
[0062] Step S420: dividing the multiple verification nodes into multiple node groups and sorting them according to the network connection relationship of the multiple verification nodes to obtain a node group sequence, wherein the verification nodes included in each node group in the multiple node groups are different.
[0063] The update management system divides the multiple verification nodes into multiple node groups and sorts them according to the network connection relationship of the multiple verification nodes, for example, according to the network topology diagram, to obtain a node group sequence. Each node group contains at least one verification node. Specifically, the update management system first determines the association relationship between the verification nodes according to the network connection relationship of the multiple verification nodes, such as nodes with direct communication connection or nodes without direct communication, nodes at the same network level, nodes at the same location or adjacent geographical locations, nodes with the same network segment in the IP address, nodes with similar node data volume or node device processing capabilities, etc. can all be used as the association relationship between the verification nodes. The update management system groups the verification nodes in the blockchain according to the association relationship corresponding to the specific actual needs, thereby obtaining multiple node groups. The verification nodes contained in each node group in the multiple node groups are different, that is, the same verification node will not exist in two node groups at the same time. The update management system will further sort the obtained multiple node groups to obtain a node group sequence. The basis for sorting can be adjusted according to specific needs, such as ascending, descending, and the order of node group sequence numbers or random sorting.
[0064] Step S430, updating each verification node in the current node group in the node group sequence.
[0065] After obtaining the node grouping sequence, the update management system updates each verification node in the current node grouping in the node grouping sequence. The current node grouping can be any node grouping in the node grouping sequence, and is usually the first node grouping in the node grouping sequence. In some embodiments, the current node grouping can also be a node located in the middle position or the last node in the node grouping sequence. The node grouping sequence can be considered as a circular sequence. The update management system will update each verification node in each node group in sequence starting from the current node grouping in the order in the node grouping sequence. Node update generally refers to updating the content of the verification node, such as updating the code or configuration information of the verification node.
[0066] Step S440: After each verification node in the current node group is updated, a service capability detection is performed on each verification node in the current node group.
[0067] Specifically, after each verification node in the current node group is updated, the update management system will perform business capability detection on these verification nodes that have been updated in the current node group. Business capability detection can be performed through a verification script, and the update management system can call the verification script in the update script. The verification script performs the business functions provided by each verification node that has been updated in the current node group. For example, for the bill system, the verification script can execute functions such as generating bills, circulating bills, and canceling bills provided by the verification node. In some embodiments, business capability verification can also be performed by executing corresponding functions through the business client, such as confirming through the client's transactions whether the front-end operations of the on-chain transactions involving the verification node network are executed normally, the connectivity between the terminal and the node and between the nodes, the stability of the connection, and the update of the blocks in the verification node.
[0068] Step S450, if each verification node in the current node group passes the business capability detection, then update each verification node in the first subsequent node group, where the first subsequent node group is the next node group adjacent to the current node group in the node group sequence.
[0069] If each verification node in the current node group passes the business capability test, it means that the current update of these verification nodes is successful, and the update management system will update each verification node in the next node group adjacent to the current node group in the node group sequence, that is, the first subsequent group. Similarly, the update process for the first subsequent group is similar to the update process for the current node group, and after each verification node in the first subsequent group is updated, the business capability test of each verification node will also be verified. In the case where the node group sequence contains multiple node groups, the update management system updates each node group in turn according to the process described above, and only after each verification node in a node group is updated and passes the business capability test, it continues to update the next node group in the node group sequence. It can be understood that if one or more verification nodes in the current node group do not pass the business capability test, the update management system will roll back each verification node in the current node group to restore them to the state before the update.
[0070] In the embodiment of the present application, the verification nodes are grouped according to the network connection relationship between the verification nodes, and each verification node in each group is updated. After each verification node in the group is updated, the service capability of each verification node in the group is tested. If all verifications are passed, the verification nodes in the next group are updated. By grouping and updating the verification nodes, since there are fewer nodes in each group, the update path is simpler, thereby reducing the difficulty and workload of blockchain updates, thereby reducing the risk and maintenance cost of blockchain updates.
[0071] In some optional embodiments, if each verification node in the current node group passes the business capability test, the verification node updates each verification node in the previous node group until each verification node in each node group in the node group sequence is updated, and the previous node group is the previous node group adjacent to the current node group in the node group sequence. In this embodiment, after determining that the current node group has been updated and the business capability test has passed, the verification node will update the previous adjacent node group in the node group sequence, thereby allowing the update process to start from the middle group in the node group sequence, so that only part of the groups in the node group sequence can be updated, further improving the control ability of the scheme over the update range.
[0072] In some optional embodiments, in the process of updating each verification node in the current node group in the node group sequence, the verification node will first stop each verification node in the current node group, and perform node update according to the update data corresponding to each verification node, and then re-establish the node connection between the updated verification node and other blockchain nodes in the blockchain. By performing a unified stop, update and reconnection operation on each verification node in the node group, it is not necessary to verify the business function of the node separately after each update is completed, which is conducive to improving the execution efficiency of the solution.
[0073] In the embodiments of the present application, it is also proposed to Figure 4 Other embodiments that refine the technical solution of the embodiment shown in the figure are as follows: Figure 5 As shown, in a method for processing blockchain transactions in an embodiment of the present application, the following steps may be included:
[0074] Step S510, obtaining the network connection relationship of multiple verification nodes in the blockchain.
[0075] Optionally, the implementation details of step S510 are the same as Figure 4 The step S410 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0076] Step S520: determining the network level of each verification node according to the network connection relationship.
[0077] Step S530, dividing the verification nodes of the same network layer among the multiple verification nodes into the same group, to obtain multiple node groups, each node group corresponding to a different network layer;
[0078] Step S540, sorting the plurality of node groups according to the order of the network hierarchy to obtain a node group sequence.
[0079] In this embodiment, in the process of grouping and sorting the verification nodes, the network level of each verification node will be used as the basis for grouping and sorting. Specifically, the update management system will first determine the network level of each verification node based on the network connection relationship. As mentioned above, due to the actual needs of the business requiring that some nodes in the verification node be isolated and invisible to each other, the verification node network is usually a tree structure, and based on the network connection relationship between the verification nodes, the network level of each verification node can be determined. Subsequently, the update management system will divide the verification nodes of the same network level among multiple verification nodes into the same group, thereby obtaining multiple node groups, and each node group corresponds to a different network level. For ease of introduction, please refer to Figure 6 , Figure 6 Schematic diagram of grouping according to network level in the embodiment of the present application. Figure 6 As shown, the verification node network includes four network levels, and the verification nodes in each network level are divided into the same group. After the groups are divided, the update management system sorts the multiple node groups according to the order of the network levels to obtain a node group sequence. For example, it can be in order from low to high, in the order of the fourth layer, the third layer, the second layer to the first layer, or in order from high to low. In some embodiments, the update management system can also determine the order of the network levels according to other criteria, such as sorting according to the number of nodes or the amount of data in each network level. In this embodiment, the verification nodes are grouped and sorted by network level, so that the verification nodes can be grouped horizontally based on the network level. Since the correlation between the verification nodes in the group is low, it can avoid that the associated verification nodes all stop working during the update process, which is conducive to improving the availability of the blockchain during the update process.
[0080] Step S550, updating each verification node in the current node group in the node group sequence.
[0081] Optionally, the implementation details of step S550 are the same as Figure 4 The step S430 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0082] Step S560: After each verification node in the current node group is updated, a service capability test is performed on each verification node in the current node group.
[0083] Optionally, the implementation details of step S560 are the same as Figure 4 The step S440 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0084] Step S570, if each verification node in the current node group passes the business capability detection, then update each verification node in the first subsequent node group, where the first subsequent node group is the next node group adjacent to the current node group in the node group sequence.
[0085] Optionally, the implementation details of step S570 are the same as Figure 4 The step S450 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0086] In the embodiment of the present application, the verification nodes are grouped according to the network connection relationship between the verification nodes, and each verification node in each group is updated. After each verification node in the group is updated, the service capability of each verification node in the group is tested. If all verifications are passed, the verification nodes in the next group are updated. By grouping and updating the verification nodes, since there are fewer nodes in each group, the update path is simpler, thereby reducing the difficulty and workload of blockchain updates, thereby reducing the risk and maintenance cost of blockchain updates.
[0087] In some optional embodiments, if each verification node in the current node group passes the business capability test, the verification node updates each verification node in the previous node group until each verification node in each node group in the node group sequence is updated, and the previous node group is the previous node group adjacent to the current node group in the node group sequence. In this embodiment, after determining that the current node group has been updated and the business capability test has passed, the verification node will update the previous adjacent node group in the node group sequence, thereby allowing the update process to start from the middle group in the node group sequence, so that only part of the groups in the node group sequence can be updated, further improving the control ability of the scheme over the update range.
[0088] In some optional embodiments, in the process of updating each verification node in the current node group in the node group sequence, the verification node will first stop each verification node in the current node group, and perform node update according to the update data corresponding to each verification node, and then re-establish the node connection between the updated verification node and other blockchain nodes in the blockchain. By performing a unified stop, update and reconnection operation on each verification node in the node group, it is not necessary to verify the business function of the node separately after each update is completed, which is conducive to improving the execution efficiency of the solution.
[0089] In some optional embodiments, before the plurality of node groups are sorted according to the order of the network hierarchy to obtain the node group sequence, the verification node determines the number of nodes of the verification node in each node group, and then determines the order of the network hierarchy according to the number of nodes in each node group. The order of the network hierarchy is determined by the number of verification nodes in each node group, so that the group with the most or least verification nodes can be updated first, which is conducive to selecting the update order according to the difficulty and risk of node update. When the update difficulty is low, the node group with a large number of nodes is selected to be updated first to improve the update efficiency, and when the update difficulty is high, the node group with a small number of nodes is selected to be updated first to reduce the number of affected nodes when the update fails, which is conducive to risk control in the node update process.
[0090] In some optional embodiments, the blockchain data contained in the verification nodes in the same network level are different. Before the multiple node groups are sorted according to the order of the network level to obtain the node group sequence, the verification node will determine the data volume of each node group according to the blockchain data contained in each verification node in each node group, and then determine the order of the network level according to the data volume of each node group. The order of the network level is determined by the overall data volume in each node group, and the group with a large data volume can be updated first or the group with a small data volume can be updated first, so that when the node is updated, the update order can be adjusted according to the update risk. When the update risk is high, the group with a smaller data volume can be updated first, which can reduce the amount of data affected when the update fails and the difficulty of rolling back the update, which is conducive to improving the risk control ability of the solution.
[0091] In the embodiments of the present application, it is also proposed to Figure 4 Other embodiments that refine the technical solution of the embodiment shown in the figure are as follows Figure 7 As shown, in a method for processing blockchain transactions in an embodiment of the present application, the following steps may be included:
[0092] Step S710, obtaining the network connection relationship of multiple verification nodes in the blockchain.
[0093] Optionally, the implementation details of step S710 are the same as Figure 4 The step S410 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0094] Step S720, determining the administrative region to which each verification node belongs according to the network connection relationship;
[0095] Step S730, dividing the hierarchical relationship between the administrative districts to which each verification node belongs into the same node group, and obtaining multiple node groups, each node group corresponding to the highest level administrative district included in the node group;
[0096] Step S740, sorting the plurality of node groups according to the order of the administrative regions to obtain a node grouping sequence.
[0097] In this embodiment, in the process of grouping and sorting the verification nodes, the administrative district to which each verification node belongs will be used as the basis for grouping and sorting. Specifically, the update management system will first determine the administrative district to which each verification node belongs based on the network connection relationship. Administrative districts usually include provincial, municipal, and district levels. The IP address of the network connection relationship usually contains the organization to which the verification node belongs, and the administrative district to which each verification node belongs can be determined based on the hierarchical relationship between these organizations. Subsequently, the update management system divides the hierarchical relationship between the administrative districts to which each verification node belongs, and divides the verification nodes of administrative districts with subordinate relationships into the same node group, thereby obtaining multiple node groups, each of which corresponds to the highest-level administrative district contained in the node group. For ease of introduction, please refer to Figure 8 . Figure 8 This is a schematic diagram of grouping according to administrative regions in an embodiment of the present application. For example, Province A has City A-a, and there are District A-a-1 and District A-a-2 in City A-a, and City B-b in Province B. In the grouping process, since District A-a-1 and District A-a-2 belong to City A-a, and City A-a belongs to Province A, since there is a hierarchical relationship between administrative regions between them, they are divided into the same node group, and the node group corresponds to Province A, while Province B and City B-b are divided into another group for the same reason, and the group of Province A is not subordinate to the group of Province B, so the two groups coexist. It is understandable that if there is no Province B node but only City B-b node, since City B-b does not belong to Province A, the City B-b node will exist independently as a group. The update management system will sort multiple node groups according to the order of administrative regions to obtain a node group sequence. For example, sort from south to north or from north to south according to the region where the corresponding province is located, or sort according to the number or province code of each province. In this embodiment, verification nodes are grouped and sorted by administrative districts, so that verification nodes can be grouped vertically based on administrative districts. In the tree structure of the verification node network, each branch is divided into the same group. Since the nodes in a group belong to the highest-level administrative district in the group, the impact range of node updates can be controlled to a certain region. The update process in one region does not affect the operation of nodes in other regions, thereby reducing the impact range of the update process on actual business, which is conducive to improving the availability of the blockchain during the update process.
[0098] Step S750, updating each verification node in the current node group in the node group sequence.
[0099] Optionally, the implementation details of step S750 are the same as Figure 4 The step S430 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0100] Step S760: After each verification node in the current node group is updated, a service capability test is performed on each verification node in the current node group.
[0101] Optionally, the implementation details of step S760 are the same as Figure 4 The step S440 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0102] Step S770, if each verification node in the current node group passes the business capability detection, then update each verification node in the first subsequent node group, where the first subsequent node group is the next node group adjacent to the current node group in the node group sequence.
[0103] Optionally, the implementation details of step S770 are the same as Figure 4 The step S450 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0104] In the embodiment of the present application, the verification nodes are grouped according to the network connection relationship between the verification nodes, and each verification node in each group is updated. After each verification node in the group is updated, the service capability of each verification node in the group is tested. If all verifications are passed, the verification nodes in the next group are updated. By grouping and updating the verification nodes, since there are fewer nodes in each group, the update path is simpler, thereby reducing the difficulty and workload of blockchain updates, thereby reducing the risk and maintenance cost of blockchain updates.
[0105] In some optional embodiments, if each verification node in the current node group passes the business capability test, the verification node updates each verification node in the previous node group until each verification node in each node group in the node group sequence is updated, and the previous node group is the previous node group adjacent to the current node group in the node group sequence. In this embodiment, after determining that the current node group has been updated and the business capability test has passed, the verification node will update the previous adjacent node group in the node group sequence, thereby allowing the update process to start from the middle group in the node group sequence, so that only part of the groups in the node group sequence can be updated, further improving the control ability of the scheme over the update range.
[0106] In some optional embodiments, in the process of updating each verification node in the current node group in the node group sequence, the verification node will first stop each verification node in the current node group, and perform node update according to the update data corresponding to each verification node, and then re-establish the node connection between the updated verification node and other blockchain nodes in the blockchain. By performing a unified stop, update and reconnection operation on each verification node in the node group, it is not necessary to verify the business function of the node separately after each update is completed, which is conducive to improving the execution efficiency of the solution.
[0107] In some optional embodiments, before the plurality of node groups are sorted according to the order of the network hierarchy to obtain the node group sequence, the verification node determines the number of verification nodes in the node group corresponding to each administrative district, and then determines the order of the administrative districts according to the number of nodes in each administrative district. The order of the administrative districts is determined by the number of verification nodes in each administrative district, so that the administrative district with the most or least verification nodes can be updated first, which is conducive to selecting the order of administrative districts according to the difficulty and risk of node update. When the update difficulty is low, the administrative district with a large number of nodes is selected to be updated first to improve the update efficiency, and when the update difficulty is high, the administrative district with a small number of nodes is selected to be updated first to reduce the number of affected nodes when the update fails, which is conducive to risk control during the node update process.
[0108] In some optional embodiments, before the plurality of node groups are sorted according to the order of the network hierarchy to obtain the node group sequence, the verification node determines the amount of data corresponding to each administrative district according to the blockchain data contained in each verification node in the node group corresponding to each administrative district, and then determines the order of the administrative districts according to the amount of data corresponding to each administrative district. By determining the order of the network hierarchy by the overall amount of data in each administrative district, it is possible to select an administrative district with a large amount of data to be updated first or an administrative district with a small amount of data to be updated first, so that when the node is updated, the update order of the administrative district can be adjusted according to the update risk. When the update risk is high, the administrative district with a smaller amount of data is selected to be updated first, which can reduce the amount of data affected when the update fails and the difficulty of rolling back the update, which is conducive to improving the risk control ability of the solution.
[0109] In the embodiments of the present application, it is also proposed to Figure 4 Other embodiments that refine the technical solution of the embodiment shown in the figure are as follows Fig. 9 As shown, in a method for processing blockchain transactions in an embodiment of the present application, the following steps may be included:
[0110] Step S910, obtaining the network connection relationship of multiple verification nodes in the blockchain.
[0111] Optionally, the implementation details of step S910 are the same as Figure 4 The step S410 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0112] Step S920: Divide the multiple verification nodes into multiple node groups and sort them according to the network connection relationship of the multiple verification nodes to obtain a node group sequence, wherein the verification nodes included in each node group in the multiple node groups are different.
[0113] Optionally, the implementation details of step S920 are the same as Figure 4 The step S420 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0114] Step S930, updating each verification node in the current node group in the node group sequence.
[0115] Optionally, the implementation details of step S930 are the same as Figure 4 The step S430 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0116] Step S940: After each verification node in the current node group is updated, a service capability test is performed on each verification node in the current node group.
[0117] Optionally, the implementation details of step S940 are the same as Figure 4 The step S440 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0118] Step S950, if each verification node in the current node group passes the business capability detection, then update each verification node in the first subsequent node group, where the first subsequent node group is the next node group adjacent to the current node group in the node group sequence.
[0119] Optionally, the implementation details of step S950 are the same as Figure 4 The step S450 shown in FIG. 1 is the same as that in FIG. 1 and will not be described in detail.
[0120] Step S960, after each verification node in the first subsequent node group is updated, performing a service capability test on each verification node in the first subsequent node group;
[0121] Step S970, if each verification node of the first subsequent node group passes the business capability test, then each verification node in the second subsequent node group is updated until all verification nodes in each node group in the node group sequence are updated, and the second subsequent node group is the next node group adjacent to the first subsequent node group in the node group sequence.
[0122] In this embodiment, for multiple node groups, the update management system will update each node group in turn. Specifically, after each verification node in the first subsequent node group is updated, the update management system performs a business capability test on each verification node in the first subsequent node group. If each verification node in the first subsequent node group passes the business capability test, the update management system updates each verification node in the second subsequent node group until each verification node in each node group in the node group sequence is updated. The second subsequent node group is the next node group adjacent to the first subsequent node group in the node group sequence. Similarly, after the update management system completes the update of the verification nodes in the second subsequent node group, it performs business capability verification on each verification node therein. And after the business capability verification passes, the verification nodes in the third subsequent node group are updated, and the process is repeated for all subsequent node groups until the verification nodes in all node groups are updated. In this embodiment, by repeating the update and verification of each node group in the node group sequence, and then updating the next group after the verification passes, the cascading effect caused by the update failure can be reduced, and the stability of the scheme is improved.
[0123] In the embodiment of the present application, the verification nodes are grouped according to the network connection relationship between the verification nodes, and each verification node in each group is updated. After each verification node in the group is updated, the service capability of each verification node in the group is tested. If all verifications are passed, the verification nodes in the next group are updated. By grouping and updating the verification nodes, since there are fewer nodes in each group, the update path is simpler, thereby reducing the difficulty and workload of blockchain updates, thereby reducing the risk and maintenance cost of blockchain updates.
[0124] In some optional embodiments, if each verification node in the current node group passes the business capability test, the verification node updates each verification node in the previous node group until each verification node in each node group in the node group sequence is updated, and the previous node group is the previous node group adjacent to the current node group in the node group sequence. In this embodiment, after determining that the current node group has been updated and the business capability test has passed, the verification node will update the previous adjacent node group in the node group sequence, thereby allowing the update process to start from the middle group in the node group sequence, so that only part of the groups in the node group sequence can be updated, further improving the control ability of the scheme over the update range.
[0125] In some optional embodiments, if there are verification nodes in the first subsequent node grouping that fail to pass the business capability test, the update management system performs a node update rollback on each verification node in the first subsequent node grouping. When the update fails, the execution scope of the rollback operation is controlled to improve the execution efficiency of batch rollback of verification node programs and data. In some embodiments, the update management system will also roll back the verification nodes in the node grouping that has been successfully upgraded. For example, if there are verification nodes in the first subsequent node grouping that fail to pass the business capability test, the update management system performs a node update rollback on each verification node in the first subsequent node grouping and each verification node in the current node grouping that has been successfully updated.
[0126] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0127] The following introduces the device implementation of the present application, which can be used to execute the blockchain node update method in the above-mentioned embodiment of the present application. Fig.10 The block diagram of the updating device of the blockchain node in the embodiment of the present application is schematically shown. Fig.10 As shown, the updating device 1000 of the blockchain node may mainly include:
[0128] A relationship acquisition module 1010 is configured to acquire a network connection relationship of multiple verification nodes in the blockchain;
[0129] The node grouping module 1020 is configured to divide the plurality of verification nodes into a plurality of node groups and sort them according to the network connection relationship of the plurality of verification nodes to obtain a node grouping sequence, wherein the verification nodes included in each of the plurality of node groups are different;
[0130] A first updating module 1030 is configured to update each verification node in the current node group in the node group sequence;
[0131] The capability detection module 1040 is configured to perform a service capability detection on each verification node in the current node group after each verification node in the current node group is updated;
[0132] The second update module 1050 is configured to update each verification node in the first subsequent node group if each verification node in the current node group passes the business capability detection, and the first subsequent node group is the next node group adjacent to the current node group in the node group sequence.
[0133] In some embodiments of the present application, based on the above technical solution, the node grouping module 1020 is specifically configured to: determine the network level of each verification node according to the network connection relationship; divide the verification nodes of the same network level among the multiple verification nodes into the same group to obtain multiple node groups, and each node group corresponds to a different network level; sort the multiple node groups according to the order of the network level to obtain a node group sequence.
[0134] In some embodiments of the present application, based on the above technical solution, the node grouping module 1020 is further configured to: determine the number of verification nodes in each node group; and determine the order of the network hierarchy according to the number of nodes in each node group.
[0135] In some embodiments of the present application, based on the above technical solution, the blockchain data contained in the verification nodes in the same network layer is different; the node grouping module 1020 is also configured to: determine the data volume of each node group according to the blockchain data contained in each verification node in each node group; determine the order of the network layer according to the data volume of each node group.
[0136] In some embodiments of the present application, based on the above technical solution, the node grouping module 1020 is specifically configured to: determine the administrative district to which each verification node belongs according to the network connection relationship; divide the hierarchical relationship between the administrative districts to which each verification node belongs, and divide the verification nodes of the administrative districts with subordinate relationships into the same node group to obtain multiple node groups, each node group corresponding to the highest-level administrative district contained in the node group; sort the multiple node groups according to the order of the administrative districts to obtain a node group sequence.
[0137] In some embodiments of the present application, based on the above technical solution, the node grouping module 1020 is also configured to: determine the number of verification nodes in the node group corresponding to each administrative district; and determine the order of the administrative districts according to the number of nodes in each administrative district.
[0138] In some embodiments of the present application, based on the above technical solution, the node grouping module 1020 is also configured to: determine the amount of data corresponding to each administrative district according to the blockchain data contained in each verification node in the node group corresponding to each administrative district; determine the order of the administrative districts according to the amount of data corresponding to each administrative district.
[0139] In some embodiments of the present application, based on the above technical solution, the first update module 1030 is specifically configured to: stop each verification node in the current node group, and perform node update according to the update data corresponding to each verification node; re-establish the node connection between the updated verification node and other blockchain nodes in the blockchain.
[0140] In some embodiments of the present application, based on the above technical solution, the second update module 1050 is further configured to: after the update of each verification node in the first subsequent node group is completed, a business capability test is performed on each verification node in the first subsequent node group; if each verification node in the first subsequent node group passes the business capability test, each verification node in the second subsequent node group is updated until all verification nodes in each node group in the node grouping sequence are updated, and the second subsequent node group is the next node group adjacent to the first subsequent node group in the node grouping sequence.
[0141] In some embodiments of the present application, based on the above technical solution, the second update module 1050 is further configured to: if there is a verification node in the first subsequent node group that fails the business capability detection, then a node update rollback is performed on each verification node in the first subsequent node group.
[0142] In some embodiments of the present application, based on the above technical solution, the second update module 1050 is also configured to: if each verification node in the current node group passes the business capability detection, then each verification node in the previous node group is updated until each verification node in each node group in the node group sequence is updated, and the previous node group is the previous node group adjacent to the current node group in the node group sequence.
[0143] It should be noted that the apparatus provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.
[0144] Fig.11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0145] It should be noted that Fig.11 The computer system 1100 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0146] like Fig.11As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage part 1108 to the random access memory (RAM) 1103. Various programs and data required for system operation are also stored in the RAM 1103. The CPU 1101, ROM 1102 and RAM 1103 are connected to each other through a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0147] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed so that a computer program read therefrom is installed into the storage section 1108 as needed.
[0148] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 1109, and / or installed from a removable medium 1111. When the computer program is executed by a central processing unit (CPU) 1101, various functions defined in the system of the present application are executed.
[0149] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CompactDisc Read-OnlyMemory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0150] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0151] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0152] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation method of the present application.
[0153] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
[0154] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for updating a blockchain node, characterized in that: include: Get the network connection relationship of multiple verification nodes in the blockchain; According to the network connection relationship of the multiple verification nodes, the multiple verification nodes are divided into multiple node groups and sorted to obtain a node group sequence, wherein the verification nodes included in each node group in the multiple node groups are different; Updating each verification node in the current node group in the node group sequence; After each verification node in the current node group is updated, performing a service capability test on each verification node in the current node group; If each verification node in the current node group passes the service capability detection, each verification node in the first subsequent node group is updated, and the first subsequent node group is the next node group adjacent to the current node group in the node group sequence.
2. The updating method according to claim 1, characterized in that: The step of dividing the plurality of verification nodes into a plurality of node groups and sorting the plurality of verification nodes according to the network connection relationship of the plurality of verification nodes to obtain a node group sequence comprises: Determine the network level of each verification node according to the network connection relationship; Dividing the verification nodes of the same network layer among the multiple verification nodes into the same group to obtain multiple node groups, each node group corresponding to a different network layer; The plurality of node groups are sorted according to the order of the network hierarchy to obtain a node group sequence.
3. The updating method according to claim 2, characterized in that: Before sorting the plurality of node groups according to the order of the network hierarchy to obtain a node group sequence, the method further includes: Determine the number of validating nodes in each node group; The order of the network hierarchy is determined by the number of nodes in each node group.
4. The updating method according to claim 2, characterized in that: The blockchain data contained in the verification nodes in the same network layer are different; the grouping and sorting of the multiple nodes to obtain the node grouping sequence includes: Determine the amount of data for each node group based on the blockchain data contained in each verification node in each node group; The order of the network layers is determined according to the amount of data grouped by each node.
5. The updating method according to claim 1, characterized in that: The step of dividing the plurality of verification nodes into a plurality of node groups and sorting the plurality of verification nodes according to the network connection relationship of the plurality of verification nodes to obtain a node group sequence comprises: Determine the administrative region to which each verification node belongs based on the network connection relationship; The hierarchical relationship between the administrative districts to which each verification node belongs is divided into the same node group, and multiple node groups are obtained, each node group corresponds to the highest level administrative district included in the node group; The plurality of node groups are sorted according to the order of administrative regions to obtain a node grouping sequence.
6. The updating method according to claim 5, characterized in that: Before sorting the plurality of node groups according to the order of administrative areas to obtain a node group sequence, the method further includes: Determine the number of nodes that verify the nodes in the node group corresponding to each administrative district; Determine the order of administrative districts according to the number of nodes in each administrative district.
7. The updating method according to claim 5, characterized in that: Before sorting the plurality of node groups according to the order of administrative regions to obtain a node grouping sequence, the method further includes: Determine the amount of data corresponding to each administrative district based on the blockchain data contained in each verification node in the node group corresponding to each administrative district; Determine the order of administrative regions according to the amount of data corresponding to each administrative region.
8. The updating method according to claim 1, characterized in that: The updating of each verification node in the current node group in the node group sequence includes: Stop each verification node in the current node group and perform node updates based on the update data corresponding to each verification node; Re-establish node connections between the updated validation node and other blockchain nodes in the blockchain.
9. The updating method according to claim 1, characterized in that: After updating each verification node in the first subsequent node group, the method further includes: After each verification node in the first subsequent node group is updated, performing a service capability test on each verification node in the first subsequent node group; If each verification node of the first subsequent node group passes the business capability test, each verification node in the second subsequent node group is updated until all verification nodes in each node group in the node group sequence are updated. The second subsequent node group is the next node group adjacent to the first subsequent node group in the node group sequence.
10. The updating method according to claim 9, characterized in that: The method further comprises: If there is a verification node in the first subsequent node group that fails the business capability detection, a node update rollback is performed on each verification node in the first subsequent node group.
11. The updating method according to claim 1, characterized in that: The method further comprises: If each verification node in the current node group passes the business capability test, each verification node in the previous node group is updated until each verification node in each node group in the node group sequence is updated. The previous node group is the previous node group adjacent to the current node group in the node group sequence.
12. A blockchain node update device, characterized in that: include: A relationship acquisition module, configured to acquire network connection relationships of multiple verification nodes in the blockchain; a node grouping module configured to divide the plurality of verification nodes into a plurality of node groups and sort them according to the network connection relationship of the plurality of verification nodes to obtain a node grouping sequence, wherein the verification nodes contained in each of the plurality of node groups are different; A first updating module is configured to update each verification node in a current node group in the node grouping sequence; A capability detection module, configured to perform a service capability detection on each verification node in the current node group after each verification node in the current node group is updated; The second update module is configured to update each verification node in the first subsequent node group if each verification node in the current node group passes the business capability detection, and the first subsequent node group is the next node group adjacent to the current node group in the node group sequence.
13. An electronic device, characterized in that: include: processor; A memory, configured to store executable instructions of the processor; Wherein, the processor is configured to execute the blockchain node update method described in any one of claims 1 to 11 by executing the executable instructions.
14. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for updating a blockchain node as described in any one of claims 1 to 11 is implemented.
15. A computer program product, characterized in that The computer program product includes a computer program, which is stored in a computer-readable storage medium. The processor of the electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device performs the update method of the blockchain node as claimed in any one of claims 1 to 11.