Blockchain system, operating method, electronic device, and storage medium

By introducing the structure of the first ledger and the second ledger in the blockchain system, using the hash function to generate new blocks and store hash values, the problem of transaction information loss in the blockchain is solved, and mutual backup and security between ledgers are achieved.

CN116955481BActive Publication Date: 2025-10-14SHENZHEN SHULUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310696343.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-12
Publication Date
2025-10-14
Estimated Expiration
2043-06-12

AI Technical Summary

Technical Problem

In the blockchain system, under abnormal circumstances, when no new blocks are generated within the preset time, transaction information is easily lost, resulting in inability to confirm.

Method used

The structure of the first ledger and the second ledger is adopted to generate new blocks through hash functions, and the hash values ​​are stored between adjacent block moments to achieve mutual backup and linking between ledgers.

Benefits of technology

It prevents the generated blocks from losing transaction information, improves the security and anti-attack capabilities of the blockchain, and realizes mutual backup between ledgers through hash pointers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116955481B_ABST
    Figure CN116955481B_ABST
Patent Text Reader

Abstract

The application provides a blockchain system, a running method, an electronic device and a storage medium. The method comprises the following steps: obtaining a first hash value of a previous first block in a first ledger and transaction information of a second ledger. A second hash value corresponding to the transaction information and the first hash value is generated by using a hash function. The transaction information, the first hash value and the second hash value are encapsulated to generate a second block of the second ledger. The first hash value is stored in the block header of the second block at the block time between the previous first block and the next first block of the first ledger and the block time of the next first block. The previous first block and the next first block are blocks linked according to the block time and having a span of at least two block times. In the above manner, the first block of the first ledger and the second block of the second ledger are linked, the generated second block is prevented from losing transaction information, and mutual backup between the first ledger and the second ledger is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The disclosed embodiments of the present application relate to the field of blockchain technology, and more particularly, to a blockchain system, a running method, an electronic device and a storage medium. BACKGROUND

[0002] In the blockchain technology, every interval of a preset time, when the block time arrives, a node in the consensus group will obtain the transaction information of the consensus group in this time interval, generate a new hash value based on the transaction information and the hash value of the block of the previous time interval by using a hash function, and encapsulate the hash value, the hash value of the block of the previous block time and the transaction information to generate a new block. Therefore, as time goes on, new blocks are constantly generated.

[0003] However, if an abnormal situation occurs, a new block is not generated at the preset time, and the transaction information in the blockchain cannot be confirmed before the new block is generated, which is easy to cause the loss of transaction information. SUMMARY

[0004] According to the embodiments of the present application, the blockchain system, the running method, the electronic device and the storage medium are proposed to solve the above problems.

[0005] The present application provides a blockchain system, which comprises a first ledger and a second ledger, the first ledger comprises a plurality of first blocks, the first blocks are linked according to the block time in sequence, the second ledger comprises a plurality of second blocks, the second blocks are linked according to the block time in sequence. Wherein, the first blocks are linked with the second blocks, and the adjacent two first blocks linked according to the block time in sequence span at least two block times, and / or the adjacent two second blocks linked according to the block time in sequence span at least two block times.

[0006] The present application provides another blockchain running method, which comprises: obtaining a first hash value of a previous first block in a first ledger and transaction information of a second ledger. Using a hash function, a second hash value corresponding to the transaction information and the first hash value is generated. The transaction information, the first hash value and the second hash value are encapsulated to generate a second block of the second ledger. Wherein, the first hash value is stored in the block header of the second block at the block time between the previous first block and the next first block of the first ledger and the block time of the next first block, and the previous first block and the next first block are blocks linked according to the block time in sequence and spanning at least two block times.

[0007] The present application provides an electronic device, comprising a memory and a processor, wherein the memory and the processor are coupled to each other, and the processor is configured to execute program instructions stored in the memory to implement the above-mentioned blockchain system or the above-mentioned blockchain operation method.

[0008] The present application provides a computer storage medium having program instructions stored thereon, which, when executed by a processor, implement the above-mentioned blockchain system or the above-mentioned blockchain operation method.

