Blockchain accounting method, electronic device and storage medium
By determining the number of blocks and election ratio of parallel bookkeeping in the blockchain, multiple parallel related accounting nodes to be written into the block are selected to solve the problem of reduction in performance caused by the expansion of the blockchain, and realized it. Efficient blockchain notes.
Patent Information
- Application Number
- CN202010065356.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-20
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2040-01-20
AI Technical Summary
As the scale of blockchain expands, the number of accounting nodes increases, resulting in an increase in resources and time spent on each block to complete accounting, reducing the performance and transaction processing capabilities of the blockchain.
By determining the number of blocks of parallel bookkeeping and the election ratio, multiple parallel bookkeeping nodes are selected from multiple bookkeeping nodes. Calculate the book on the block.
A parallel bookkeeping of multiple blocks is achieved, and the associated bookkeeping node participating in each blockbound bookkeeping independently has improved the efficiency of blockchain notes.
Smart Images

Figure CN113139807B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain, and in particular to blockchain accounting methods, electronic devices and storage media. Background Art
[0002] Blockchain is a distributed shared ledger and database with the characteristics of decentralization, immutability, full traceability, traceability, collective maintenance, openness and transparency.
[0003] In the prior art, blockchain uses a global accounting method for data synchronization and storage, and all accounting nodes in the blockchain participate in the accounting of each block. As the scale of the blockchain expands, the number of accounting nodes increases, and the resources and time occupied by each block to complete the accounting also increase, which reduces the performance of the blockchain, that is, the transaction processing capacity. On the contrary, if the number of accounting nodes is too small, although the transaction processing capacity of the blockchain is improved, the reliability and credibility of the system will also decrease. Summary of the invention
[0004] The main technical problem solved by this application is to provide a blockchain accounting method, an electronic device and a storage medium, which can solve the problem in the prior art that the performance decreases as the scale of the blockchain increases.
[0005] To solve the above technical problems, the present application provides a blockchain accounting method, which includes: determining the number of blocks for parallel accounting and the election ratio; selecting multiple parallel associated accounting nodes of the blocks to be written from multiple accounting nodes according to the election ratio, and each associated accounting node of the block to be written is used to account for the block to be written; if it belongs to an associated accounting node, the corresponding block to be written is accounted for.
[0006] To solve the above technical problems, the present application provides an electronic device, which includes a processor and a memory coupled to the processor, and the memory stores program instructions for implementing the blockchain accounting method involved in the present application after the processor runs.
[0007] In order to solve the above technical problems, the present application provides a computer storage medium, which stores a computer program. When the computer program is executed, the blockchain accounting method involved in the present application is implemented.
[0008] The beneficial effects of the present invention are:
[0009] The present application discloses a blockchain accounting method, an electronic device, and a storage medium. The method includes: determining the number of blocks for parallel accounting and the election ratio; selecting multiple parallel associated accounting nodes of the blocks to be written from multiple accounting nodes according to the election ratio, and each associated accounting node of the block to be written is used to account for the block to be written; if it belongs to an associated accounting node, the corresponding block to be written is accounted. Through the above method, it is possible to achieve parallel accounting of multiple blocks, and the associated accounting nodes participating in the accounting of each block are independently selected, thereby improving the efficiency of blockchain accounting. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0011] Figure 1 This is a flowchart of the first embodiment of the blockchain accounting method of this application;
[0012] Figure 2 yes Figure 1 A schematic flow chart of an implementation method of step S200;
[0013] Figure 3 yes Figure 1 A flowchart of another implementation of step S200;
[0014] Figure 4 yes Figure 1 Schematic diagram of the process of selecting the associated accounting node in step S200;
[0015] Figure 5 yes Figure 1 A schematic flow chart of an implementation method of step S300;
[0016] Figure 6 This is a flow chart of the second embodiment of the blockchain accounting method of this application;
[0017] Figure 7 It is a schematic diagram of an example of associated accounting nodes of multiple blocks processed in parallel in the second embodiment of the blockchain accounting method of the present application;
[0018] Figure 8 It is a structural schematic diagram of an electronic device provided by the present application;
[0019] Fig. 9 It is a structural diagram of an embodiment of a computer storage medium provided by the present application. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0021] The terms "first", "second", and "third" in this application are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first", "second", and "third" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0022] Reference to "embodiment" herein means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. It should be noted that for the following method embodiments, if there are substantially the same results, the method of the present application is not limited to the illustrated process sequence.
[0023] See also Figure 1 , Figure 1 This is a flowchart of the first implementation of the blockchain accounting method of this application. Figure 1 As shown, the blockchain accounting method provided in this embodiment may include the following steps:
[0024] S100: Determine the number of blocks and election ratio for parallel accounting.
[0025] The execution subject of this embodiment can be a bookkeeping node in the blockchain. The blockchain bookkeeping method provided in this embodiment can be applied to each bookkeeping node in the blockchain. For ease of description, the bookkeeping node is referred to as a node in this embodiment, and the execution subject of this embodiment is referred to as this node.
[0026] Each accounting node in the blockchain has the same global device inventory table, which includes information about all accounting nodes in the blockchain. The global device inventory table can be updated in real time and kept synchronized between accounting nodes.
[0027] The number of blocks M and the election ratio that participate in bookkeeping at the same time can be determined based on the number of global nodes and the number of members required to participate in each block. The election ratio indicates how many nodes are selected from all nodes to participate in the bookkeeping of a single block.
[0028] To ensure the reliability and credibility of the blockchain, the number of nodes participating in the accounting of a single blockchain cannot be too small. For this purpose, a corresponding table between the blockchain scale (i.e., the number of nodes), the number of parallel blocks, and the election ratio can be designed. The number of parallel blocks in the table is positively correlated with the blockchain scale, and the election ratio is negatively correlated with the number of parallel blocks. The table can be queried based on the number of all nodes in the global device list table to obtain the number of parallel blocks M and the election ratio. An example of the table is shown in the following table.
[0029]
[0030] Table 1
[0031] The above Table 1 is only an example. The number of blocks participating in parallel accounting and the method of selecting nodes participating in accounting for each block are not limited to the cases involved in Table 1.
[0032] S200: Select multiple parallel associated accounting nodes of the block to be written from multiple accounting nodes according to the election ratio, and each associated accounting node of the block to be written is used to account for the block to be written.
[0033] The block to be written refers to a block that has been created or is about to be created, waiting to be written into the blockchain business data such as transaction records and smart contracts. For the convenience of description, the block to be written may be referred to as a block below. Each block to be written has a life cycle. After each block to be written is created, the associated accounting node can record it during the life cycle. In order to ensure that the blocks to be written can be chained in sequence, the life cycle of each block to be written can be the same, and they are created in order from small to large in sequence. The associated accounting nodes of different blocks to be written that are recorded in parallel can overlap, that is, there is a certain accounting node that participates in the accounting of at least two blocks at the same time, or they can be different.
[0034] A preset algorithm can be used to select an associated accounting node for each of the multiple parallel blocks to be written from multiple accounting nodes according to the election ratio. Since the preset algorithm and its parameters are known to all accounting nodes, combined with the global device list table, each accounting node can calculate all the associated accounting nodes for each block to be written, that is, select the associated accounting node for each block to be written. After determining the associated accounting node of a block to be written, the node can determine whether it needs to participate in the accounting of the block to be written based on whether it is among the selected associated accounting nodes.
[0035] For step S200, multiple parallel associated accounting nodes of the block to be written are selected from multiple accounting nodes according to the election ratio, please refer to Figure 2 , Figure 2 for Figure 1 A flow chart of an implementation method of step S200 in the embodiment specifically includes:
[0036] S210: After the accounting of the block to be written is completed, the associated accounting node of the next round of blocks to be written is selected from multiple accounting nodes according to the election ratio. The next round of blocks to be written is after the block to be written, and the difference in sequence number between the next round of blocks to be written and the next round of blocks to be written is the number of blocks to be accounted in parallel.
[0037] In this implementation, the processing (accounting and chaining) of each parallel block is not affected by other blocks, and the processing of parallel blocks is similar to multi-process.
[0038] S211: Pre-generate the next round of blocks to be written.
[0039] There is no restriction on the execution order between this step and S210.
[0040] It can be seen that after the processing of the block with the earliest serial number among the multiple parallel blocks being processed is completed, there is no need to consider other blocks being processed and the corresponding next round of blocks to be written and the selection of associated accounting nodes are automatically created to form a rolling accounting of the blockchain, ensuring that there are M blocks in the blockchain being accounted in parallel at the same time.
[0041] Assume that the sequence number of the block to be written that has just completed accounting is N, the number of parallel blocks is M, the sequence numbers of other parallel blocks are N+1 to N+M-1, and the sequence number of the next round of blocks to be written is N+M. After completing the writing of block N, pre-generate block N+M and select an associated accounting node for it.
[0042] Since each block in the blockchain has a sequence restriction, the sequence number of the block that completes accounting after block N is N+1, and the sequence number of the corresponding next round of written blocks is N+M+1, and so on.
[0043] For step S200, multiple parallel associated accounting nodes of the block to be written are selected from multiple accounting nodes according to the election ratio, please refer to Figure 3 , Figure 3 for Figure 1 A flow chart of another implementation of step S200 in the embodiment specifically includes:
[0044] S220: Select associated accounting nodes of the blocks to be written in the same batch, whose total number is the number of blocks in parallel accounting, from multiple accounting nodes according to the election ratio.
[0045] The total number of blocks to be written in the same batch is M.
[0046] S221: Generate blocks to be written in the same batch in sequence according to a preset time interval.
[0047] In this implementation, the blocks can be divided into multiple groups, and the same group includes M blocks to be processed in parallel. After one group of blocks is processed, the processing of the next group of blocks begins. The order of the generation time of each block in the same group is consistent with the order of the sequence number, with the smaller sequence number being the first, and the generation time interval between two adjacent blocks is a preset time interval.
[0048] For example, taking the Ath parallel block group as an example, the block numbers in the Ath parallel block group are A×M, A×M+1, A×M+2, A×M+3.....(A+1)×M-1, and the block creation time interval is 10 seconds. In the Ath parallel block group, block A×M is generated at time t, block A×M+1 is generated at time t+10s, block A×M+2 is generated at time t+20s, block A×M+3 is generated at time t+30s, and so on.
[0049] Regarding the selection of associated accounting nodes, a preset algorithm can be used to select the associated accounting nodes of each block to be written from multiple accounting nodes using at least the sequence number of each block to be written and the election ratio.
[0050] See also Figure 4 , Figure 4 yes Figure 1 The flowchart of the associated accounting node selection in step S200 is shown in FIG. 1 . The selection of the associated accounting node may specifically include:
[0051] S231: Calculate the hash value of each accounting node using at least the serial number of each block to be written and the identifier of each accounting node.
[0052] For a certain accounting node, a hash calculation can be performed on the combination of the identification of the accounting node and the promiscuous number to obtain the hash value of the accounting node. The combination method may include splicing, insertion, calculation, etc., which are not limited here. The promiscuous number includes the serial number of the block to be written. For example, the promiscuous number can be the serial number of the block to be written itself, or the combination of the serial number of the block to be written itself and the hash value of the previous round of blocks of the block to be written. The previous round of blocks of the block to be written is before the current block to be written, and the serial number difference between the previous round of blocks and the current block to be written is the number of blocks in parallel accounting.
[0053] S232: Extract and / or count the hash value of each accounting node to obtain a reference value of each accounting node. The reference value has multiple possible values, and each value has a corresponding probability of value.
[0054] The statistics may be a sum, and the object of statistics may be all bits of the hash value or part of the bits extracted.
[0055] S233: Determine at least one target value according to the election ratio, and the sum of the probability of all target values is equal to the election ratio or the error between the target values and the election ratio is within a preset range.
[0056] The probability of a target value is the probability that the reference value is the target value.
[0057] S234: Select a bookkeeping node whose reference value is the target value as the associated bookkeeping node of the block to be written.
[0058] Hash, also known as hash or hashing, is the process of transforming an input of any length into an output of a fixed length through a hash algorithm. The output is the hash value. When the number of inputs is large enough, it can be assumed that the probability of different values for each bit in all the HASH outputs is the same. HASH values are generally hexadecimal digit strings, which means that the value range of each bit in the digit string is 0-f (equal to 15 in decimal), and the probability of each value in the range is 1 / 16.
[0059] Assuming the election ratio is 25%, the reference value is a certain digit extracted from the HASH value (such as the first digit), then the target value can be 4 different values from 0-f, such as 1-4. If the election ratio is 75%, the reference value is a certain digit extracted from the HASH value (such as the first digit), then the target value can be 12 different values from 0-f, such as 1-C. The target value can be continuous or discontinuous, can start from 0, or specify the start value and end value. It only needs to meet the election ratio requirements.
[0060] In the example given above, the reference value is extracted, and the various values of the reference value are unique. The probabilities of different values are the same. The product of the election ratio and the total number of all possible values of the reference value can be directly calculated as the number of target values without considering the probability problem. If the reference value is obtained by summing at least two bits in the HASH value, since the values of different bits may be the same, the probabilities of reference values with different values may be different. When selecting the target value, it is necessary to consider the specific value probability instead of simply considering the quantity.
[0061] This preset algorithm is based on the assumption that "when the number of inputs is large enough, the probability of different values of each bit in all HASH outputs can be considered the same." In actual applications, the number of selected (extracted) accounting nodes may be different from the theoretical value.
[0062] Using this preset algorithm, there is no need for secondary information synchronization, and the same results can be extracted using the same algorithm and parameters.
[0063] S300: If it is an associated accounting node, the corresponding block to be written is accounted for.
[0064] If this node does not belong to the associated accounting node, it will not record the corresponding block to be written, and the associated accounting node of the block to be written will not accept the accounting of this node.
[0065] Please continue reading Figure 5 , Figure 5 This application Figure 1 The flowchart of an implementation method of step S300 is as follows:
[0066] S310: Writing business data to the block to be written during the life cycle of the block to be written.
[0067] Business data refers to transaction data submitted in the blockchain written by the associated accounting node during its life cycle, including transaction records, smart contracts, etc. The business data can be written into the block to be written after verifying / reaching consensus on the received transaction application, or the business data written by other associated accounting nodes can be synchronized.
[0068] S320: After the life cycle of the block to be written ends, stop writing business data to the block to be written, set the block to be written to a non-writable state after writing the management data, and the management data includes the hash value of the previous block of the block to be written.
[0069] The management data is used to manage the block, for example, the Merkle tree value of the block for subsequent verification, and the HASH value of the previous block that links the block to the previous block.
[0070] S330: After the life cycle of the block to be written ends, the hash value of the block to be written is sent to at least one associated accounting node of the next block after the block to be written.
[0071] The execution order of S320 and S330 is only for illustration, and the order can actually be switched or the two can be executed simultaneously.
[0072] For example, after the life cycle of block N to be written ends, stop writing business data, write the Merkle tree value of block N and the HASH value of block N-1, and send the HASH value of block N to at least one associated accounting node of block N+1.
[0073] Through the implementation of this embodiment, the number of blocks for parallel accounting and the election ratio are determined; multiple parallel associated accounting nodes of the blocks to be written are selected from multiple accounting nodes according to the election ratio, and each associated accounting node of the block to be written is used to account for the block to be written; if it belongs to an associated accounting node, the corresponding block to be written is accounted. Through the above method, it is possible to achieve parallel accounting of multiple blocks, and the associated accounting nodes participating in the accounting of each block are independently selected, thereby improving the efficiency of blockchain accounting.
[0074] The following is an example of a specific process of a blockchain accounting method with reference to the accompanying drawings.
[0075] Please continue reading Figure 6 , Figure 6 This is a flow chart of the second embodiment of the blockchain accounting method of the present application. This embodiment is a further extension of the first embodiment of the blockchain accounting method of the present application, and the same parts are not repeated. This embodiment includes:
[0076] S401: The accounting node obtains a global device list table.
[0077] Accounting nodes can be servers, routers, smart boxes, NAS, etc. The global device list table contains: device ID information, IP information, whether to participate in accounting, etc. When the devices involved in the global blockchain obtain the device list, they can clearly know their device ID information, IP information, and whether each device participates in accounting (i.e., whether it is an accounting node).
[0078] S402: The transaction generating device initiates an accounting application for the target block.
[0079] When a transaction is generated, the transaction generating device will send a bookkeeping application for the corresponding target block to the transaction application node according to the information recorded in the device list table. At this time, the life of the target block has not yet ended. There is no restriction on the matching method between the transaction and the target block.
[0080] For example, when a transaction is generated, and the device generating the transaction is X, and the target block determined according to the device list is block N, the transaction generating device X sends an accounting application for block N to the transaction application node.
[0081] S403: The transaction application node selects the associated accounting node of the target block from multiple accounting nodes according to the sequence number of the target block and the election ratio.
[0082] S404: The transaction application node synchronizes the accounting application information to at least one associated accounting node of the target block.
[0083] The accounting application information is obtained based on the accounting application from the transaction generating device, and includes information necessary to complete the transaction in which the transaction generating device participates.
[0084] An example of a linked ledger node for multiple blocks processed in parallel is Figure 7 As shown in the figure, it can be seen that the associated accounting nodes of block N are node 1, node 4, node 6 and node n, and the accounting application information is sent to at least one of node 1, node 4, node 6 and node n.
[0085] S405: The accounting node that receives the accounting application information determines whether it should participate in the accounting of the target block.
[0086] The accounting node that receives the accounting application information can use the global device list table to calculate the associated accounting node of the target block. If it is an associated accounting node, it will participate in the accounting of the target block, otherwise it will not participate.
[0087] The execution order between S405 and steps S401 - S404 is only for illustration and there is no actual limitation.
[0088] S406: After the verification and consensus of the accounting application information are passed, the transaction corresponding to the accounting application information is written into the target block.
[0089] S407: Synchronize the update of the target block to other associated accounting nodes.
[0090] S408: After the target block life cycle count ends, each associated accounting node stops writing business data, fills in the Merkle tree value of the current block and the HASH value of the previous block, and sends the HASH value of the target block to at least one associated accounting node of the next block.
[0091] S409: The accounting node selects the associated accounting node of the next round of blocks to be written into the target block.
[0092] If the accounting node itself is an associated accounting node, S410 is executed; otherwise, it is not executed.
[0093] S410: Pre-generate the next round of blocks to be written into the target block.
[0094] See also Figure 8 , Figure 8 This is a schematic diagram of the structure of an electronic device provided in this application. Figure 8As shown, the electronic device 800 includes a processor 801 and a memory 802 coupled to the processor 801, wherein the memory 802 stores program instructions for implementing the method of any of the above embodiments; the processor 801 is used to execute the program instructions stored in the memory 802 to implement the method of any of the above embodiments. The processor 801 may also be referred to as a CPU (Central Processing Unit). The processor 801 may be an integrated circuit chip with signal processing capabilities. The processor 801 may 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 gates or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0095] See also Fig. 9 , Fig. 9 900 is a schematic diagram of the structure of an embodiment of a computer storage medium provided by the present application. The present application implements all or part of the processes in the above-mentioned embodiment method, and can also instruct the relevant hardware to complete it through the computer storage medium 900. Computer program instructions can be stored in a computer storage medium 900, and the computer program can implement the method or steps of any of the above-mentioned embodiments when it is executed. Among them, the computer program instructions include computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer storage medium 900 may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, point carrier signal, telecommunication signal and software distribution medium, etc.
[0096] The above are only implementation methods of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A blockchain accounting method, characterized in that: include: Determine the number of blocks and the election ratio for parallel accounting, where the election ratio is negatively correlated with the number of blocks for parallel accounting; Selecting multiple parallel associated accounting nodes of the block to be written from the multiple accounting nodes according to the election ratio, each associated accounting node of the block to be written is used to account for the block to be written; If it belongs to the associated accounting node, the corresponding block to be written is accounted for.
2. The method according to claim 1, characterized in that: The step of selecting a plurality of parallel associated accounting nodes of the to-be-written blocks from the plurality of accounting nodes according to the election ratio comprises: After the accounting of the block to be written is completed, the associated accounting node of the next round of blocks to be written is selected from the multiple accounting nodes according to the election ratio. The next round of blocks to be written is after the block to be written, and the difference in sequence number between the next round of blocks to be written and the next round of blocks to be written is the number of blocks in the parallel accounting.
3. The method according to claim 2, characterized in that Further including: Pregenerate the next round of blocks to be written.
4. The method according to claim 1, characterized in that: The step of selecting a plurality of parallel associated accounting nodes of the to-be-written blocks from the plurality of accounting nodes according to the election ratio comprises: According to the election ratio, the associated accounting nodes of the blocks to be written in the same batch, whose total number is the number of blocks in the parallel accounting, are selected from the multiple accounting nodes.
5. The method according to claim 4, characterized in that Further including: The blocks to be written in the same batch are generated sequentially according to a preset time interval.
6. The method according to claim 1, characterized in that The step of selecting a plurality of parallel associated accounting nodes of the to-be-written blocks from the plurality of accounting nodes according to the election ratio comprises: A preset algorithm is adopted to select the associated accounting node of each block to be written from the multiple accounting nodes using at least the serial number of each block to be written and the election ratio.
7. The method according to claim 6, characterized in that The step of using a preset algorithm to select an associated accounting node of each block to be written from the plurality of accounting nodes by at least using the sequence number of each block to be written and the election ratio comprises: A preset algorithm is adopted to select the associated accounting node of each block to be written from the multiple accounting nodes using the serial number of each block to be written, the hash value of the previous round of blocks of the block to be written, and the election ratio. The previous round of blocks of the block to be written is before the current block to be written, and the serial number difference between the previous round of blocks and the current block to be written is the number of blocks in parallel accounting.
8. The method according to claim 6, characterized in that The step of using a preset algorithm to select an associated accounting node of each block to be written from the plurality of accounting nodes by at least using the sequence number of each block to be written and the election ratio comprises: Calculate the hash value of each of the accounting nodes using at least the serial number of each of the blocks to be written and the identifier of each of the accounting nodes; Extracting and / or counting the hash value of each of the accounting nodes to obtain a reference value of each of the accounting nodes, wherein the reference value has multiple values, and each value has a corresponding probability of value; Determine at least one target value according to the election ratio, the sum of the value probabilities of all the target values being equal to the election ratio or the error between the sum and the election ratio being within a preset range; The accounting node whose reference value is the target value is selected as the associated accounting node of the block to be written.
9. The method according to claim 1, characterized in that: The bookkeeping of the corresponding block to be written comprises: Writing business data to the block to be written during the life cycle of the block to be written; After the life cycle of the block to be written ends, stop writing business data to the block to be written, and set the block to be written to an unwritable state after writing management data. The management data includes a hash value of a previous block of the block to be written.
10. The method according to claim 9, characterized in that Further including: After the life span of the block to be written ends, the hash value of the block to be written is sent to at least one associated accounting node of the next block after the block to be written.
11. An electronic device, characterized in that: The electronic device comprises a processor and a memory coupled to the processor, wherein: The memory stores program instructions for implementing the blockchain accounting method according to any one of claims 1 to 10; The processor is used to execute the program instructions stored in the memory to implement blockchain accounting.
12. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program is executed, the steps of the method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Data processing method and apparatus
CN106934611A
A DAG-based decentralization method and terminal
CN109344623A
A fast consensus accounting method and a system thereof based on a block chain alliance chain
CN109544310A