Block endorsement method and device of multi-level block chain and electronic equipment
By listening out block events in a multi-level blockchain and using endorsement parameters to interact with the endorsement contract of the previous layer of blockchain, block endorsement of multi-level blockchain is realized, and the problem of transaction unreliability in the existing technology is solved, ensuring the reliability and security of transactions.
Patent Information
- Application Number
- CN202510062413.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-01-15
AI Technical Summary
The existing technology cannot realize block endorsement of multi-level blockchains, resulting in transaction unreliability.
Starting from the underlying i-layer blockchain, block events are monitored, and the generated block data is used as endorsement parameters, block endorsement based on the endorsement parameters and the endorsement contract of the previous layer of blockchain, and endorsement layer by layer to the top layer n-layer blockchain.
It realizes block endorsement of multi-level blockchains, ensuring the reliability and security of transactions.
Smart Images

Figure CN119996422A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of blockchain technology, and in particular to a block endorsement method, device and electronic device for a multi-level blockchain. Background Art
[0002] In essence, blockchain can be seen as a special shared database, whose main features are that the data or information stored in it is unforgeable, traceable, and collectively maintained. Building a digital "trust" foundation based on blockchain technology and incorporating it into the future digital infrastructure can provide a solid "trust" platform for digital people, build a reliable "cooperation" mechanism, and combine it with specific applications in various industries, which has broad application prospects. In related technologies, it is often necessary to specify one or a group of blockchain nodes as endorsement nodes, and it is impossible to achieve the block endorsement scenario of multi-level blockchains. Summary of the invention
[0003] The present disclosure proposes a block endorsement method, device and electronic device for a multi-level blockchain, aiming to solve one of the technical problems in the related art at least to a certain extent.
[0004] The first aspect of the present disclosure proposes a block endorsement method for a multi-level blockchain, including: starting from the bottom layer i blockchain, monitoring the block generation event of the i-th layer blockchain, in response to monitoring that the i-th layer blockchain generates a first block, using the block data of the first block as a first endorsement parameter, and based on the first endorsement parameter and the endorsement contract of the i+1-th layer blockchain, endorsing the block of the i+1-th layer blockchain; continuing to monitor the block generation event of the i+1-th layer blockchain, in response to monitoring that the i+1-th layer blockchain generates a second block, using the block data of the second block as a second endorsement parameter, and based on the second endorsement parameter and the endorsement contract of the i+2-th layer blockchain, endorsing the block of the i+1-th layer blockchain, and repeating the above process until the traversal reaches the top layer n blockchain in the multi-level blockchain.
[0005] The second aspect of the present disclosure proposes a block endorsement device for a multi-level blockchain, including: a first block endorsement module, which is used to monitor the block generation event of the i-th layer blockchain starting from the bottom layer i blockchain, and in response to monitoring that the i-th layer blockchain generates a first block, use the block data of the first block as a first endorsement parameter, and based on the first endorsement parameter and the endorsement contract of the i+1-th layer blockchain, perform block endorsement on the i-th layer blockchain;
[0006] The second block endorsement module is used to continue to monitor the block generation event of the i+1th layer blockchain, and in response to monitoring that the i+1th layer blockchain generates a second block, use the block data of the second block as the second endorsement parameter, and based on the second endorsement parameter and the endorsement contract of the i+2th layer blockchain, endorse the block of the i+1th layer blockchain, and repeat the above process until the traversal reaches the top layer n blockchain in the multi-level blockchain.
[0007] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the block endorsement method of the multi-level blockchain of the embodiment of the present disclosure.
[0008] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the block endorsement method of the multi-level blockchain disclosed in the embodiment of the present disclosure.
[0009] In the embodiment of the present disclosure, starting from the bottom layer i blockchain, the block generation event of the layer i blockchain is monitored, in response to monitoring that the layer i blockchain generates a first block, the block data of the first block is used as the first endorsement parameter, and the layer i blockchain is endorsed based on the first endorsement parameter and the endorsement contract of the layer i+1 blockchain, and the block generation event of the layer i+1 blockchain is continued to be monitored, and in response to monitoring that the layer i+1 blockchain generates a second block, the block data of the second block is used as the second endorsement parameter, and the layer i+1 blockchain is endorsed based on the second endorsement parameter and the endorsement contract of the layer i+2 blockchain. The above process is repeatedly performed until the traversal reaches the top layer n blockchain in the multi-level blockchain. Therefore, the present disclosure implements the block endorsement of the multi-level blockchain by constructing a multi-level blockchain with a multi-level architecture, and based on the endorsement parameter and the endorsement contract of the layer i+1 blockchain, the block endorsement of the layer i blockchain is performed, and the transaction reliability in the block endorsement process of the multi-level blockchain is ensured.
[0010] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0012] Figure 1It is a flowchart of a block endorsement method of a multi-level blockchain provided according to an embodiment of the present disclosure;
[0013] Figure 2 It is a schematic diagram of a multi-level blockchain architecture provided according to an embodiment of the present disclosure;
[0014] Figure 3 It is a flowchart of a block endorsement method of a multi-level blockchain provided according to another embodiment of the present disclosure;
[0015] Figure 4 is a schematic diagram of a block endorsement device of a multi-level blockchain provided according to another embodiment of the present disclosure;
[0016] Figure 5 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0017] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0018] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0019] It should be noted that the executor of the block endorsement method of the multi-level blockchain of this embodiment can be a block endorsement device of the multi-level blockchain, which can be implemented by software and / or hardware, and can be configured in an electronic device, which can include but is not limited to a terminal, a server, etc.
[0020] Figure 1 is a flow chart of a block endorsement method for a multi-level blockchain provided according to an embodiment of the present disclosure, such as Figure 1 As shown, the method includes:
[0021] S101: Starting from the bottom layer i blockchain, monitor the block generation event of the i blockchain, and in response to monitoring that the i blockchain generates the first block, use the block data of the first block as the first endorsement parameter, and endorse the block of the i blockchain based on the first endorsement parameter and the endorsement contract of the i+1 layer blockchain.
[0022] Among them, the multi-layered blockchain architecture is a layered blockchain system that can implement different functions through different layers of blockchain to improve the scalability, security and flexibility of the system.
[0023] Among them, the endorsed block (the block formed after the block endorsement) refers to the block formed and added to the blockchain after multi-party verification and signature in the blockchain network.
[0024] It should be noted that the present disclosure does not limit the architecture of the multi-level blockchain and can be set according to actual conditions.
[0025] Optionally, the architecture of the multi-level blockchain can be the top-level blockchain (main chain) masterChain and the oracle masterOracle, the next-upper-level blockchain layer1Chain and the oracle layer1Oracle, and the bottom-level blockchain layer2Chain and the oracle layer2Oracle, that is, the multi-level blockchain includes 3 layers of blockchain.
[0026] In the disclosed embodiment, the client can call the smart contract on the i-th layer blockchain to send transaction data to the i-th layer blockchain. The oracle of the i-th layer blockchain can subscribe to the block event of the i-th layer blockchain to monitor the block event of the i-th layer blockchain. In response to monitoring that the i-th layer blockchain generates a first block, the block data of the first block is used as the first endorsement parameter, and based on the transaction data and the first endorsement parameter, the endorsement contract of the i+1-th layer blockchain is called to implement the block endorsement of the i-th layer blockchain. Optionally, the endorsement block (endorseBlock) method can be called to implement the block endorsement of the i-th layer blockchain.
[0027] S102: Continue to monitor the block generation event of the i+1th layer blockchain. In response to monitoring that the i+1th layer blockchain generates a second block, use the block data of the second block as the second endorsement parameter, and endorse the block of the i+1th layer blockchain based on the second endorsement parameter and the endorsement contract of the i+2th layer blockchain. Repeat the above process until the traversal reaches the top layer n blockchain in the multi-level blockchain.
[0028] In the disclosed embodiment, the oracle of the i+1th layer blockchain can subscribe to the block generation event of the i+1th layer blockchain to monitor the block generation event of the i+1th layer blockchain. In response to monitoring that the i+1th layer blockchain generates a second block, the block data of the second block is used as the second endorsement parameter. The oracle of the i+1th layer blockchain sends the transaction data to the i+2th layer blockchain. Based on the transaction data and the second endorsement parameter, the endorsement contract of the i+2th layer blockchain is called to implement the block endorsement of the i+1th layer blockchain. Optionally, the endorsement block (endorseBlock) method can be called to implement the block endorsement of the i+1th layer blockchain.
[0029] It should be noted that by repeatedly executing the above process until the traversal reaches the top nth layer of the multi-level blockchain, the block endorsement of the multi-level blockchain is achieved.
[0030] For example, if the architecture of a multi-level blockchain can be the top-level blockchain masterChain and the oracle masterOracle, the next-upper i+1 layer blockchain layer1Chain and the oracle layer1Oracle, and the bottom i blockchain layer2Chain and the oracle layer2Oracle, starting from the bottom-level blockchain layer2Chain, the block of the bottom-level blockchain layer2Chain is endorsed, and then for the next-upper-level blockchain layer1Chain, the block of the next-upper-level blockchain layer1Chain is endorsed, and the traversal reaches the top-level n-th layer blockchain in the multi-level blockchain. After the block endorsement of the bottom-level blockchain layer2Chain and the next-upper-level blockchain layer1Chain is completed, the block endorsement of the multi-level blockchain is realized.
[0031] For example, Figure 2As shown, the architecture of the multi-level blockchain can be the top-level blockchain masterChain and the oracle masterOracle, the second-upper-level blockchain layer1Chain and the oracle layer1Oracle, and the bottom-level blockchain layer2Chain and the oracle layer2Oracle. The oracle layer2Oracle of the bottom-level blockchain listens to the event of the bottom-level blockchain layer2Chain, generates the first block, calls the endorsement contract of the second-upper-level blockchain layer1Chain, takes the block data of the first block as an input parameter, and calls the endorseBlock method to implement the block endorsement of the bottom-level blockchain. The oracle layer1Oracle of the second-upper-level blockchain listens to the event of the second-upper-level blockchain layer1Chain, generates the second block, calls the endorsement contract of the top-level blockchain masterChain, takes the block data of the second block as an input parameter, and calls the endorseBlock method to implement the block endorsement of the second-upper-level blockchain.
[0032] In the embodiment of the present disclosure, starting from the bottom layer i blockchain, the block generation event of the layer i blockchain is monitored, in response to monitoring that the layer i blockchain generates a first block, the block data of the first block is used as the first endorsement parameter, and the layer i blockchain is endorsed based on the first endorsement parameter and the endorsement contract of the layer i+1 blockchain, and the block generation event of the layer i+1 blockchain is continued to be monitored, and in response to monitoring that the layer i+1 blockchain generates a second block, the block data of the second block is used as the second endorsement parameter, and the layer i+1 blockchain is endorsed based on the second endorsement parameter and the endorsement contract of the layer i+2 blockchain. The above process is repeatedly performed until the traversal reaches the top layer n blockchain in the multi-level blockchain. Therefore, the present disclosure implements the block endorsement of the multi-level blockchain by constructing a multi-level blockchain with a multi-level architecture, and based on the endorsement parameter and the endorsement contract of the layer i+1 blockchain, the block endorsement of the layer i blockchain is performed, and the transaction reliability in the block endorsement process of the multi-level blockchain is ensured.
[0033] Figure 3 is a flow chart of a block endorsement method for a multi-level blockchain provided according to another embodiment of the present disclosure, such as Figure 3 As shown, the method includes:
[0034] S301: Obtain the multi-level blockchain built by the client according to the required information.
[0035] In the disclosed embodiment, the client can build a multi-level blockchain based on business demand information.
[0036] For example, the headquarters unit blockchain can be used as the top-level n-th layer blockchain in a multi-level blockchain, the provincial unit blockchain as the second-level blockchain, and the municipal unit blockchain as the bottom-level blockchain. That is, the multi-level blockchain contains a three-layer architecture and can be used according to specific business scenarios.
[0037] For example, if the number of levels of a multi-level blockchain is 3, you can initialize the multi-level blockchain environment, build the top-level blockchain (main chain) masterChain and oracle masterOracle, the second-upper-level blockchain layer1Chain and oracle layer1Oracle, and the bottom-level blockchain layer2Chain and oracle layer2Oracle.
[0038] Among them, Oracle is a mechanism that connects blockchain and the outside world, enabling smart contracts to interact with external data sources. Oracle provides trusted data input to blockchain, allowing smart contracts to be automatically executed based on external events.
[0039] S302: Obtain the identifier of each layer of blockchain in the multi-level blockchain sent by the client, wherein the identifier of each layer of blockchain in the multi-level blockchain is registered by calling the endorsement contract of the top n-th layer blockchain in the multi-level blockchain.
[0040] Among them, the blockchain ID is a unique identifier used to distinguish different blockchains. It ensures the uniqueness and security of transactions and smart contracts in multi-layer blockchain networks.
[0041] In the disclosed embodiment, the client can register the identifier of each layer of blockchain by calling the endorsement contract of the top-level n-th layer blockchain in the multi-level blockchain.
[0042] For example, if the number of levels of a multi-level blockchain is 3, the top-level blockchain identifier (e.g., masterChain), the next-highest-level chain identifier (e.g., layer1Chain), and the bottom-level chain identifier (e.g., layer2Chain) are registered by calling the endorsement contract of the top-level blockchain.
[0043] It should be noted that after the registration is completed, the top-level n-th layer blockchain (main chain) has the identification of other layers of blockchain.
[0044] S303: Obtain the chain information of each layer of blockchain in the multi-level blockchain sent by the client, wherein the chain information of the i-th layer blockchain is registered on the i+1-th layer blockchain, and the chain information of the i+1-th layer blockchain is registered on the i+2-th layer blockchain, wherein the chain information includes node identification ID information, node public key information and node Internet Protocol IP information.
[0045] The chain information includes node identification (Identity Document, referred to as ID) information, node public key information, and node Internet Protocol (Internet Protocol, referred to as IP) information.
[0046] For example, if the number of levels of a multi-level blockchain is 3, the chain information of the bottom blockchain layer2Chain is registered on the next-upper blockchain layer1Chain, and the chain information of the next-upper blockchain layer1Chain is registered on the top blockchain masterChain.
[0047] It should be noted that the registration of chain information can be completed by calling the endorsement contract. Accordingly, a binding relationship is formed between the bottom blockchain layer2Chain (child chain) and the second upper blockchain layer1Chain (parent chain). In this case, the parent chain owns the chain information of the child chain, and a binding relationship is formed between the second upper blockchain layer1Chain (child chain) and the top blockchain masterChain (parent chain). In this case, the parent chain owns the chain information of the child chain.
[0048] S304: Receive transaction data sent by the client to the i-th layer blockchain.
[0049] In the disclosed embodiment, the client can call the smart contract on the i-th layer blockchain to send transaction data to the i-th layer blockchain.
[0050] S305: According to the transaction data, the block generation event of the i-th layer blockchain is monitored, and in response to the monitoring that the i-th layer blockchain generates a first block, the block data of the first block is used as a first endorsement parameter.
[0051] Optionally, the oracle of the i-th layer blockchain can subscribe to the block generation event of the i-th layer blockchain to monitor the block generation event of the i-th layer blockchain, and in response to monitoring that the i-th layer blockchain generates a first block, use the block data of the first block as the first endorsement parameter.
[0052] S306: The oracle of the i-th layer blockchain sends the transaction data to the i+1-th layer blockchain, and endorses the block of the i-th layer blockchain based on the transaction data, the first endorsement parameter and the endorsement contract of the i+1-th layer blockchain.
[0053] In the disclosed embodiment, the transaction verification parameters of the transaction data can be determined, and the transaction verification parameters can be verified based on the endorsement contract of the i+1th layer blockchain. In response to the endorsement contract of the i+1th layer blockchain determining that the verification parameters have been verified, the block endorsement of the i-layer blockchain is executed.
[0054] Optionally, the oracle of the i-th layer blockchain can calculate the Merkle path of the transaction data, transaction verification parameters such as transaction hash and block header, and verify the transaction verification parameters based on the endorsement contract of the i+1-th layer blockchain, that is, verify the reliability of the transaction.
[0055] In the embodiment of the present disclosure, after determining that the transaction verification parameter verification has passed, the endorsement of the block of the i-th layer blockchain can be achieved by calling the endorsement contract of the i+1-th layer blockchain based on the transaction data and the first endorsement parameter.
[0056] S307: Continue to monitor the block generation event of the i+1th layer blockchain, and in response to monitoring that the i+1th layer blockchain generates a second block, use the block data of the second block as the second endorsement parameter.
[0057] Optionally, the oracle of the i+1th layer blockchain can subscribe to the block generation event of the i+1th layer blockchain to monitor the block generation event of the i+1th layer blockchain, and in response to monitoring the generation of the second block by the i+1th layer blockchain, use the block data of the second block as the second endorsement parameter.
[0058] S308: The oracle of the i+1th layer blockchain sends the transaction data to the i+2th layer blockchain, and endorses the block of the i+1th layer blockchain based on the transaction data, the second endorsement parameter and the endorsement contract of the i+2th layer blockchain. The above process is repeated until the traversal reaches the top nth layer blockchain in the multi-level blockchain.
[0059] In the disclosed embodiment, the transaction verification parameters of the transaction data can be determined, and the transaction verification parameters can be verified based on the endorsement contract of the i+2th layer blockchain. In response to the endorsement contract of the i+2th layer blockchain determining that the transaction verification parameters have been verified, the block endorsement of the i+1th layer blockchain is executed.
[0060] Optionally, the oracle of the i+1th layer blockchain can calculate the Merkle path of the transaction data, transaction verification parameters such as transaction hash and block header, and verify the transaction verification parameters based on the endorsement contract of the i+2th layer blockchain, that is, verify the reliability of the transaction.
[0061] In the embodiment of the present disclosure, after determining that the transaction verification parameter verification has passed, the endorsement of the block of the i+1th layer blockchain can be achieved by calling the endorsement contract of the i+2th layer blockchain based on the transaction data and the second endorsement parameter.
[0062] In summary, in the embodiments of the present disclosure, by constructing a multi-level blockchain with a multi-level architecture, and according to the identifier and chain information of each layer of blockchain in the multi-level blockchain, different blockchains can be distinguished, the ownership relationship of each layer of blockchain can be determined, and the same set of endorsement contracts can be installed on the blockchain. Based on the endorsement parameters and the endorsement contract of the i+1th layer blockchain, the block of the i-th layer blockchain is endorsed, and based on the endorsement parameters and the endorsement contract of the i+2th layer blockchain, the block of the i+1th layer blockchain is endorsed, thereby realizing the block endorsement of the multi-level blockchain and ensuring the transaction reliability in the block endorsement process of the multi-level blockchain.
[0063] In order to implement the above embodiments, the present disclosure also proposes a block endorsement device for a multi-level blockchain.
[0064] Figure 4 It is a schematic diagram of a block endorsement device of a multi-level blockchain provided according to another embodiment of the present disclosure.
[0065] like Figure 4 As shown, the block endorsement device 40 of the multi-level blockchain includes:
[0066] The first block endorsement module 401 is used to monitor the block generation event of the i-th layer blockchain starting from the bottom layer i blockchain, and in response to monitoring that the i-th layer blockchain generates a first block, use the block data of the first block as the first endorsement parameter, and based on the first endorsement parameter and the endorsement contract of the i+1-th layer blockchain, perform block endorsement on the i-th layer blockchain;
[0067] The second block endorsement module 402 is used to continue to monitor the block generation event of the i+1th layer blockchain, and in response to monitoring that the i+1th layer blockchain generates a second block, use the block data of the second block as the second endorsement parameter, and based on the second endorsement parameter and the endorsement contract of the i+2th layer blockchain, endorse the block of the i+1th layer blockchain, and repeat the above process until the traversal reaches the top layer n blockchain in the multi-level blockchain.
[0068] In some embodiments, the first block endorsement module 401 is specifically used to: receive transaction data sent by a client to the i-th layer blockchain, and monitor the block generation event of the i-th layer blockchain according to the transaction data.
[0069] In some embodiments, the first block endorsement module 401 is specifically used to: send the transaction data to the i+1th layer blockchain by the oracle of the i-th layer blockchain, and endorse the block of the i-th layer blockchain based on the transaction data, the first endorsement parameter and the endorsement contract of the i+1th layer blockchain.
[0070] In some embodiments, the second block endorsement module 402 is specifically used to: send the transaction data to the i+2th layer blockchain by the oracle of the i+1th layer blockchain, and endorse the block of the i+1th layer blockchain based on the transaction data, the second endorsement parameter and the endorsement contract of the i+2th layer blockchain.
[0071] In some embodiments, the device 40 is specifically used to: determine the transaction verification parameters of the transaction data, and verify the transaction verification parameters based on the endorsement contract of the i+1th layer blockchain and the endorsement contract of the i+2th layer blockchain respectively; in response to the endorsement contract of the i+1th layer blockchain determining that the verification parameters have been verified, perform block endorsement on the i-th layer blockchain; and in response to the endorsement contract of the i+2th layer blockchain determining that the transaction verification parameters have been verified, perform block endorsement on the i+1th layer blockchain.
[0072] In some embodiments, device 40 is specifically used to: obtain a multi-level blockchain built by the client according to demand information.
[0073] In some embodiments, the device 40 is specifically used to: obtain the identifier of each layer of blockchain in the multi-level blockchain sent by the client, wherein the identifier of each layer of blockchain in the multi-level blockchain is registered by calling the blockchain endorsement contract of the top layer n in the multi-level blockchain.
[0074] In some embodiments, the device 40 is specifically used to: obtain the chain information of each layer of blockchain in the multi-level blockchain sent by the client, wherein the chain information of the i-th layer blockchain is registered on the i+1-th layer blockchain, and the chain information of the i+1-th layer blockchain is registered on the i+2-th layer blockchain, wherein the chain information includes node identification ID information, node public key information and node Internet Protocol IP information.
[0075] In this embodiment, starting from the bottom layer i blockchain, the block generation event of the layer i blockchain is monitored, in response to monitoring that the layer i blockchain generates a first block, the block data of the first block is used as the first endorsement parameter, and the layer i blockchain is endorsed based on the first endorsement parameter and the endorsement contract of the layer i+1 blockchain, and the block generation event of the layer i+1 blockchain is continued to be monitored, and in response to monitoring that the layer i+1 blockchain generates a second block, the block data of the second block is used as the second endorsement parameter, and the layer i+1 blockchain is endorsed based on the second endorsement parameter and the endorsement contract of the layer i+2 blockchain. The above process is repeatedly performed until the traversal reaches the top layer n blockchain in the multi-level blockchain. Therefore, the present disclosure implements the block endorsement of the multi-level blockchain by constructing a multi-level blockchain with a multi-level architecture, and based on the endorsement parameter and the endorsement contract of the layer i+1 blockchain, the block endorsement of the layer i blockchain is performed, and the transaction reliability in the block endorsement process of the multi-level blockchain is ensured.
[0076] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0077] In order to implement the above embodiments, the present disclosure also proposes a computer program product. When the instruction processor in the computer program product is executed, the block endorsement method of the multi-level blockchain proposed in the aforementioned embodiment of the present disclosure is executed.
[0078] Figure 5 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Figure 5 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0079] like Figure 5 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0080] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.
[0081] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0082] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 Not shown, often called a "hard drive").
[0083] although Figure 5 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read only memory (CD-ROM), a digital versatile disc read only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the various embodiments of the present disclosure.
[0084] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described in the present disclosure.
[0085] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0086] The processing unit 16 executes various functional applications by running programs stored in the system memory 28, such as implementing the block endorsement method of the multi-level blockchain mentioned in the aforementioned embodiment.
[0087] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0088] It should be understood that the present disclosure is not limited to the exact 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 disclosure is limited only by the appended claims.
[0089] It should be noted that, in the description of the present disclosure, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present disclosure, unless otherwise specified, the meaning of "plurality" is two or more.
[0090] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.
[0091] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0092] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0093] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0094] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0095] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0096] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.
Claims
1. A block endorsement method for a multi-level blockchain, characterized in that: The method comprises: Starting from the bottom layer i blockchain, monitoring the block generation event of the i blockchain, in response to monitoring the generation of the first block by the i blockchain, using the block data of the first block as the first endorsement parameter, and based on the first endorsement parameter and the endorsement contract of the i+1th layer blockchain, endorsing the block of the i blockchain; Continue to monitor the block generation event of the i+1th layer blockchain, in response to monitoring that the i+1th layer blockchain generates a second block, use the block data of the second block as the second endorsement parameter, and based on the second endorsement parameter and the endorsement contract of the i+2th layer blockchain, endorse the block of the i+1th layer blockchain, and repeat the above process until the traversal reaches the top layer n blockchain in the multi-level blockchain.
2. The method according to claim 1, characterized in that The monitoring of the block generation event of the i-th layer blockchain includes: Receive transaction data sent by the client to the i-th layer blockchain, and monitor the block generation event of the i-th layer blockchain according to the transaction data.
3. The method according to claim 2, characterized in that The step of endorsing a block of the i-th layer blockchain based on the first endorsement parameter and the endorsement contract of the i+1-th layer blockchain includes: The oracle of the i-th layer blockchain sends the transaction data to the i+1-th layer blockchain, and endorses the block of the i-th layer blockchain based on the transaction data, the first endorsement parameter and the endorsement contract of the i+1-th layer blockchain.
4. The method according to claim 2, characterized in that: The step of endorsing a block of the i+1th layer blockchain based on the second endorsement parameter and the endorsement contract of the i+2th layer blockchain includes: The oracle of the i+1th layer blockchain sends the transaction data to the i+2th layer blockchain, and endorses the blocks of the i+1th layer blockchain based on the transaction data, the second endorsement parameter and the endorsement contract of the i+2th layer blockchain.
5. The method according to any one of claims 3 to 4, characterized in that: The method further comprises: Determine a transaction verification parameter of the transaction data, and verify the transaction verification parameter based on the endorsement contract of the i+1th layer blockchain and the endorsement contract of the i+2th layer blockchain respectively; In response to the endorsement contract of the i+1th layer blockchain determining that the verification parameter verification has passed, the block endorsement of the i-th layer blockchain is performed, and in response to the endorsement contract of the i+2th layer blockchain determining that the transaction verification parameter verification has passed, the block endorsement of the i+1th layer blockchain is performed.
6. The method according to claim 1, characterized in that The method further comprises: Get the multi-level blockchain built by the client based on the required information.
7. The method according to claim 6, characterized in that After obtaining the multi-level blockchain, the method further includes: Obtain the identifier of each layer of blockchain in the multi-level blockchain sent by the client, wherein the identifier of each layer of blockchain in the multi-level blockchain is registered by calling the blockchain endorsement contract of the top layer n in the multi-level blockchain.
8. The method according to claim 7, characterized in that The method further comprises: The chain information of each layer of blockchain in the multi-level blockchain sent by the client is obtained, wherein the chain information of the i-th layer blockchain is registered on the i+1-th layer blockchain, and the chain information of the i+1-th layer blockchain is registered on the i+2-th layer blockchain, wherein the chain information includes node identification ID information, node public key information and node Internet Protocol IP information.
9. A block endorsement device for a multi-level blockchain, characterized in that: include: The first block endorsement module is used to monitor the block generation event of the i-th layer blockchain starting from the bottom layer i blockchain, and in response to monitoring that the i-th layer blockchain generates a first block, use the block data of the first block as the first endorsement parameter, and based on the first endorsement parameter and the endorsement contract of the i+1-th layer blockchain, endorse the block of the i-th layer blockchain; The second block endorsement module is used to continue to monitor the block generation event of the i+1th layer blockchain, and in response to monitoring that the i+1th layer blockchain generates a second block, use the block data of the second block as the second endorsement parameter, and based on the second endorsement parameter and the endorsement contract of the i+2th layer blockchain, endorse the block of the i+1th layer blockchain, and repeat the above process until the traversal reaches the top layer n blockchain in the multi-level blockchain.
10. An electronic device, characterized in that: The invention comprises a processor and a memory; wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the method as claimed in any one of claims 1 to 8.
Citation Information
Patent Citations
Block chain network bifurcation automatic recovery method, device and system
CN111679936A
Cross-chain transaction request processing method and device, equipment and storage medium
CN111741026A
Cross-block-chain interaction method and system, computer equipment and storage medium
CN111914021A
Cross-block chain transaction method, device and system, medium and electronic equipment
CN114612103A
Customized endorsement logic for blockchain
US20190278852A1