[0009] The beneficial effects of the present application include: linking the first block of the first account book and the second block of the second account book, storing the first hash value of the previous first block in the block header of the second block between the block times of the previous first block and the next first block and at the block time of the next first block, thereby preventing the generated second block from losing transaction information and realizing mutual backup between the first account book and the second account book.

[0010] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The present application will be further described below with reference to the accompanying drawings and implementation methods, in which:

[0012] Figure 1 This is a schematic diagram of the blockchain ledger structure of an embodiment of the present application;

[0013] Figure 2 This is a schematic diagram of the connection between the first block and the second block in one embodiment of the present application;

[0014] Figure 3 This is a schematic diagram of the connection between the first block and the second block in one embodiment of the present application;

[0015] Figure 4 This is a schematic diagram of the connection between the first block and the second block in one embodiment of the present application;

[0016] Figure 5 This is a flowchart of the blockchain operation method according to an embodiment of the present application;

[0017] Figure 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application;

[0018] Figure 7 It is a structural diagram of the non-volatile computer-readable storage medium of an embodiment of the present application. DETAILED DESCRIPTION

[0019] Reference to an "embodiment" in this application means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive of one another. As will be apparent to those of ordinary skill in the art, embodiments described herein can be combined with one another.

[0020] The term "and / or" in this application merely describes an association relationship of associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in this application generally represents an "or" relationship between the front and rear associated objects. In addition, "multiple" in this application means two or more than two. In addition, the term "at least one" in this application means any one of multiple or any combination of at least two of multiple, for example, including at least one of A, B and C can mean including any one or more elements selected from the set consisting of A, B and C. In addition, the terms "first", "second", "third" in this application are only for description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features.

[0021] In the field of blockchain technology, a ledger is used to manage data such as accounts or transaction streams, supporting functions such as classification accounting, reconciliation, clearing, or settlement. In a blockchain, multiple nodes form a consensus group, and each consensus group has a corresponding ledger. The consensus group maintains the ledger and packages transactions that occur at a certain time in the consensus group to generate a block for that time period. Further, the block generated in the previous time period is the parent block of the block generated in the next time period, and the block generated in the next time period is the child block of the block generated in the previous time period. That is, there is an inheritance relationship between the block generated in the previous time period and the block generated in the next time period, and the child block inherits or extends the parent block. For example, all residents of a village are accounted for to generate a ledger for the village, i.e., the consensus group of the ledger is composed of all residents of the village. All transactions that occur in the village during January are found and recorded, and a ledger for the village in January is generated. Similarly, a ledger for the village in February is generated, wherein the ledger for February is based on the ledger for January and is extended based on subsequent transactions of the ledger for January. Therefore, the ledger for January can be regarded as a parent block, and the ledger for February can be regarded as a child block. The ledger for January and the ledger for February together constitute the ledger for the village.

[0022] Furthermore, a block generated by a blockchain consists of a block header and a block body. The block header is a data structure containing key information, describing the basic information of a block. It stores the current block hash, parent block, or Merkle root, and serves as a unique identifier for a block. It can be used to verify the integrity of the entire blockchain and also serves as the basic framework for transmitting information between nodes in the blockchain network. The block body stores all transactions or other data that occurred within the consensus group at a certain time, such as the source code of smart contracts, changes in on-chain status, and node data.

