A consensus message identification method, device and storage medium based on self-expression
By introducing a self-expression method for transaction identifier area, status identifier area, and version identifier area in cross-chain transactions, the problem of difficulty in expressing failure status in cross-chain transactions is solved, and smooth upgrades and compatibility of main chain and parallel chains are achieved.
Patent Information
- Application Number
- CN202211117122.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-14
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-09-14
AI Technical Summary
Existing technologies cannot effectively express failure states in cross-chain transactions, making it difficult to upgrade parallel chains in scenarios with a large number of parallel chains, and upgrades may affect business operations.
A self-expressive consensus message identification method is adopted, which introduces a transaction identifier area, a status identifier area, and a version identifier area into the consensus message, and uses binary to express the transaction status and version number, supporting the synchronization of consensus messages of multiple versions of parachains.
It enables smooth upgrades between the main chain and parallel chains, is compatible with both new and old versions of parallel chains, reduces blockchain forks, and supports rich synchronous message expressions.
Smart Images

Figure CN115510153B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer technology, and particularly relates to a consensus message identification method, device and storage medium based on self-expression. Background Technology
[0002] In existing technologies, cross-chain transaction execution results are synchronized using a bitmap, where each bit has only two states: 0 for failure and 1 for success. For example, if there's only one cross-chain transaction that failed, the failure status cannot be expressed, or if the highest bit represents a cross-chain transaction that failed. Current solutions filter all cross-chain transactions in the corresponding block on the main chain; if the corresponding bit for the cross-chain status is 0 or there is no status, it indicates a failure. In scenarios with numerous parachains, upgrading parachains is a significant headache. Users often don't want to upgrade parachain versions. Forced upgrades often impact their business operations. Summary of the Invention
[0003] This invention provides a consensus message identification method, device, and storage medium based on self-expression, and proposes a consensus message synchronization mechanism based on multiple versions of main chain and parallel chain. By marking the version number through the version identifier area, richer synchronization messages can be expressed.
[0004] To solve or partially solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0005] In a first aspect, the present invention provides a consensus message identification method based on self-expression, the method being applicable to main chain-parallel chain networks, the method specifically comprising:
[0006] The first consensus node generates the first consensus transaction to achieve consensus for the first block and configures the corresponding first consensus message. The first consensus message is used to synchronize the execution results of cross-chain transactions in the first block. The first consensus message includes a transaction identifier area, a status identifier area, and a version identifier area. The transaction identifier area includes several transaction identifier bits, and the number and order of the transaction identifier bits correspond one-to-one with the order of the number of cross-chain transactions in the block. The status identifier area is used to set the anchored transaction status. The status identifier area has a transaction success or transaction failure indicator. The transaction identifier bits in the transaction identifier area set the transaction status of the corresponding cross-chain transaction based on the transaction status anchored in the status identifier area. The version identifier area is used to set the version number corresponding to the parachain.
[0007] Preferably, the version identifier area is set to at least 2 bits, and the version identifier area expresses the version number in binary.
[0008] Preferably, the transaction identifier is followed by a transaction type identifier and an account address identifier. The account address identifier is used to mark the initiator address number of the corresponding cross-chain transaction, and the transaction type identifier is used to mark the transaction type of the cross-chain transaction.
[0009] Preferably, the transaction type identifier is set to at least 4 bits to express the transaction type of the cross-chain transaction in binary, and the account address identifier has a capacity of 32 bits.
[0010] In a second aspect, a computer device is provided, comprising one or more processors;
[0011] Memory, used to store one or more programs.
[0012] When the one or more programs are executed by the one or more processors, the one or more processors perform the method as described in the first aspect above.
[0013] Thirdly, a storage medium storing a computer program is provided, which, when executed by a processor, implements the method described in the first aspect above.
[0014] The beneficial effects of this invention are that by proposing consensus messages based on multiple versions of the main chain and parallel chains, it can express richer synchronization messages and support smooth upgrades of the main chain and parallel chains. It is compatible with both new and old versions of parallel chains. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0016] The present invention will be further described clearly and in detail below with reference to specific embodiments and accompanying drawings. Those skilled in the art will be able to implement the present invention based on these descriptions. Furthermore, the embodiments of the present invention described below are generally only some embodiments of the present invention, and not all embodiments. Therefore, all other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort should fall within the scope of protection of the present invention. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other. Unless otherwise specified, the methods briefly described in the embodiments of the present invention are methods mastered by those skilled in the art.
[0017] As an embodiment of the present invention, a consensus message identification method based on self-expression is provided. The method is applicable to main chain-parallel chain networks, and the method specifically includes:
[0018] The first consensus node generates the first consensus transaction to achieve consensus for the first block and configures the corresponding first consensus message. The first consensus message is used to synchronize the execution results of cross-chain transactions in the first block. The first consensus message includes a transaction identifier area, a status identifier area, and a version identifier area. The transaction identifier area includes several transaction identifier bits, and the number and order of the transaction identifier bits correspond one-to-one with the order of the number of cross-chain transactions in the block. The status identifier area is used to set the anchored transaction status. The status identifier area has a transaction success or transaction failure indicator. The transaction identifier bits in the transaction identifier area set the transaction status of the corresponding cross-chain transaction based on the transaction status anchored in the status identifier area. The version identifier area is used to set the version number corresponding to the parachain.
[0019] Specifically, the version identifier area is set to at least 2 bits, and the version identifier area expresses the version number in binary.
[0020] Specifically, the transaction identifier is followed by a transaction type identifier and an account address identifier. The account address identifier is used to mark the initiator address number of the corresponding cross-chain transaction, and the transaction type identifier is used to mark the transaction type of the cross-chain transaction.
[0021] Specifically, the transaction type identifier is set to at least 4 bits to express the transaction type of the cross-chain transaction in binary, and the account address identifier has a capacity of 32 bits.
[0022] In this embodiment, the consensus message includes a cross-chain transaction setting, namely a transaction identifier area. The highest few bits correspond to cross-chain transactions, and the status of failed transactions can be clearly identified through these transaction bit settings. For example, a single transaction is represented as 10, where 1 represents one cross-chain transaction and 0 represents a failed transaction. 1010 represents three transactions, with 0 and 2 of them failing. This embodiment also includes a version number. For example, the version number has four bits: 0001 represents version 1, 0010 represents version 2, and a total of 16 versions can be represented.
[0023] By supporting versioned consensus messages, blockchain forks and smooth upgrades between the main chain and parachains can be reduced. In scenarios with a large number of parachains, upgrading them is a significant challenge. Users often don't want to upgrade their parachain versions. Forced upgrades can often disrupt their business. Adding versioned cross-chain transaction messages allows the main chain to support multiple versions of parachain consensus messages, enabling the simultaneous existence of both old and new versions and smooth upgrades.
[0024] This invention proposes a consensus message synchronization mechanism based on multiple versions of the main chain and parallel chains. By using consensus bitmap fields from multiple versions, richer synchronization messages can be expressed, such as status information or execution result information. This invention, by proposing a consensus message mechanism based on multiple versions of the main chain and parallel chains, can express richer synchronization messages and supports smooth upgrades of the main chain and parallel chains. It is compatible with both new and old versions of parallel chains.
[0025] Figure 1 This is a schematic diagram of the structure of a device provided in an embodiment of the present invention.
[0026] like Figure 1 As shown, in another embodiment of the present invention, a computer device 100 is provided, including one or more central processing units (CPUs) 101, which can perform various appropriate actions and processes according to programs stored in read-only memory (ROM) 102 or programs loaded from storage portion 108 into random access memory (RAM) 103. The RAM 103 also stores various programs and data required for the operation of the device 100. The CPU 101, ROM 102, and RAM 103 are interconnected via a bus 104. An input / output (I / O) interface 105 is also connected to the bus 104.
[0027] The following components are connected to I / O interface 105: an input section 106 including a keyboard, mouse, etc.; an output section 107 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 108 including a hard disk, etc.; and a communication section 109 including a network interface card such as a LAN card, modem, etc. The communication section 109 performs communication processing via a network such as the Internet. Driver 110 is also connected to I / O interface 105 as needed. Removable media 111, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on driver 110 as needed so that computer programs read from them can be installed into storage section 108 as needed.
[0028] Specifically, according to the embodiments disclosed in this application, the method described in Embodiment 1 above can be implemented as a computer software program. For example, embodiments disclosed in this application include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing the methods described in any of the embodiments above. In such embodiments, the computer program can be downloaded and installed from a network via communication section 109, and / or installed from removable medium 111.
[0029] In another aspect, this application also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus of the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores one or more programs that are used by one or more processors to perform the methods described in this application.
[0030] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified function or operation, or by a combination of dedicated hardware and computer instructions.
[0031] The units or modules described in the embodiments of this application can be implemented in software or hardware. The described units or modules can also be located in a processor; for example, each unit can be a software program located in a computer or mobile smart device, or a separately configured hardware device. The names of these units or modules do not, in some cases, constitute a limitation on the unit or module itself.
[0032] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the concept of this application. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A consensus message identification method based on self-expression, characterized in that, The method is applicable to main chain-parallel chain networks, and the method specifically includes: The first consensus node generates the first consensus transaction to achieve consensus for the first block and configures the corresponding first consensus message. The first consensus message is used to synchronize the execution results of cross-chain transactions in the first block. The first consensus message includes a transaction identifier area, a status identifier area, and a version identifier area. The transaction identifier area includes several transaction identifier bits, the number and order of which correspond one-to-one with the order of the number of cross-chain transactions in the block. The status identifier area is used to set the anchored transaction status, and includes a transaction success or failure indicator. The transaction identifier bits in the transaction identifier area set the transaction status of the corresponding cross-chain transaction based on the transaction status anchored in the status identifier area. The version identifier area is used to set the version number corresponding to the parachain. The transaction identifier is followed by a transaction type identifier and an account address identifier. The account address identifier is used to mark the initiator address number of the corresponding cross-chain transaction, and the transaction type identifier is used to mark the transaction type of the cross-chain transaction. The consensus message identification method adds a cross-chain transaction setting to the consensus message, namely a transaction identification area, in which the highest few bits correspond to cross-chain transactions to clearly identify the status of failed transactions. The consensus message identification method supports versioned consensus messages, which is used to reduce blockchain forks and smooth upgrades of the main chain and parallel chains, and to enable the main chain to support multiple versions of parallel chain consensus messages, while supporting the coexistence of new and old versions.
2. The consensus message identification method based on self-expression according to claim 1, characterized in that, The version identifier area is set to at least 2 bits, and the version identifier area expresses the version number in binary.
3. The self-expression method for consensus messages between main chain and parallel chains according to claim 1, characterized in that, The transaction type identifier is set to at least 4 bits to express the transaction type of the cross-chain transaction in binary, and the account address identifier has a capacity of 32 bits.
4. A computer device, characterized in that, One or more processors; Memory, used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors perform the method as described in any one of claims 1 to 3.
5. A storage medium storing a computer program, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Method and system for synchronizing knowledge base between cascaded management platforms
CN108055315A
Parallel chain main chain transaction state synchronization method and device, and storage medium
CN110084601A