Blockchain service upgrade method, device, terminal equipment and storage medium
By obtaining and executing service upgrade proposals, suspending and restoring transaction processing, the online upgrade of blockchain nodes is realized, and the problem of business suspension during node upgrades is solved.
Patent Information
- Application Number
- CN202011585320.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-28
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2040-12-28
AI Technical Summary
When the existing technology upgrades the service to blockchain nodes, it is necessary to stop the node operation, resulting in business suspension and affecting operations.
By obtaining service upgrade proposals, suspending the processing of pending transaction information, starting the upgrade proposal to upgrade the node, and processing pending transaction information after the upgrade is completed, realizing online upgrades.
There is no need to stop the node operation, realize online upgrade of the node, avoid business suspension, and reduce the impact on the business.
Smart Images

Figure CN112631641B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of blockchain technology, and in particular, relates to a blockchain service upgrade method, device, terminal device and storage medium. Background Art
[0002] Currently, when upgrading blockchain services, all nodes in the blockchain need to be upgraded synchronously, that is, all nodes on the blockchain need to be manually stopped, and all nodes need to be upgraded and started in sequence. Stopping a node will cause all businesses corresponding to the node to be suspended, which will have a significant impact on business operations. Summary of the invention
[0003] The embodiments of the present application provide a blockchain service upgrade method, apparatus, terminal device, and storage medium, which can solve the problem in the prior art that an upgrade needs to be performed while a node is stopped, resulting in suspension of all services of the node.
[0004] In a first aspect, an embodiment of the present application provides a blockchain service upgrade method, wherein the blockchain includes N nodes, N is an integer greater than zero, and for the i-th node among the N nodes, the i-th node is any node among the N nodes, and the blockchain service upgrade method includes:
[0005] Obtaining a service upgrade proposal for the blockchain, where the service upgrade proposal is used to upgrade any of the nodes;
[0006] Suspend processing of pending transaction information in the i-th node;
[0007] Initiate the service upgrade proposal to upgrade the i-th node;
[0008] After the upgrade of the i-th node is completed, the pending transaction information is processed.
[0009] In a second aspect, an embodiment of the present application provides a blockchain service upgrade device, wherein the blockchain includes N nodes, N is an integer greater than zero, and the blockchain service upgrade device runs in the i-th node of the N nodes, and the i-th node is any node of the N nodes, and the blockchain service upgrade device includes:
[0010] A proposal acquisition module, used to acquire service upgrade proposals of the blockchain;
[0011] A pause module, used for suspending the processing of pending transaction information in the i-th node;
[0012] A proposal initiation module, used to initiate the service upgrade proposal to upgrade the i-th node;
[0013] A processing module is used to process the pending transaction information after the upgrade of the i-th node is completed.
[0014] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the blockchain service upgrade method as described in the first aspect is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the blockchain service upgrade method as described in the first aspect is implemented.
[0016] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the blockchain service upgrade method described in the first aspect above.
[0017] Compared with the prior art, the embodiments of the present application have the following beneficial effects: after obtaining a service upgrade proposal at any node in the blockchain, the present application suspends processing of pending transaction information in the node, initiates a service upgrade proposal to upgrade the node, and processes pending transaction information after the node upgrade is completed. During the upgrade process, the node suspends processing of pending transaction information, and processes the pending transaction information again after the upgrade is completed. There is no need to stop the operation of the node, and the node can be upgraded online without causing suspension of services other than pending transaction information in the node, which has little impact on the node's services. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0019] Figure 1 This is a flowchart of a blockchain service upgrade method provided in Example 1 of the present application;
[0020] Figure 2 It is a schematic diagram of the architecture of a main process in a node provided in Example 1 of the present application;
[0021] Figure 3 This is a flowchart of a blockchain service upgrade method provided in Example 2 of the present application;
[0022] Figure 4This is a schematic diagram of communication between alliance chain nodes provided in Example 2 of the present application;
[0023] Figure 5 This is a structural diagram of a blockchain service upgrade device provided in Example 3 of the present application;
[0024] Figure 6 It is a structural diagram of a terminal device provided in Example 4 of the present application. DETAILED DESCRIPTION
[0025] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0026] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0027] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0028] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0029] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0030] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0031] A blockchain service upgrade method provided in an embodiment of the present application can be applied to terminal devices such as PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud servers, personal digital assistants (PDAs), etc. The embodiment of the present application does not impose any restrictions on the specific type of terminal devices.
[0032] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0033] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.
[0034] See also Figure 1 , is a flowchart of a blockchain service upgrade method provided in Example 1 of the present application. The blockchain to which the blockchain service upgrade method is applicable includes N nodes, where N is an integer greater than zero. For the i-th node among the N nodes, the i-th node is any node among the N nodes, such as Figure 1 As shown, the blockchain service upgrade method includes the following steps:
[0035] Step S101, obtaining a service upgrade proposal of the blockchain.
[0036] Among them, the service upgrade proposal may refer to the solution provided to achieve the service upgrade of the blockchain. The service upgrade of the blockchain is the upgrade of the corresponding node of the blockchain. The service upgrade proposal needs to be applicable to any node of the blockchain, that is, to upgrade any node. For example, when upgrading the alliance chain blockchain, the technology provider in the alliance chain is used to provide a service upgrade proposal. The technology provider needs to fully test the service upgrade proposal and compile and package it to obtain an executable file. The nodes in the alliance chain execute the executable file for upgrading. The upgraded nodes provide services to the business participants of the alliance chain. The service upgrade proposal can contain the proposal hash, the initiator's signature, the update time, the target version binary stream, the target version number and the remarks information.
[0037] Optionally, after obtaining the service upgrade proposal of the blockchain, it also includes:
[0038] Detect whether there is transaction information being processed;
[0039] Accordingly, the launch service upgrade proposal includes:
[0040] If it is detected that there is transaction information being processed, the service upgrade proposal will be initiated after the transaction information being processed is completed.
[0041] Among them, when the upgrade of the i-th node starts through the service upgrade proposal, it is also necessary to detect whether the i-th node is processing transactions, that is, whether there is transaction information being processed. Since the transaction information being processed does not belong to the pending transactions, if it is detected that there is transaction information being processed, it is necessary to wait until the transaction information being processed is completed before continuing the upgrade to avoid the loss of transaction information.
[0042] Step S102, suspending the processing of pending transaction information in the i-th node.
[0043] The pending transaction information may refer to the transaction information in the pending transaction queue of the i-th node that has not been processed, and the suspended processing may refer to the i-th node sending a suspension instruction to the process processing the pending transaction information. For example, a main process and a sub-process are set in the i-th node, and the main process sends a suspension instruction to the sub-process through an inter-process communication mechanism. After receiving the suspension instruction, the sub-process suspends processing of the pending transaction information.
[0044] Step S103, start the service upgrade proposal.
[0045] Among them, after the service upgrade plan is started, the i-th node can be upgraded. The upgrade process does not require human control and is similar to the upgrade of computer software. For example, the child process of the i-th node feeds back the corresponding information to the main process after pausing. After the main process receives the corresponding message, it reads the service upgrade proposal to start the service upgrade proposal.
[0046] Step S104: after the upgrade of the i-th node is completed, the pending transaction information is processed.
[0047] Among them, it is possible to determine whether the upgrade of the i-th node is completed by querying the version number of the software program of the i-th node. For example, when the version number of the software program of the i-th node is the target version number in the service upgrade plan, it is determined that the upgrade of the i-th node is completed; when it is detected that the version of the software program of the i-th node does not correspond to the target version number in the service upgrade plan, it is determined that the upgrade of the i-th node is not completed.
[0048] When it is detected that the upgrade of the i-th node is completed, the pending transaction information that is suspended is processed. For example, when the main process of the i-th node starts the service upgrade proposal, it also starts a new child process, passes the pending transaction information as a parameter to the new child process, and puts the new child process in a waiting state. When the upgrade of the i-th node is completed, the new child process is put in a starting state, and the new child process processes the pending transaction information after it is started.
[0049] Optionally, after the upgrade of the i-th node is completed, processing the pending transaction information includes:
[0050] After the upgrade of the i-th node is completed, the message of the completion of the upgrade of the i-th node is broadcast to other nodes, where other nodes refer to the nodes other than the i-th node among the N nodes;
[0051] Get the upgrade completion message of other nodes;
[0052] If all N nodes have been upgraded, the pending transaction information will be processed.
[0053] Among them, the message of the completion of the upgrade of the i-th node is broadcast to other nodes. At the same time, other nodes also broadcast their respective completed upgrade messages. Therefore, the i-th node can get the message of the completion of the upgrade of other nodes. If the i-th node receives the message of the completion of the upgrade broadcasted by other nodes, and the i-th node has also been upgraded, it is considered that all N nodes have been upgraded. At this time, the processing of the pending transaction information is started. For example, when the main process of the i-th node starts the service upgrade proposal, it also starts a new child process, passes the pending transaction information as a parameter to the new child process, and puts the new child process in a waiting state. When the upgrade of N nodes is completed, the new child process is put in a starting state. After the new child process is started, it processes the pending transaction information.
[0054] like Figure 2 As shown, it is a schematic diagram of the architecture of the main process in a node provided in Example 1 of the present application, wherein the transaction queue is used to store pending transaction information, and both sub-process 1 and sub-process 2 include a consensus module and a transaction processing module, which are responsible for logical processing such as consensus and transaction processing. When the node needs to be upgraded, sub-process 1 is controlled to suspend processing the pending transaction information in the transaction queue, and a new sub-process, namely sub-process 2, is generated, and the pending transaction information in the transaction queue is passed as a parameter to the sub-process 2. After the node upgrade is completed, sub-process 2 is started and begins to process the pending transaction information in the transaction queue.
[0055] In the embodiment of the present application, after any node in the blockchain obtains a service upgrade proposal, the processing of pending transaction information in the node is suspended, and the service upgrade proposal is initiated to upgrade the node. After the node upgrade is completed, the pending transaction information is processed. During the upgrade process, the node suspends the processing of pending transaction information, and processes the pending transaction information again after the upgrade is completed. There is no need to stop the operation of the node, and the node can be upgraded online without causing suspension of business other than pending transaction information in the node, which has little impact on the node's business.
[0056] See also Figure 3 , is a flowchart of a blockchain service upgrade method provided in Example 2 of the present application. The blockchain to which the blockchain service upgrade method is applicable includes N nodes, where N is an integer greater than zero. For the i-th node among the N nodes, the i-th node is any node among the N nodes, such as Figure 3 As shown, the blockchain service upgrade method includes the following steps:
[0057] Step 301, obtaining a service upgrade proposal for the blockchain.
[0058] Among them, the content of step S301 is the same as that of the above-mentioned step S101, and reference may be made to the description of step S101, which will not be repeated here.
[0059] like Figure 4 As shown, it is a schematic diagram of communication between alliance chain nodes provided in Example 2 of the present application, wherein the alliance chain includes 6 nodes, among which node 1 can be used by the technology provider, and nodes 2 to 6 can be used by business participants, and node 1 broadcasts the service upgrade proposal to nodes 2 to 6; in addition, node 1 can also be used by business participants, that is, the technology provider and the business participants reuse one node. In this case, the business participants of node 1 need to open the calling authority of the technology provider.
[0060] Step S302, obtaining the first voting result.
[0061] Among them, the first voting result includes the selection result of the i-th node on whether to upgrade through the service upgrade proposal. The selection result may include that the i-th node passes the service upgrade proposal or the i-th node does not pass the service upgrade proposal. The first voting result can be obtained by the user voting through the i-th node. The first voting result can also be obtained by the i-th node analyzing the service upgrade proposal according to its own agreement, contract, mechanism, etc.
[0062] Optionally, obtaining the first voting result includes:
[0063] Get the proposal hash of the service upgrade proposal and the signature of the initiator of the service upgrade proposal;
[0064] Call the voting interface of the i-th node to vote on the service upgrade proposal and determine the voting hash and voting intention. The voting intention is the i-th node's choice of whether to upgrade through the service upgrade proposal.
[0065] The first voting result is determined based on the proposal hash, initiator signature, voting hash, and voting intention.
[0066] Among them, the service upgrade proposal may include the proposal hash, the initiator's signature, the update time, the target version binary stream, the target version number and the remarks information, etc. After the i-th node obtains the service upgrade proposal, the binary stream in the service upgrade proposal is persisted to the local temporary storage directory of the version to be updated of the i-th node, and the file name in the local temporary storage directory of the version to be updated is named as the target version number in the service upgrade proposal.
[0067] Call the voting interface of the i-th node to vote on the service upgrade proposal. The voting result information may include the proposal hash, the initiator's signature, the voting hash and the voting intention. The proposal hash and the initiator's signature are both used to indicate the object to which the voting result is directed. The voting hash is used to indicate the uniqueness of the voting result to ensure that the voting result is not tampered with. The voting intention is the i-th node's choice result on whether to upgrade through the service upgrade proposal, that is, whether the i-th node passes the service upgrade proposal or not.
[0068] Step S303: broadcast the first voting result to other nodes.
[0069] Among them, other nodes refer to the nodes except the i-th node among the N nodes, that is, the other nodes include N-1 nodes, and each node broadcasts the first voting node to other nodes, that is, each node will receive the voting results of other nodes.
[0070] With the above Figure 4 For example, if node 1 is a node reused by the technology provider and the business participant, nodes 1 to 6 all vote on the service upgrade proposal, and node 1 broadcasts its own voting results (i.e., the first voting results) to nodes 2 to 6. Node 2 also broadcasts its own voting results (i.e., the first voting results) to nodes 1 and 3 to 6, and so on.
[0071] Step S304, obtaining the second voting result.
[0072] Among them, the second voting result includes the selection results of other nodes on whether to upgrade through the service upgrade proposal. The second voting result is the voting result of other nodes, which is in the same form as the first voting result. The i-th node can obtain the voting results of other nodes and its own voting results.
[0073] Step S305: according to the first voting result and the second voting result, suspend processing of the pending transaction information in the i-th node.
[0074] Among them, according to the voting results of all nodes, that is, N nodes, it is decided whether to execute the upgrade of the service upgrade proposal, that is, whether to start the step of suspending the processing of pending transaction information in the i-th node; for example, the number of passed votes and failed votes in the voting results of N nodes are counted. If the number of passed votes is greater than the number of failed votes, the i-th node and other nodes can be upgraded.
[0075] Optionally, according to the first voting result and the second voting result, suspending the processing of pending transaction information in the i-th node includes:
[0076] Check whether the number of passed votes is equal to N, where the number of passed votes is the number of votes that passed the selection result for upgrading the service upgrade proposal in the first voting result and the second voting result;
[0077] If it is detected that the number of passed votes is equal to N, the processing of pending transaction information in the i-th node is suspended.
[0078] Among them, since the blockchain has high requirements for node consensus, each node can be upgraded when all votes are passed, that is, when the counted number of votes is equal to the number of nodes N.
[0079] Optionally, after checking whether the number of votes passed is equal to N, the following is also included:
[0080] Get the update time of service upgrade proposal;
[0081] Check whether the current time reaches the update time;
[0082] Accordingly, if it is detected that the number of passed votes is equal to N, the pending transaction information in the i-th node is suspended, including:
[0083] If it is detected that the number of passed votes is equal to N, and it is detected that the current time has reached the update time, the processing of pending transaction information in the i-th node will be suspended.
[0084] The service upgrade proposal may also include an update time, and the format of the update time may be yyyy (year) -mm (month) -dd (day) HH:MM:SS (hour), that is, the service upgrade proposal needs to be used for node upgrade only after the update time is reached, and may be used to achieve synchronization of node upgrades.
[0085] Step S306, start the service upgrade proposal.
[0086] Step S307: After the upgrade of the i-th node is completed, the pending transaction information is processed.
[0087] Among them, the contents of step S306 and step S307 are respectively the same as those of the above-mentioned step S103 and step S104, and the description of step S103 and step S104 may be referred to, and will not be repeated here.
[0088] The service upgrade proposal of this application may include proposal hash, initiator signature, update time, target version binary stream, target version number and remarks. The corresponding fields and data types when designing the proposal can refer to the following table:
[0089]
[0090] In the embodiment of the present application, after any node in the blockchain obtains a service upgrade proposal, all nodes vote on the service upgrade proposal and decide whether to upgrade based on the voting results, thereby preventing the abuse of the service upgrade proposal and enabling the node's upgrade intention to be conveyed.
[0091] Corresponding to the blockchain service upgrade method in the above embodiment, Figure 5 A structural block diagram of a blockchain service upgrade device provided in Example 4 of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0092] The blockchain service upgrade device runs on any node of the blockchain. The blockchain includes N nodes, where N is an integer greater than zero. For the i-th node among the N nodes, the i-th node is any node among the N nodes. Figure 5 , the blockchain service upgrade device includes:
[0093] The proposal acquisition module 51 is used to obtain the service upgrade proposal of the blockchain, and the service upgrade proposal is used to upgrade any node;
[0094] A pause module 52, used for suspending the processing of pending transaction information in the i-th node;
[0095] A proposal initiation module 53 is used to initiate a service upgrade proposal to upgrade the i-th node;
[0096] The processing module 54 is used to process the pending transaction information after the upgrade of the i-th node is completed.
[0097] Optionally, the processing module 54 includes:
[0098] A broadcast unit, used for broadcasting a message of the completion of the upgrade of the i-th node to other nodes after the upgrade of the i-th node is completed, where the other nodes refer to nodes other than the i-th node among the N nodes;
[0099] A message acquisition unit, used to acquire upgrade completion messages of other nodes;
[0100] The processing unit is used to process pending transaction information if all N nodes have been upgraded.
[0101] Optionally, the blockchain service upgrading device further includes:
[0102] A first result acquisition module, used to acquire a first voting result, where the first voting result includes a selection result of the i-th node on whether to upgrade through the service upgrade proposal;
[0103] A broadcast module, used for broadcasting the first voting result to other nodes, where the other nodes refer to nodes other than the i-th node among the N nodes;
[0104] A second result acquisition module is used to obtain a second voting result, where the second voting result includes the selection result of other nodes on whether to upgrade through the service upgrade proposal;
[0105] Accordingly, the pause module 52 includes:
[0106] The suspension unit is used to suspend the processing of pending transaction information in the i-th node according to the first voting result and the second voting result.
[0107] Optionally, the first result acquisition module includes:
[0108] A first acquisition unit is used to acquire a proposal hash of a service upgrade proposal and a signature of a sponsor of the service upgrade proposal;
[0109] The first determination unit is used to call the voting interface of the i-th node, vote on the service upgrade proposal, and determine the voting hash and voting intention, where the voting intention is the selection result of the i-th node on whether to upgrade through the service upgrade proposal;
[0110] The second determination unit is used to determine the first voting result according to the proposal hash, the initiator's signature, the voting hash and the voting intention.
[0111] Optionally, the pause unit is specifically used for:
[0112] Check whether the number of passed votes is equal to N, where the number of passed votes is the number of votes that passed the selection result for upgrading the service upgrade proposal in the first voting result and the second voting result;
[0113] If it is detected that the number of passed votes is equal to N, the processing of pending transaction information in the i-th node is suspended.
[0114] Optionally, the blockchain service upgrading device further includes:
[0115] Time acquisition module, used to obtain the update time of service upgrade proposals;
[0116] The time detection module is used to detect whether the current time reaches the update time;
[0117] Accordingly, the pause unit is specifically used for:
[0118] If it is detected that the number of passed votes is equal to N, and it is detected that the current time has reached the update time, the processing of pending transaction information in the i-th node will be suspended.
[0119] Optionally, the blockchain service upgrading device further includes:
[0120] An information detection module is used to detect whether there is transaction information being processed;
[0121] Accordingly, the proposal initiation module 53 includes:
[0122] The proposal initiation unit is used to initiate a service upgrade proposal after the transaction information being processed is completed if it is detected that there is transaction information being processed.
[0123] It should be noted that the information interaction, execution process and other contents between the above-mentioned modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0124] Figure 6 This is a schematic diagram of the structure of a terminal device provided in Embodiment 4 of the present application. Figure 6 As shown, the terminal device 6 of this embodiment includes: M processors 60 ( Figure 6 Only one processor, a memory 61, and a computer program 62 stored in the memory 61 and executable on M processors 60 are shown. When the processor 60 executes the computer program 62, the steps in any of the above-mentioned blockchain service upgrade method embodiments are implemented.
[0125] The terminal device may include, but is not limited to, a processor 60 and a memory 61. Those skilled in the art will appreciate that Figure 6 This is only an example of the terminal device 6 and does not constitute a limitation on the terminal device 6. The terminal device 6 may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0126] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0127] In some embodiments, the memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or memory of the terminal device 6. In other embodiments, the memory 61 may also be an external storage device of the terminal device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the terminal device 6. The memory 61 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program. The memory 61 may also be used to temporarily store data that has been output or is to be output.
[0128] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the above-mentioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiment when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0129] The present application implements all or part of the processes in the above-mentioned embodiment method, and may also be completed through a computer program product. When the computer program product runs on a terminal device, the terminal device implements the steps in the above-mentioned method embodiment when executing the computer program product.
[0130] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0131] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0132] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0133] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0134] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A blockchain service upgrade method, characterized in that: The blockchain includes N nodes, N is an integer greater than zero, and for an i-th node among the N nodes, the i-th node is any node among the N nodes, and the blockchain service upgrade method includes: Obtaining a service upgrade proposal for the blockchain, where the service upgrade proposal is used to upgrade any of the nodes; Suspend processing of pending transaction information in the i-th node; Initiate the service upgrade proposal to upgrade the i-th node; After the upgrade of the i-th node is completed, processing the pending transaction information; After obtaining the service upgrade proposal of the blockchain, it also includes: Obtaining a first voting result, where the first voting result includes a selection result of the i-th node on whether to upgrade through the service upgrade proposal; Broadcasting the first voting result to other nodes, where the other nodes refer to nodes other than the i-th node among the N nodes; Obtaining a second voting result, where the second voting result includes a selection result of the other nodes on whether to upgrade through the service upgrade proposal; Accordingly, the suspending the processing of the pending transaction information in the i-th node includes: According to the first voting result and the second voting result, the processing of the pending transaction information in the i-th node is suspended.
2. The blockchain service upgrade method according to claim 1, characterized in that: After the upgrade of the i-th node is completed, processing the pending transaction information includes: After the upgrade of the i-th node is completed, broadcasting a message that the upgrade of the i-th node is completed to other nodes, where the other nodes refer to nodes other than the i-th node among the N nodes; Obtaining the upgrade completion message of each of the other nodes; If the N nodes are all upgraded, the pending transaction information is processed.
3. The blockchain service upgrade method according to claim 1, characterized in that: The obtaining of the first voting result comprises: Obtain the proposal hash of the service upgrade proposal and the signature of the initiator of the service upgrade proposal; Calling the voting interface of the i-th node to vote on the service upgrade proposal, and determining the voting hash and voting intention, where the voting intention is the selection result of the i-th node on whether to upgrade through the service upgrade proposal; The first voting result is determined according to the proposal hash, the initiator signature, the voting hash and the voting intention.
4. The blockchain service upgrade method according to claim 1, characterized in that: The suspending the processing of the pending transaction information in the i-th node according to the first voting result and the second voting result includes: Detecting whether the number of passed votes is equal to N, wherein the number of passed votes is the number of votes in the first voting result and the second voting result for selecting the service upgrade proposal for upgrading; If it is detected that the number of passed votes is equal to N, the processing of the pending transaction information in the i-th node is suspended.
5. The blockchain service upgrade method according to claim 4, characterized in that: After the detection of whether the number of votes is equal to N, the following steps are further included: Obtain the update time of the service upgrade proposal; Detect whether the current time reaches the update time; Correspondingly, if it is detected that the number of passed votes is equal to N, suspending the processing of pending transaction information in the i-th node includes: If it is detected that the number of passed votes is equal to N, and it is detected that the current time reaches the update time, the processing of the pending transaction information in the i-th node is suspended.
6. The blockchain service upgrade method according to any one of claims 1 to 5, characterized in that: After obtaining the service upgrade proposal of the blockchain, it also includes: Detect whether there is transaction information being processed; Accordingly, the initiating the service upgrade proposal includes: If it is detected that there is transaction information being processed, the service upgrade proposal is initiated after the transaction information being processed is completed.
7. A blockchain service upgrade device, characterized in that: The blockchain includes N nodes, N is an integer greater than zero, the blockchain service upgrade device runs in the i-th node among the N nodes, the i-th node is any node among the N nodes, and the blockchain service upgrade device includes: A proposal acquisition module, used to acquire a service upgrade proposal of the blockchain, wherein the service upgrade proposal is used to upgrade any of the nodes; A pause module, used for suspending the processing of pending transaction information in the i-th node; A proposal initiation module, used to initiate the service upgrade proposal to upgrade the i-th node; A processing module, used for processing the pending transaction information after the upgrade of the i-th node is completed; The blockchain service upgrade device also includes: A first result acquisition module, used to acquire a first voting result, where the first voting result includes a selection result of the i-th node on whether to upgrade through the service upgrade proposal; A broadcast module, used for broadcasting the first voting result to other nodes, where the other nodes refer to nodes other than the i-th node among the N nodes; A second result acquisition module is used to obtain a second voting result, where the second voting result includes the selection result of other nodes on whether to upgrade through the service upgrade proposal; Accordingly, the pause module includes: The suspension unit is used to suspend the processing of pending transaction information in the i-th node according to the first voting result and the second voting result.
8. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the blockchain service upgrade method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by the processor, the blockchain service upgrade method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Upgrading system and virtual machine-based upgrading method and device
CN108021378A