[0023] In the blockchain system of this application, there is a hierarchical relationship between different account books, and the upper-level account book is the parent account book of the lower-level account book, and the lower-level account book is the child account book of the upper-level account book, with the upper-level account book as the main one. Among them, the parent account book and the child account book refer to the inheritance relationship between the two account books, and the child account book inherits the parent account book or extends and expands the parent account book. For example: the net profit account book of the shopping mall is defined as the upper-level account book, and the net profit account book includes the shopping mall expenditure account book and the shopping mall income account book. Therefore, the shopping mall expenditure and shopping mall income are defined as the lower-level account books. At this time, there is a parent-child relationship between the net profit account book and the shopping mall expenditure account book and the shopping mall income account book, that is, the net profit account book is the parent account book of the shopping mall expenditure account book, and the net profit account book is also the parent account book of the shopping mall income account book. At the same time, the shopping mall expenditure account book and the shopping mall income account book are child accounts of the net profit account book. At the same time, the parent account book is the main one between the parent account book and the child account books, and the interaction between the child account books must be carried out through the parent account book. For example, Ledger B and Ledger C are created under Ledger A. Ledger B and Ledger C are child ledgers of Ledger A, and Ledger A is the parent ledger of Ledgers B and C. Interaction between Ledgers B and C must proceed through Ledger A, i.e., from Ledger B to Ledger A, and then to Ledger C. Furthermore, Ledger D is created under Ledger B. Ledger D is a child ledger of Ledger B, and Ledger B is the parent ledger of Ledger D. Ledger E is created under Ledger C. Ledger E is a child ledger of Ledger C, and Ledger C is the parent ledger of Ledger E. Interaction between Ledgers D and Ledger E must proceed through Ledger B, Ledger A, and Ledger C, i.e., from Ledger D to Ledger B to Ledger A to Ledger C, and then to Ledger E. Similarly, interaction between Ledgers D and Ledger C must proceed through Ledger B and Ledger A, i.e., from Ledger D to Ledger B to Ledger A, and then to Ledger C.

[0024] In this case, the same node can participate in both the upper-layer ledger and the lower-layer ledger. This node is called a composite node. Specifically, a node can participate in the consensus group of the upper-layer ledger (parent ledger) and the consensus group of the lower-layer ledger (child ledger). The first node program of this node is deployed on the upper-layer ledger, and the second node program is deployed on the lower-layer ledger. The method of this application can be executed on a composite node.

[0025] See also Figure 1 ,Figure 1 is a schematic diagram of a blockchain ledger structure according to an embodiment of the present application. The method of constructing the blockchain ledger structure comprises: receiving a first ledger creation instruction, and creating a first ledger. Receiving a second ledger creation instruction, and creating at least one second ledger under the first ledger, wherein the first ledger constitutes an upper layer ledger, and the second ledger constitutes a sub-ledger or a lower layer ledger of the first ledger. Wherein the first ledger and the second ledger can mutually perform zero-knowledge proof commitment.

[0026] In this embodiment, after receiving the first ledger creation instruction, the first ledger is created. Then, the second ledger creation instruction is received again, and at least one second ledger is created under the first ledger, that is, the number of second ledgers created is greater than or equal to one. Then, the third ledger creation instruction is received again, and at least one third ledger is created under the second ledger, that is, the number of third ledgers created is greater than or equal to one, wherein the number of third ledgers created is equal to the number of second ledgers created, and so on. Wherein the first ledger is an upper layer ledger of the second ledger, the second ledger is a lower layer ledger of the first ledger, the second ledger is an upper layer ledger of the third ledger, the third ledger is a lower layer ledger of the second ledger, and so on, forming a cross-laminated timber (CLT) shaped blockchain. And the level where the first ledger is located is defined as the first layer L1, the level where the second ledger is located is defined as the second layer L2, the level where the third ledger is located is defined as the third layer L3, and so on. Wherein the blockchain system generates a creation instruction when it is determined that a new ledger needs to be recorded, thereby generating a new ledger.

[0027] In order for those skilled in the art to better understand the technical solutions of the present application, the technical solutions of the present application are described in further detail below in conjunction with the drawings and specific embodiments.

[0028] The present application provides a blockchain system, which comprises: a first ledger and a second ledger, the first ledger comprising a plurality of first blocks, the first blocks being linked in time sequence, the second ledger comprising a plurality of second blocks, the second blocks being linked in time sequence. Wherein the first blocks are linked with the second blocks, and adjacent two first blocks linked in time sequence span at least two block times, and / or adjacent two second blocks linked in time sequence span at least two block times.

[0029] In this embodiment, the consensus group maintains the ledger, different consensus groups maintain different ledgers, and the ledgers are separated by a predetermined time. One node in the consensus group will package the transaction information generated by the consensus group in this period of time, generate a new hash value based on the transaction information and the hash value of the block in the previous period of time using a hash function, and encapsulate the hash value, the hash value of the block in the previous period of time and the transaction information to generate a new block. Therefore, the hash pointer can link the block generated in the previous period of time with the block generated in the next period of time in time sequence.

[0030] During the operation of the blockchain, an abnormal situation may occur. No new block is generated at the preset time of the interval. A new block may be generated at least at the next preset time. At this time, the new block is at least two blocks away from the block generated in the previous period (meaning at least one block is lost). Therefore, in the embodiment of the present application, there are two account books, and the blocks generated by the two account books are linked to each other. The specific process of the blocks generated by the two account books being linked to each other can be: there is a node that participates in the consensus group of the first account book and the consensus group of the second account book, that is, the node is a composite node, and the node has the function of packaging, generating and verifying blocks and monitoring dual account book information. When the node consensus first account book block data and generates a new block of the first account book, it is necessary to save the hash value in the latest block of the second account book to the new block. After the new block is generated, the other nodes in the consensus group to which the first account book belongs will verify whether the new block is correct. After verifying and confirming the block, it is executed on the chain and becomes the new block of the first account book for that time period. Therefore, in this embodiment, after the generation of a new block, it is not only linked to the block in the first ledger at the time of the previous block, but also to the block in the second ledger at the time of the previous block. Furthermore, the interconnection between the first and second blocks enables mutual backup of transaction information between the first and second ledgers. That is, when the first and second ledgers are linked, because the blocks between different ledgers are also interconnected, an attacker needs to reverse all related ledgers to reverse a single block, which increases the difficulty of blockchain attacks and also improves the security of the blockchain. The first ledger is the upper-level ledger and parent ledger of the second ledger, and the second ledger is the lower-level ledger and child ledger of the first ledger. The child ledgers interact with each other through their parent ledgers.

[0031] The specific process of the node monitoring whether the ledger generates a new block can be: the ledger provides an RPC interface, and the node program can directly call the RPC interface to obtain the block information of the ledger; or a light client is deployed on the node, and the light client calls the RPC interface to obtain the data of the ledger, and then the node program uses the data obtained by the light client.

[0032] Please refer to the following for details: Figure 2 and Figure 3 , Figure 2 This is a schematic diagram of the connection between the first block and the second block in one embodiment of the present application. Figure 3 The following is a schematic diagram of the first block and second block links in one embodiment of the present application. In these diagrams, each first block stores the second hash value of the most recent second block at the block time before the block time of the first block, and each second block stores the first hash value of the most recent first block at the block time before the block time of the second block.

[0033] Specifically, in this embodiment, the first block of the first ledger stores the second hash value of the latest second block of the second ledger at the block time before the block time in which the first block is located. A hash pointer is used to make the first block point to the latest second block at the block time before the block time in which the first block is located. Similarly, each second block stores the first hash value of the latest first block at the block time before the block time in which the second block is located.

[0034] The preceding first block of two first blocks with a span of at least two block times is defined as the preceding first block, the other first block is defined as the following first block, the second block at the block time where the following first block is located, and the second block at the block time between the preceding first block and the following first block stores the first hash value of the preceding first block; and / or the preceding second block of two second blocks with a span of at least two block times is defined as the preceding second block, the other second block is defined as the following second block, the first block at the block time where the following second block is located, and the first block at the block time between the preceding second block and the following second block stores the second hash value of the preceding second block.

[0035] Specifically, see Figure 2 In this diagram, at time t2, a new block is generated in the first and second ledgers. However, at time t3, the corresponding second block C on the second ledger has not been generated, but the first block C of the first ledger has been generated. At time t4, the first block D of the first ledger and the second block D of the second ledger are generated. Therefore, in this diagram, the interval between the second block B and the second block D is two block times. If the second block C is generated at the preset block time, the hash value of the second block C will be obtained during the generation of the first block D, and the hash value of the second block C will be encapsulated into the block header of the first block D. In this embodiment, the composite node between the first and second ledgers deploys a node program on both the first and second ledgers. The node program on the first and second ledgers monitors the chain data of the first and second ledgers and obtains the latest block information of the first and second ledgers. Therefore, when the second block C is not generated normally, the composite node will obtain the hash value of the second block B, encapsulate the hash value of the second block B into the block header of the first block D, and use the hash pointer to make the first block D point to the second block B. In other words, the first block points to the latest second block at the block time before the current block time. Similarly, when the second block D is generated, the latest block on the second ledger is the second block D. The block header of the first block E stores the hash value of the second block D, and the hash function is used to make the first block E point to the second block D.

[0036] Similarly, see Figure 3In this diagram, at time t2, new blocks are generated in the first and second ledgers. However, from t3 to t5, the corresponding second blocks C, D, and E on the second ledger are not generated. At t6, the second block F of the second ledger is generated normally. There is a span of four blocks between second blocks B and F, but the first blocks of the first ledger from t3 to t6 are all generated on time. Therefore, the block headers of the first blocks generated on the first ledger from t3 to t6 all store the hash value of second block B on the second ledger. Using the hash pointer, the first blocks generated on the first ledger from t3 to t6 all point to second block B generated on the second ledger at t2. Since, for the first blocks of the first ledger from t3 to t6, second block B is the latest second block of the second ledger.

[0037] In other embodiments of the present application, the spans of two adjacent first blocks linked before and after a block time and two adjacent second blocks linked before and after a block time are both greater than two, and the span of the first block is smaller than the span of the second block. The first blocks between the block spans of the second blocks are all stored with the second hash value of the previous second block, and the third hash value of the first block at the block time immediately before the next second block is stored in the next second block.

[0038] Specifically, see Figure 4 , Figure 4 This is a schematic diagram of the connection between the first block and the second block in one embodiment of the present application. In this figure, from time t4 to t5, the first block is not generated in the first ledger, and from time t3 to t7, the second block is not generated in the second ledger. The span between first block C and first block F in the first ledger is three blocks, and the span between second block B and second block H in the second ledger is six blocks. The span of the first block in the first ledger is greater than the span of the second block in the second ledger. In this embodiment, the composite node between the first and second ledgers obtains the hash value of the second block B of the second ledger and stores the hash value of the second block B of the second ledger in the block headers of first block C, first block F, first block G, and first block H. Hash pointers are used to make first block C, first block F, first block G, and first block H point to second block B. After second block H is generated, the latest block on the second ledger is second block H. The hash value of second block H is stored in the middle of the block header of first block I of the first ledger, and hash pointers are used to make first block I point to second block H. Similarly, if the span of the first block is greater than the span of the second block, and vice versa.

[0039] See also Figure 5 , Figure 5This is a flowchart of the blockchain operation method of the embodiment of the present application. The method can be applied to electronic devices with computing and other functions. It should be noted that if there is substantially the same result, the method of the present application is not based on Figure 5 The process sequence shown is limited.

[0040] In some possible implementations, the method may be implemented by a processor calling computer-readable instructions stored in a memory, such as Figure 5 As shown, the method may include the following steps:

[0041] Step S51: Obtain the first hash value of the previous first block in the first account book and the transaction information of the second account book.

[0042] In this embodiment, the second block obtains transaction information that has not been packaged in the second block at the previous block time within a preset time period, and obtains the first hash value of the latest first block on the first account book, and the hash value of the second block at the previous block time.

[0043] Step S52: Generate a second hash value corresponding to the transaction information and the first hash value using a hash function.

[0044] The specific process of generating a hash value using a hash function can be as follows: the message to be calculated is encoded in a certain format so that it can be recognized and processed by the computer. A specific hash algorithm is then used to calculate the encoded information to obtain a message digest of a fixed length, which is then converted into a readable string. Therefore, the unpackaged transaction information, the first hash value, and the hash value of the second block at the previous block time are input into the hash function. Based on this content, a unique hash value is generated. This hash value can be used to identify and verify the second block.

[0045] Step S53: Encapsulate the transaction information, the first hash value, and the second hash value to generate a second block of the second ledger.

[0046] In this embodiment, the unpackaged transaction information, the first hash value, the second hash value, and the hash value of the second block at the previous block time are encapsulated into the block header of the second block. Using a hash pointer, the second block is pointed to the latest first block on the first ledger through the first hash value, and the newly generated block at the current block time is pointed to the second block at the previous block time through the hash value of the second block at the previous block time.

[0047] The first hash value is stored in a block header of a second block between the block times of the previous first block and the next first block of the first account book and at the block time of the next first block. The previous first block and the next first block are blocks linked in sequence according to the block times and span at least two block times.

[0048] Specifically, the previous first block and the next first block are adjacent blocks, but there can be a block moment spanning at least two between the previous first block and the next first block (meaning at least one block is lost). That is, when an abnormal situation occurs in the blockchain, the first ledger fails to generate a new first block within the preset block moment, but the second ledger generates a new block normally at this time, then the newly generated second block will store the hash value of the previous first block until a new first block is generated. In this case, the new first block generated is the next first block, and the second block generated after the block moment of the next first block will store the hash value of the next first block. The same applies if there can be a block moment spanning at least two between the previous second block and the next second block.

[0049] More specifically, after the previous first block was generated, the scheduled first block was not generated at the first block time. That is, after the previous first block was generated, the first ledger did not generate a new first block at the first block time, which was the scheduled block time. This resulted in the loss of the first block, and the first block was generated at a block time after the first block time, namely, at a second block time after the first block time. Therefore, at least one block was lost between the previous first block and the next first block. Similarly, the second ledger may also lose at least one block between the previous second block and the next second block.

[0050] Therefore, in this embodiment, the first block of the first ledger and the second block of the second ledger are linked, and the first hash value of the previous first block is stored in the block header of the second block between the block times of the previous first block and the next first block, and at the block time of the next first block. This prevents the generated second block from losing transaction information, thereby achieving mutual backup between the first ledger and the second ledger.

[0051] In some other embodiments of the present application, a first hash value stored in the second block is obtained, and the first hash value is used to find the first block before the block time of the second block, so that the first block and the second block can be traced back.

[0052] In this embodiment, the hash value of the latest first block before the block time of the second block stored in the second block is used to establish a pointing or connection relationship between the second ledger at the block time and the latest first block before the block time.

[0053] In some other embodiments of the present application, a second hash value stored in a second block is obtained, and the second hash value is used to find the previous second block before the block time of the second block, so that the second block and the previous second block can be traced back. The process and principle of this embodiment are consistent with the above and will not be further elaborated here.

[0054] Combining all the above embodiments, it can be seen that the present application includes two hash pointers: one hash pointer links the blocks of the same ledger before and after the block time, and the other hash pointer links the blocks of different ledgers before and after the block time, thereby constructing a hinge structure of upper and lower ledgers (parent and child ledgers), and connecting the tree-level ledgers to achieve structuring, and the upper and lower ledger structure gives the ledgers a unique topological structure, achieving spatial and temporal sequencing. Secondly, this can improve the security of the blockchain. When the upper and lower ledgers are associated, it is useless to attack only the ledger maintained by a consensus group. It is also necessary to attack the adjacent ledgers. Therefore, the attacker needs to reverse all related ledgers to reverse a block, which increases the difficulty of blockchain attacks.

[0055] Those skilled in the art will understand that in the above-mentioned method of the specific implementation method, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0056] See also Figure 6 , Figure 6 is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Electronic device 60 includes a memory 61 and a processor 62 coupled to each other. Processor 62 is configured to execute program instructions stored in memory 61 to implement the steps of the aforementioned blockchain operation method embodiment or to implement a blockchain system. In a specific implementation scenario, electronic device 60 may include, but is not limited to, a microcomputer or a server, without limitation herein.

[0057] Specifically, processor 62 is used to control itself and memory 61 to implement the steps of the embodiment of the above-mentioned blockchain operation method, or to implement a blockchain system. Processor 62 can also be called a CPU (Central Processing Unit). Processor 62 may be an integrated circuit chip with signal processing capabilities. Processor 62 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. In addition, processor 62 can be implemented by an integrated circuit chip.

[0058] See also Figure 7 , Figure 7Schematic diagram of the structure of a non-volatile computer-readable storage medium according to an embodiment of the present application. Non-volatile computer-readable storage medium 70 is used to store a computer program 71. When executed by processor 62, computer program 71 is used to implement the steps of the embodiment of the blockchain operation method described above, or to implement a blockchain system.

[0059] The above description of the various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced with each other and will not be repeated herein for the sake of brevity.

[0060] In the several embodiments provided in this application, it should be understood that the disclosed methods and related devices can be implemented in other ways. For example, the above-described related device implementation methods are merely illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as 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 disconnection shown or discussed can be through some interfaces, indirect coupling or communication disconnection of devices or units, which can be electrical, mechanical or other forms.

[0061] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0062] 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 this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory) or magnetic disk or optical disk and other media that can store program code.

[0063] It is easy for a person skilled in the art to know that many modifications and variations can be made to the apparatus and method while maintaining the teaching content of the present application. Therefore, the above disclosure should be considered as limited only by the scope of the appended claims.

Claims

1. A blockchain system, characterized in that: include: A first ledger includes a plurality of first blocks, wherein the first blocks are linked to each other based on block times; A second ledger includes a plurality of second blocks, wherein the second blocks are linked to each other according to block times; The first block is linked to the second block, and the span between two adjacent first blocks linked before and after the block time is at least two block times, and / or the span between two adjacent second blocks linked before and after the block time is at least two block times. Each of the first blocks stores the second hash value of the latest second block at the block time before the block time in which the first block is located, and each of the second blocks stores the first hash value of the latest first block at the block time before the block time in which the second block is located; defining the first block of the two first blocks spanning at least two block times as a preceding first block, the other first block as a succeeding first block, the second block at the block time of the succeeding first block, and the second block at the block time between the preceding first block and the succeeding first block storing the first hash value of the preceding first block; and / or The first second block of the two second blocks with a span of at least two block moments is defined as a previous second block, the other second block is defined as a subsequent second block, and the first block at the block moment where the subsequent second block is located, and the first block at the block moment between the previous second block and the subsequent second block, store the second hash value of the previous second block.

2. The blockchain system according to claim 1, wherein: The spans of two adjacent first blocks linked before and after the block time and the spans of two adjacent second blocks linked before and after the block time are both greater than two, and the span of the first block is smaller than the span of the second block; The first blocks between the block spans of the second blocks all store the second hash value of the previous second block, and the subsequent second blocks store the third hash value of the first block at the previous block time of the subsequent second block.

3. The blockchain system according to claim 1, characterized in that: The first ledger is a parent ledger of the second ledger, and the second ledger is a child ledger of the first ledger. The child ledgers interact with each other through the parent ledger of the child ledgers.

4. A blockchain operation method, characterized in that: include: Obtaining a first hash value of a previous first block in the first ledger and transaction information from the second ledger; Using a hash function, generating a second hash value corresponding to the transaction information and the first hash value; Encapsulating the transaction information, the first hash value, and the second hash value to generate a second block of a second ledger, wherein there are multiple second blocks, and the second blocks are linked to each other according to the block time; The first hash value is stored in a block header of the second block at the block time of the subsequent first block between the block times of the previous first block and the next first block of the first account book, and the previous first block and the next first block are blocks linked in sequence according to block times and spanning at least two block times.

5. The method according to claim 4, characterized in that The first hash value stored in the second block is obtained, and the first hash value is used to find the first block before the block time of the second block, so that the first block and the second block can be traced back.

6. The method according to claim 4, characterized in that The second hash value stored in the second block is obtained, and the previous second block before the block time of the second block is found by using the second hash value, so that the second block and the previous second block are traced back.

7. The method according to claim 4, characterized in that After the previous first block is generated, a predetermined first block is not generated at a first block time, and the next first block is generated at a second block time after the first block time.

8. An electronic device, characterized in that: The present invention comprises a memory and a processor, wherein the memory and the processor are coupled to each other, and the processor is used to execute program instructions stored in the memory to implement the blockchain system according to any one of claims 1 to 3, or to implement the blockchain operation method according to any one of claims 4 to 7.

9. A computer storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by the processor, the blockchain system described in any one of claims 1 to 3 is implemented, or the blockchain operation method described in any one of claims 4 to 7 is implemented.

Citation Information

Patent Citations

  • Data backup method, apparatus, storage medium, and computing device

    CN109299336A

  • Cross-chain method and system for realizing multi-chain intercommunication

    CN113114759A