Data processing method based on block chain, related device and medium
By using intermediate logs in the blockchain system to temporarily store target block information and judge the system's busyness based on the writing speed of the blockchain information storage space, the problem of excessive data processing pressure when business is busy is solved, and data processing efficiency and system performance are improved.
Patent Information
- Application Number
- CN202311163105.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-08
- Publication Date
- 2025-03-11
AI Technical Summary
In blockchain systems, nodes need to process a large amount of data when business is busy, resulting in excessive pressure on data processing and low efficiency.
By obtaining the target block information to be written into the blockchain information storage space, writing it to the intermediate log, and writing the block status information to the blockchain information storage space after writing. According to the writing speed of the blockchain information storage space, the system is judged at the busyness level, and only write transactions in the intermediate log to the blockchain information storage space when specific conditions are met.
It effectively reduces the pressure of data writing when business is busy, improves data processing efficiency, and improves the throughput and response time of the blockchain system.
Smart Images

Figure CN119597207A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of blockchain technology, and in particular to a blockchain-based data processing method, related devices and media. Background Art
[0002] Currently, in the blockchain system, when a new transaction is packaged into a block, the node often immediately writes the block information of the block into the storage space of the blockchain system. This method often requires the blockchain system to process a large amount of data at the same time when the business is busy, which easily causes excessive data processing pressure on the blockchain system and leads to low data processing efficiency. Summary of the invention
[0003] The disclosed embodiments provide a blockchain-based data processing method, related devices, and media, which can effectively reduce the data processing pressure of the blockchain and improve data processing efficiency.
[0004] According to one aspect of the present disclosure, a data processing method based on blockchain is provided, the method comprising:
[0005] Obtain target block information to be written into the blockchain information storage space, wherein the target block information includes each transaction included in the target block and block status information of the target block;
[0006] Writing the target block information into an intermediate log;
[0007] After determining that the target block information has been written into the intermediate log, writing the block status information into the blockchain information storage space;
[0008] The writing speed of the blockchain information storage space is detected, and if the writing speed satisfies a first condition, each of the transactions in the intermediate log is written into the blockchain information storage space until the writing speed of the blockchain information storage space satisfies the first condition.
[0009] According to one aspect of the present disclosure, a data processing device based on blockchain is provided, the device comprising:
[0010] An acquisition unit, configured to acquire target block information to be written into the blockchain information storage space, wherein the target block information includes each transaction included in the target block and block status information of the target block;
[0011] A first writing unit, used for writing the target block information into an intermediate log;
[0012] A second writing unit, configured to write the block status information into the blockchain information storage space after determining that the target block information has been written into the intermediate log;
[0013] The third writing unit is used to detect the writing speed of the blockchain information storage space, and if the writing speed meets the first condition, write each of the transactions in the intermediate log into the blockchain information storage space.
[0014] Optionally, the data processing device further includes a confirmation unit, wherein the confirmation unit is configured to:
[0015] Determining that each of the transactions has been written into the blockchain information storage space;
[0016] The target block information is deleted from the intermediate log.
[0017] Optionally, the data processing device further includes a recovery unit, and the recovery unit is used to:
[0018] If a blockchain node executing the data processing method fails before each of the transactions is written into the blockchain information storage space, the location of the target block information in the intermediate log is recorded with a first pointer;
[0019] If the blockchain node fails and recovers, the target block information in the intermediate log is located based on the first pointer, and each transaction in the target block information is written into the blockchain information storage space.
[0020] Optionally, the blockchain information storage space includes a blockchain and a blockchain auxiliary storage space, and the block status information includes a first transaction summary value of each of the transactions, a transaction receipt of each of the transactions, a block header of the target block, and an associated resource pool status after the transaction is executed;
[0021] The second writing unit is used for:
[0022] Writing the block header and the first transaction summary value into the target block to record them into the blockchain, and writing the transaction receipt and the associated resource pool status into the blockchain auxiliary storage space;
[0023] The third writing unit is used for:
[0024] Writing each of the transactions in the intermediate log into the target block on the blockchain.
[0025] Optionally, the data processing device further includes a status updating unit, and the status updating unit is used to:
[0026] In response to a resource processing transaction request received after each of the transactions included in the target block, the resource processing transaction request is directed to the associated resource pool;
[0027] Based on the resource processing transaction request, resources in the associated resource pool are processed, and the state of the associated resource pool is updated.
[0028] Optionally, the data processing device further includes a transaction chaining unit, and the transaction chaining unit is used to:
[0029] Generate a first mapping table, wherein the first mapping table indicates a mapping relationship between the first transaction summary value and the target block;
[0030] In response to a transaction on-chain request received after each of the transactions included in the target block, calculating a second transaction digest value of the transaction to be on-chained in the transaction on-chain request;
[0031] If the second transaction digest value is the same as one of the first transaction digest values in the first mapping table, the transaction on-chain request is rejected.
[0032] Optionally, the first mapping table is generated in the following manner:
[0033] In the blockchain information storage space, determining a mapping relationship between each block and a summary value of each transaction in the block;
[0034] Based on the multiple mapping relationships in the blockchain information storage space, the first mapping table is constructed.
[0035] Optionally, the third writing unit specifically includes:
[0036] A first indicator acquisition unit, used to obtain a write performance indicator of the blockchain information storage space;
[0037] A writing unit, configured to write each of the transactions in the intermediate log into the blockchain information storage space if it is determined that the writing performance indicator meets the second condition;
[0038] The delayed writing unit is used to delay writing each of the transactions in the intermediate log into the blockchain information storage space if it is determined that the writing performance indicator does not meet the second condition.
[0039] Optionally, the target block information is a plurality of target block information;
[0040] The third writing unit specifically includes:
[0041] A second indicator acquisition unit, used to obtain a write performance indicator of the blockchain information storage space;
[0042] a ratio determination unit, configured to determine a first ratio based on the write performance indicator;
[0043] a number determining unit, configured to determine a first number based on the number of the target block information and the first ratio;
[0044] A selection unit, configured to select a first number of target block information from a plurality of target block information to obtain delayed target block information;
[0045] An information writing unit is used to write each of the transactions of the delayed target block information in the intermediate log into the blockchain information storage space if the writing speed meets the first condition.
[0046] Optionally, the information writing unit is specifically used to:
[0047] Obtaining the real-time level of the information of the plurality of target blocks;
[0048] The plurality of target block information are sorted according to the real-time level, and the target block information of the last first number in the sorting is selected.
[0049] Optionally, the block status information includes a first transaction summary value of each of the transactions, a transaction receipt of each of the transactions, a block header of the target block, and a status of an associated resource pool after the transaction is executed;
[0050] The intermediate log includes a first key-value pair for indicating each of the transactions, a second key-value pair for indicating a first transaction summary value of each of the transactions, a third key-value pair for indicating a transaction receipt of each of the transactions, a fourth key-value pair for indicating the block header, and a fifth key-value pair for indicating a state of an associated resource pool after the transaction is executed;
[0051] The first writing unit is used for:
[0052] Obtaining the block height and block summary of the target block;
[0053] Generate the first key-value pair by using the block height, the block summary, and each of the transactions as keywords and the summary result of each of the transactions as a value;
[0054] Generate the second key-value pair by using the block height, the block summary, and the first transaction summary value of each transaction as keywords, and using the summary result of the first transaction summary value of each transaction as a value;
[0055] Generate the third key-value pair by using the block height, the block summary, and the transaction receipt of each transaction as keywords and the summary result of the transaction receipt of each transaction as a value;
[0056] Generate the fourth key-value pair using the block height, the block summary, and the block header as keywords and the summary result of the block header as a value;
[0057] The fifth key-value pair is generated by taking the block height, the block summary, and the associated resource pool state after the transaction is executed as keywords, and taking the summary result of the associated resource pool state after the transaction is executed as a value.
[0058] According to one aspect of the present disclosure, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the blockchain-based data processing method as described above is implemented.
[0059] According to one aspect of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the blockchain-based data processing method as described above is implemented.
[0060] According to one aspect of the present disclosure, a computer program product is provided, which includes a computer program, and the computer program is read and executed by a processor of a computer device, so that the computer device performs the blockchain-based data processing method as described above.
[0061] In the disclosed embodiment, the blockchain system first obtains the target block information to be written into the blockchain information storage space. Further, the blockchain system first writes the target block information into the intermediate log, so that the block state information and each transaction of the target block are saved in the intermediate log, and the target block information is stored through the intermediate log. After determining that the target block information has been written into the intermediate log, when the system business is busy, the blockchain state information is first written into the blockchain information storage space, and each transaction is temporarily not written into the blockchain information storage space, which can effectively reduce the data writing pressure when the business is busy and improve the transaction processing speed. In addition, the present disclosure also judges the busyness of the system according to the change of the writing speed of the blockchain information storage space. When the writing speed meets the first condition, it is determined that the system is in a relatively idle state. At this time, each transaction stored in the intermediate log is written into the blockchain information storage space, which can improve the data writing efficiency, thereby improving the throughput and response time of the entire blockchain system.
[0062] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or be understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.
[0064] Figure 1 is a system architecture diagram of a system for applying a blockchain-based data processing method according to an embodiment of the present disclosure;
[0065] Figure 2 A schematic diagram showing a blockchain-based data processing method according to an embodiment of the present disclosure applied to a transaction on-chain scenario during a busy financial business period;
[0066] Figure 3 is a flowchart of a blockchain-based data processing method according to an embodiment of the present disclosure;
[0067] Figure 4 yes Figure 3 Step 320 is a flowchart of writing target block information into the intermediate log;
[0068] Figure 5 yes Figure 3 Schematic diagram of the implementation process of writing the target block information into the intermediate log in step 320;
[0069] Figure 6 is a flow chart of updating the status of an associated resource pool according to an embodiment of the present disclosure;
[0070] Figure 7 is a flowchart of verifying a transaction on-chain request according to an embodiment of the present disclosure;
[0071] Figure 8 is a schematic diagram of a first mapping table according to an embodiment of the present disclosure;
[0072] Fig. 9 is a flowchart of a blockchain-based data processing method according to another embodiment of the present disclosure;
[0073] Fig.10 is a flow chart of data processing when a node fails according to an embodiment of the present disclosure;
[0074] Fig.11is a schematic diagram of an implementation process of data processing when a node fails according to an embodiment of the present disclosure;
[0075] Fig.12 yes Figure 3 Flowchart of step 340 delaying writing each transaction into the blockchain information storage space;
[0076] Fig.13 yes Fig.12 Flowchart of determining, in step 1220, that the write performance indicator meets the second condition;
[0077] Fig.14 yes Figure 3 Another flow chart of delaying writing each transaction into the blockchain information storage space in step 340;
[0078] Fig.15 yes Fig.14 Flowchart of step 1440 selecting a first number of target block information from a plurality of target block information;
[0079] Fig.16 yes Figure 3 Another flow chart of delaying writing each transaction into the blockchain information storage space in step 340;
[0080] Fig.17 is a flow chart for determining a first duration according to an embodiment of the present disclosure;
[0081] Fig.18 yes Fig.17 Step 1730 is a flowchart for determining a first duration based on the write performance indicator and the target processing accuracy;
[0082] Fig.19 yes Fig.18 Step 1810 is a flowchart of determining a third score based on the write performance indicator;
[0083] Fig. 20 is a schematic diagram of implementation details of a blockchain-based data processing method according to an embodiment of the present disclosure;
[0084] Fig.21 is a schematic diagram of implementation details of a blockchain-based data processing method according to another embodiment of the present disclosure;
[0085] Fig. 22 is a multi-terminal interaction diagram of a detailed embodiment of the present disclosure;
[0086] Fig.23 is a module diagram of a blockchain-based data processing device according to an embodiment of the present disclosure;
[0087] Fig.24is a terminal structure diagram of a blockchain-based data processing method according to an embodiment of the present disclosure;
[0088] Fig.25 It is a server structure diagram of a blockchain-based data processing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0089] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0090] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:
[0091] Artificial intelligence: It is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain target results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0092] Blockchain: Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of transaction information, which is used to verify the validity of its information (anti-counterfeiting) and associate with the previous block.
[0093] Currently, in the blockchain system, when a new transaction is packaged into a block, the node often immediately writes the block information of the block into the storage space of the blockchain system. This method often requires the blockchain system to process a large amount of data at the same time when the business is busy, which easily causes excessive data processing pressure on the blockchain system and leads to low data processing efficiency.
[0094] System architecture and scenario description of the application of the embodiments of the present disclosure
[0095] Figure 1 It is a system architecture diagram of the data processing method based on blockchain according to the embodiment of the present disclosure. It includes an object terminal 140, the Internet 130, a gateway 120, a blockchain system server 110, etc.
[0096] The object terminal 140 includes various forms such as desktop computers, laptops, PDAs (personal digital assistants), mobile phones, vehicle-mounted terminals, home theater terminals, and dedicated terminals. In addition, it can be a single device or a collection of multiple devices. The object terminal 140 can communicate with the Internet 130 in a wired or wireless manner to exchange data. Among them, the object terminal 140 includes a transaction processing system, which is used to chain the transaction data input by the object so that the transaction data is stored on the blockchain.
[0097] The blockchain system server 110 refers to a computer system that can provide certain services to the object terminal 140. Compared with the ordinary object terminal 140, the blockchain system server 110 has higher requirements in terms of stability, security, performance, etc. The blockchain system server 110 can be a high-performance computer in the network platform, a cluster of multiple high-performance computers, a part of a high-performance computer (such as a virtual machine), a combination of parts of multiple high-performance computers (such as virtual machines), etc. Among them, the blockchain system server 110 is used to receive transaction data sent by the object terminal 140 and store the transaction data in the block of the blockchain.
[0098] The gateway 120 is also called an internetwork connector or a protocol converter. The gateway realizes network interconnection at the transport layer and is a computer system or device that acts as a converter. The gateway is a translator between two systems that use different communication protocols, data formats or languages, or even completely different architectures. At the same time, the gateway can also provide filtering and security functions. The message sent by the object terminal 140 to the blockchain system server 110 must be sent to the corresponding blockchain system server 110 through the gateway 120. The message sent by the blockchain system server 110 to the object terminal 140 must also be sent to the corresponding object terminal 140 through the gateway 120.
[0099] The embodiments of the present disclosure can be applied in various scenarios, such as Figure 2 The transaction chain scenario during the busy period of financial business shown in the figure.
[0100] like Figure 2 As shown, during the busy business phase, when object A wants to link a transaction M to the blockchain, object A sends a transaction link request to the blockchain system server 110 through the transaction processing system of the object terminal 140. Further, the blockchain system server 110 will determine the relevant information of the transaction M to be linked based on the received transaction link request. Then, all the relevant information of the transaction M to be linked is written into a log R, and the relevant information of the transaction to be linked is temporarily saved in the log R. Further, after all the relevant information of the transaction M to be linked is written into the log R, the blockchain system server 110 writes a part of the relevant information of the transaction M to be linked with higher real-time data to the storage space such as the blockchain until the business is no longer busy, extracts part of the relevant information of the transaction M to be linked stored in the log R that is not written into the storage space such as the blockchain, and writes part of the data extracted from the log R to the storage space such as the blockchain.
[0101] General description of the disclosed embodiments
[0102] According to one embodiment of the present disclosure, a blockchain-based data processing method is provided.
[0103] This blockchain-based data processing method is generally used in busy business scenarios in alliance chain platforms, finance or supply chain, or enterprise-level blockchain scenarios, such as Figure 2 The transaction on-chain scenario during the busy phase of financial business is shown. The disclosed embodiment provides a solution for delaying the writing of each transaction into the blockchain information storage space, which can effectively reduce the transaction processing pressure of the system during busy business, thereby improving transaction processing efficiency.
[0104] like Figure 3 As shown, a blockchain-based data processing method according to an embodiment of the present disclosure may include:
[0105] Step 310: Obtain target block information to be written into the blockchain information storage space;
[0106] Step 320, write the target block information into the intermediate log;
[0107] Step 330: After determining that the target block information has been written into the intermediate log, write the block status information into the blockchain information storage space;
[0108] Step 340: Detect the writing speed of the blockchain information storage space. If the writing speed meets the first condition, write each transaction in the intermediate log into the blockchain information storage space.
[0109] Steps 310 - 340 are described in detail below.
[0110] In step 310, the target block information to be written into the blockchain information storage space is obtained.
[0111] Blockchain information storage space refers to the space used by the blockchain system to record and store relevant data of each transaction. The blockchain information storage space contains the blockchain, which is used to record the transaction data of each transaction in the form of blocks.
[0112] The target block information refers to the information on the target block that needs to be recorded in the blockchain information storage space. The target block information includes each transaction contained in the target block and the block status information of the target block.
[0113] The target block is a carrier in the blockchain that is used to permanently store the relevant data of each transaction in the target block information.
[0114] Transactions are used to indicate the resource transfer process between different objects. Transactions record data such as the source of resources, the amount of resources transferred, and the destination of resources during the resource transfer process.
[0115] The block status information of the target block is used to indicate the block status of the target block, resource changes caused by each transaction, and other information.
[0116] In the specific implementation of this embodiment, when the object sends a transaction on-chain request to the blockchain system server through the object terminal, the relevant data of each transaction will be sent to the blockchain system server. Based on this, the blockchain system server can first respond to the transaction on-chain request and receive the relevant data of each transaction. Then, the blockchain system server will obtain the block status information of the target block that records the relevant data of each transaction. Finally, the block status information and the relevant data of each transaction are integrated to obtain the target block information to be written into the blockchain information storage space.
[0117] In step 320, the target block information is written into the intermediate log.
[0118] An intermediate log refers to a file that has a certain amount of storage space and can be used to store data. For example, an intermediate log can be a log such as a rewrite log file redo log that has a certain amount of memory space and can store data.
[0119] Among them, when storing data, the intermediate log can classify and store various types of data according to the established data format and storage rules, improve the standardization and rationality of data storage, and facilitate data query.
[0120] It should be noted that when the redo log file is selected as the intermediate log, the data recovery capability of the redo log file can also be used to reduce the risk of loss of target block information.
[0121] When this embodiment is implemented, the target block information can be automatically written into the intermediate log through a pre-written script program, thereby realizing intelligent writing of the target block information and improving the efficiency of writing the target block information into the intermediate log.
[0122] In step 330, after determining that the target block information has been written into the intermediate log, the block status information is written into the blockchain information storage space.
[0123] In the specific implementation of this embodiment, the target block information is first written into the intermediate log. After the target block information is written into the intermediate log, the written block status information is extracted from the intermediate log, and the block status information extracted from the intermediate log is written into the blockchain information storage space.
[0124] In another embodiment, in order to improve the real-time and accuracy of the block status information in the blockchain information storage space, after obtaining the target block information, the target block information can be written into the intermediate log. In addition, while writing the target block information into the intermediate log, the obtained block status information can be synchronously written into the blockchain information storage space.
[0125] In step 340, the writing speed of the blockchain information storage space is detected. If the writing speed meets the first condition, each transaction in the intermediate log is written into the blockchain information storage space.
[0126] The write speed is used to reflect the total amount of data written into the blockchain information storage space per unit time. For example, if the total amount of data written into the blockchain information storage space within 5 seconds is 20, then the write speed is 4 data / second.
[0127] The first condition is used to measure whether the time has come for writing each delayed transaction into the blockchain information storage space. The first condition is often used to define the relationship between the writing speed and the predetermined speed that should be satisfied when allowing each transaction in the intermediate log to be written into the blockchain information storage space.
[0128] For example, the first condition is set as follows: if the writing speed is greater than the predetermined speed, each transaction in the intermediate log is written into the blockchain information storage space.
[0129] In the specific implementation of this embodiment, after the block status information is written into the blockchain information storage space, each transaction in the target block information has not yet been written into the blockchain information storage space, but each transaction is stored in the intermediate log. Based on this, after the block status information is written into the blockchain information storage space, the writing speed of the blockchain information storage space is detected, and it is determined whether the writing speed of the blockchain information storage space meets the first condition. If the writing speed of the blockchain information storage space meets the first condition, indicating that the blockchain system is in a relatively idle state, then the unwritten transactions are extracted from the intermediate log, and the transactions extracted from the intermediate log are written into the blockchain information storage space.
[0130] Furthermore, if the writing speed of the blockchain information storage space does not meet the first condition, indicating that the blockchain system is still in a relatively busy state, the writing of each transaction into the blockchain information storage space will continue to be delayed until the writing speed of the blockchain information storage space meets the first condition, and then the unwritten transactions will be extracted from the intermediate log, and the transactions extracted from the intermediate log will be written into the blockchain information storage space.
[0131] Through the above steps 310-340, in the embodiment of the present disclosure, the blockchain system first obtains the target block information to be written into the blockchain information storage space. Further, the blockchain system first writes the target block information into the intermediate log, so that the block state information and each transaction of the target block are all saved in the intermediate log, and the target block information is stored through the intermediate log. After determining that the target block information is written into the intermediate log, when the system business is busy, the blockchain state information is first written into the blockchain information storage space, and each transaction is temporarily not written into the blockchain information storage space, which can effectively reduce the data writing pressure when the business is busy and improve the transaction processing speed. In addition, the present disclosure also judges the busyness of the system according to the change of the writing speed of the blockchain information storage space. When the writing speed meets the first condition, it is determined that the system is in a relatively idle state. At this time, each transaction stored in the intermediate log is written into the blockchain information storage space, which can improve the data writing efficiency, thereby solving the performance bottleneck problem of the blockchain system during the peak business period, improving the throughput and response time of the entire blockchain system, and improving the transaction processing speed.
[0132] The above is a general description of steps 310 to 340. Since step 310 has been described in detail in the above general description, the specific implementation of steps 320, 330, and 340 will be described in detail below.
[0133] Detailed description of step 320
[0134] In step 320, the target block information is written into the intermediate log.
[0135] In the specific implementation of this embodiment, the block status information includes the first transaction summary value of each transaction, the transaction receipt of each transaction, the block header of the target block, and the associated resource pool status after the transaction is executed.
[0136] The main function of the target block is to encapsulate the relevant data of each transaction and record the blockchain status data.
[0137] The first transaction summary value is the result of performing a summary operation on each transaction in the block status information.
[0138] Transaction receipts are used to represent the execution results of transactions. Transaction receipts generally contain version information of the structure definition used to indicate transaction receipts, contract address, transaction execution results, smart contract type, etc.
[0139] For example, transaction M is characterized by transferring 10 resources from resource pool A to resource pool B. After the transaction is executed, the 10 resources from resource pool A are successfully transferred to resource pool B, and the transaction receipt will show that transaction M is successfully executed.
[0140] The block header is mainly used to store some metadata of the blockchain. For example, the block header contains the block height, block hash, parent block hash, timestamp, etc. of the target block.
[0141] The associated resource pool refers to the resource pool that is affected by the transaction execution. The resource pool generally stores several resources.
[0142] The associated resource pool status is used to indicate resource changes in the resource pool affected by the transaction execution after the transaction execution.
[0143] For example, the total amount of resources in resource pool A is 20, and the total amount of resources in resource pool B is 10. Transaction M is characterized by transferring 10 resources from resource pool A to resource pool B. For the execution of transaction M, the associated resource pools are resource pool A and resource pool B. At this time, the associated resource pool status of associated resource pool A after the transaction is executed is: the total amount of resources is 10; the associated resource pool status of associated resource pool B after the transaction is executed is: the total amount of resources is 20.
[0144] In order to improve the data storage security and simplicity of the intermediate log, the embodiment of the present disclosure provides a solution based on storing data in the intermediate log in the form of key-value pairs.
[0145] Specifically, the intermediate log contains a first key-value pair, a second key-value pair, a third key-value pair, a fourth key-value pair, and a fifth key-value pair. The first key-value pair is used to indicate each transaction, the second key-value pair is used to indicate the first transaction summary value of each transaction, the third key-value pair is used to indicate the transaction receipt of each transaction, the fourth key-value pair is used to indicate the block header, and the fifth key-value pair is used to indicate the status of the associated resource pool after the transaction is executed.
[0146] Reference Figure 4 In some embodiments, step 320 includes, but is not limited to, the following steps 410-460:
[0147] Step 410: Obtain the block height and block summary of the target block;
[0148] Step 420: Generate a first key-value pair using the block height, block summary, and each transaction as keywords and the summary result of each transaction as a value;
[0149] Step 430: Generate a second key-value pair using the block height, block summary, and the first transaction summary value of each transaction as keywords and the summary result of the first transaction summary value of each transaction as a value;
[0150] Step 440: Generate a third key-value pair using the block height, block summary, and transaction receipt of each transaction as keywords and the summary result of the transaction receipt of each transaction as a value;
[0151] Step 450: Generate a fourth key-value pair using the block height, block summary, and block header as keywords and the summary result of the block header as a value;
[0152] Step 460: Generate a fifth key-value pair using the block height, block summary, and associated resource pool status after transaction execution as keywords and the summary result of the associated resource pool status after transaction execution as a value.
[0153] Steps 410-460 are described in detail below.
[0154] In step 410, the block height and block summary of the target block are obtained.
[0155] Block height refers to the number of the target block, which is the number of blocks between the target block and the genesis block in the blockchain.
[0156] The block summary refers to the result of performing a summary operation on the block header of the target block.
[0157] In the specific implementation of this embodiment, the number of blocks between the target block and the genesis block is first determined, and the number of blocks is used as the block height of the target block. Then, a digest operation is performed on the block header of the target block, and the digest result is used as the block digest.
[0158] It should be noted that the block height and block summary of the target block are unique, and the block height and block summary of each target block are different. The location of the target block can be determined by the block height and block summary of the target block.
[0159] In step 420, a first key-value pair is generated using the block height, block summary, and each transaction as keywords and the summary result of each transaction as a value.
[0160] In the specific implementation of this embodiment, the block height, block summary and each transaction are first concatenated, and the concatenated string is used as the keyword key; then, a summary operation is performed on each transaction, and the summary result is used as the value value. Finally, the keyword key and the value value are stored as the first key-value pair.
[0161] For example, the first key-value pair A has: key = block height + block summary + transaction 1; value = summary result of transaction 1.
[0162] In step 430, a second key-value pair is generated using the block height, block summary, and the first transaction summary value of each transaction as keywords and the summary result of the first transaction summary value of each transaction as a value.
[0163] In the specific implementation of this embodiment, the block height, block summary and the first transaction summary value of each transaction are first concatenated, and the concatenated string is used as the keyword key; then, the first transaction summary value of each transaction is digested, and the digest result is used as the value value. Finally, the keyword key and the value value are stored as the second key-value pair.
[0164] For example, the second key-value pair A2 has: key=block height+block summary+first transaction summary value 1 of transaction 1; value=summary result of first transaction summary value 1.
[0165] In step 440, a third key-value pair is generated using the block height, block summary, and transaction receipt of each transaction as keywords and the summary result of the transaction receipt of each transaction as a value.
[0166] In the specific implementation of this embodiment, the block height, block summary and transaction receipt of each transaction are first concatenated, and the concatenated string is used as the keyword key; then, the transaction receipt of each transaction is digested and the digest result is used as the value value. Finally, the keyword key and the value value are stored as the third key-value pair.
[0167] For example, the third key-value pair A3 has: key = block height + block summary + transaction receipt 1 of transaction 1; value = summary result of transaction receipt 1.
[0168] In step 450, a fourth key-value pair is generated using the block height, block summary, and block header as keywords and the summary result of the block header as a value.
[0169] In the specific implementation of this embodiment, the block height, block summary and block header are first concatenated, and the concatenated string is used as the keyword key; then, the block header is digested and the digest result is used as the value value. Finally, the keyword key and the value value are stored as the fourth key-value pair.
[0170] For example, the fourth key-value pair A4 has: key = block height + block summary + block header; value = summary result of block header.
[0171] In step 460, a fifth key-value pair is generated using the block height, block summary, and associated resource pool status after transaction execution as keywords and the summary result of the associated resource pool status after transaction execution as a value.
[0172] In the specific implementation of this embodiment, the block height, block summary and the associated resource pool state after the transaction execution are first concatenated, and the concatenated string is used as the keyword key; then, the associated resource pool state after the transaction execution is digested, and the digest result is used as the value value. Finally, the keyword key and the value value are stored as the fifth key-value pair.
[0173] For example, the fifth key-value pair A5 has: key=block height+block summary+associated resource pool state 1 after transaction 1 is executed; value=summary result of associated resource pool state 1.
[0174] It should be noted that using block status information, block height, and block summary as keywords and the summary result of block status information as the value can effectively improve data security.
[0175] In other embodiments, in order to improve writing efficiency, the type of block status information, block height, and block summary may be used as keywords, and each type of block status information may be used as a value, thereby generating multiple key-value pairs.
[0176] For example, for transactions in the block status information, block height, block summary, and type of transaction are used as keywords, and each transaction is used as a value to form multiple first key-value pairs. For transaction receipts of each transaction in the block status information, block height, block summary, and type of transaction receipt are used as keywords, and each transaction receipt is used as a value to form multiple third key-value pairs.
[0177] like Figure 5As shown, it is a schematic diagram of multiple key-value pairs in an intermediate log. The type of block status information, block height, and block summary are used as keywords, and each type of block status information is used as a value to generate multiple key-value pairs in the intermediate log. Specifically, the key-value pairs of the intermediate log include a first key-value pair with a keyword of block height 5+block summary SHaq12+transaction and a value of transaction 1. A second key-value pair with a keyword of block height 5+block summary SHaq12+first transaction summary value and a value of the first transaction summary value keq14d of transaction 1. A third key-value pair with a keyword of block height 5+block summary SHaq12+transaction receipt and a value of transaction receipt 1 of transaction 1. A fourth key-value pair with a keyword of block height 5+block summary SHaq12+block header and a value of block header 1 of the target block. A fifth key-value pair with a keyword of block height 5+block summary SHaq12+associated resource pool status after transaction execution and a value of associated resource pool status of transaction 1.
[0178] Through the above steps 410-460, the embodiment of the present disclosure, when writing the first transaction summary value of each transaction, the transaction receipt of each transaction, the block header of the target block, and the associated resource pool state after the transaction is executed into the intermediate log, based on the block height and block summary of the target block, the first transaction summary value of each transaction, the transaction receipt of each transaction, the block header of the target block, and the associated resource pool state after the transaction is executed are stored in the intermediate log in the form of a key-value pair, which can improve data storage security and simplicity. In addition, since the block height and block summary of the target block are unique, writing and storing them in the form of a key-value pair can improve the query efficiency of the target block information in the intermediate log.
[0179] Detailed description of step 330 and step 340
[0180] Since the blockchain information storage space needs to store the block information of each block and record the resource changes generated under each transaction, the structure of the blockchain information storage space needs to meet certain conditions to improve the security and reliability of information storage. Based on this, in the embodiment of the present disclosure, the blockchain information storage space includes the blockchain and the blockchain auxiliary storage space, and the block status information includes the first transaction summary value of each transaction, the transaction receipt of each transaction, the block header of the target block, and the associated resource pool status after the transaction is executed.
[0181] Blockchain auxiliary storage space refers to data space that can be used to store various data that do not need to be uploaded to the blockchain.
[0182] In some embodiments, step 330 includes:
[0183] Write the block header and the first transaction summary value to the target block to record it in the blockchain, and write the transaction receipt and the associated resource pool status to the blockchain auxiliary storage space.
[0184] In the specific implementation of this embodiment, the block header is first written into the target block, and the information contained in the block header is used as the information contained in the block header of the target block; then, the first transaction summary value is written into the block body of the target block. Finally, the transaction receipt and the associated resource pool status are written into the blockchain auxiliary storage space.
[0185] In some embodiments, step 340 includes:
[0186] Write each transaction in the intermediate log to the target block on the blockchain.
[0187] In the specific implementation of this embodiment, each transaction is delayed in being written into the block body of the target block on the blockchain; when it is detected that the writing speed of the blockchain information storage space meets the first condition, each transaction in the intermediate log is written into the target block on the blockchain, and its specific implementation process is similar to the specific implementation process of the above step 340. To save space, it will not be repeated.
[0188] It should be noted that the block status information has a high degree of real-time performance. Generally, if the block status information is delayed in being written into the blockchain information storage space, it will often have an adverse impact on the security of resource transfer. Based on this, the disclosed embodiment considers writing the block status information into the blockchain information storage space normally, and only delays writing the transactions that do not affect resource transfer and other processing into the blockchain information storage space.
[0189] Through the above method, the embodiment of the present disclosure writes the block header, the first transaction summary value, and the transaction into the target block, so that the block header, the first transaction summary value, and the transaction are recorded in the blockchain, which can improve the storage security of the data. In addition, writing the transaction receipt and the associated resource pool status into the blockchain auxiliary storage space is conducive to maintaining each transaction of each block on the blockchain based on the blockchain auxiliary storage space, thereby improving the security and reliability of information storage as a whole.
[0190] Reference Figure 6 After writing the transaction receipt and the associated resource pool status into the blockchain auxiliary storage space, and before writing each transaction in the intermediate log into the blockchain information storage space, the data processing method further includes but is not limited to the following steps 610-620:
[0191] Step 610, responding to resource processing transaction requests received after each transaction included in the target block;
[0192] Step 620: Based on the resource processing transaction request, the resources in the associated resource pool are processed, and the status of the associated resource pool is updated.
[0193] Steps 610 - 620 are described in detail below.
[0194] In step 610, a resource processing transaction request is received in response to each transaction included in the target block.
[0195] Resource processing transaction requests are requests triggered when operations such as adding resources or transferring resources are required for the resource pools associated with each transaction.
[0196] In the specific implementation of this embodiment, when a resource processing transaction request is received after each transaction included in the target block, the blockchain system server will respond to the resource processing transaction request received after each transaction included in the target block and determine the resource processing method to be performed.
[0197] In step 620, based on the resource processing transaction request, the resources in the associated resource pool are processed, and the status of the associated resource pool is updated.
[0198] In the specific implementation of this embodiment, firstly, the resource processing mode to be performed is determined according to the resource processing transaction request. Then, the resources in the associated resource pool are processed according to the resource processing mode determined based on the resource processing transaction request. Finally, after the resources in the associated resource pool are processed, the associated resource pool status is updated.
[0199] For example, the resource processing transaction request indicates that 50 resources included in the associated resource pool A are transferred to the resource pool B. The resource pool status of the associated resource pool A is: the resource quantity of the associated resource pool A is 100. Based on this, it is determined that the resource processing method is to transfer the 50 resources included in the associated resource pool A to the resource pool B. Therefore, according to this resource processing method, a part of the resources in the associated resource pool A is transferred. After the resource transfer is completed, the associated resource pool status of the associated resource pool is updated to: the resource quantity of the associated resource pool A is 50.
[0200] Through the above steps 610-620, in the embodiment of the present disclosure, after the transaction receipt and the associated resource pool state are written into the blockchain auxiliary storage space, and before each transaction in the intermediate log is written into the blockchain information storage space, the blockchain auxiliary storage space contains the latest associated resource pool state, so that the associated resource pool state of the blockchain information storage space can be updated in real time, thereby effectively reducing the risk of resource information recording errors caused by the update delay of the associated resource pool state, so that the blockchain system server can respond to the resource processing transaction request received after each transaction included in the target block in a timely manner, and based on the resource processing transaction request, process the resources in the associated resource pool and update the associated resource pool state, which can reduce the risk of resource processing errors and improve the security and accuracy of transaction processing and resource changes.
[0201] In order to effectively reduce the waste of resources caused by the same transaction being repeatedly uploaded to the blockchain, a first mapping table is also maintained in the blockchain auxiliary storage space, and the first mapping table is used to indicate the mapping relationship between the first transaction summary value and the target block.
[0202] Combine the following Figure 7 , Figure 8 The process of verifying the transaction on-chain request based on the first mapping table is described in detail.
[0203] Reference Figure 7 In some embodiments, the process of verifying the transaction on-chain request based on the first mapping table includes but is not limited to the following steps 710-730:
[0204] Step 710: Generate a first mapping table;
[0205] Step 720: In response to a transaction on-chain request received after each transaction included in the target block, calculate a second transaction digest value of the transaction to be on-chained in the transaction on-chain request;
[0206] Step 730: If the second transaction digest value is the same as a first transaction digest value in the first mapping table, reject the transaction on-chain request.
[0207] Steps 710 - 730 are described in detail below.
[0208] In step 710, a first mapping table is generated.
[0209] In the specific implementation of this embodiment, the first mapping table is generated in the following manner:
[0210] In the blockchain information storage space, determine the mapping relationship between each block and the summary value of each transaction in the block;
[0211] Based on multiple mapping relationships in the blockchain information storage space, a first mapping table is constructed.
[0212] In the specific implementation of this embodiment, since the summary value and block header of each transaction of the same block are written into the blockchain information storage space as one record, a mapping relationship between each block and the summary value of each transaction of the block is constructed according to the block header of the same block and the summary value of each transaction. Then, multiple mapping relationships in the blockchain information storage space are tabulated to obtain a first mapping table.
[0213] It should be noted that since a block generally stores data related to at least one transaction, a block will be mapped to the summary value of at least one transaction. In order to save resources, a transaction will only be recorded once on the blockchain, so the summary value of a transaction will only be mapped to one block.
[0214] like Figure 8 As shown, it is a schematic diagram of a first mapping table. Five mapping relationships are stored in the first mapping table. Specifically, mapping relationship 1 indicates the correspondence between block 1 and the first transaction summary value kkq246q, and block 1 stores a transaction with a first transaction summary value of kkq246q. Mapping relationship 2 indicates the correspondence between block 2 and the first transaction summary value eqw14y5, and block 2 stores a transaction with a first transaction summary value of eqw14y5. Mapping relationship 3 indicates the correspondence between block 3 and the first transaction summary values M3q5d2d, yy341qz, and u4c331m, and block 3 stores a transaction with a first transaction summary value of M3q5d2d, a transaction with a first transaction summary value of yy341qz, and a transaction with a first transaction summary value of u4c331m. Mapping relationship 4 indicates the correspondence between block 4 and the first transaction digest value M46b81 and g3dd46. Block 4 stores transactions with the first transaction digest value M46b81 and g3dd46. Mapping relationship 5 indicates the correspondence between block 5 and the first transaction digest value z9m87f1. Block 5 stores transactions with the first transaction digest value z9m87f1.
[0215] In step 720, in response to a transaction on-chain request received after each transaction included in the target block, a second transaction digest value of the transaction to be on-chained in the transaction on-chain request is calculated.
[0216] A transaction on-chain request is a request sent by an object terminal or other terminal to the blockchain system when the object terminal or other terminal has a transaction to be on-chain that needs to be recorded on the blockchain.
[0217] The second transaction summary value is the result of performing a summary operation on the transaction to be on-chain.
[0218] In the specific implementation of this embodiment, when a transaction on-chain request is received after each transaction included in the target block, the blockchain system server will respond to the transaction on-chain request received after each transaction included in the target block, and calculate the second transaction summary value of the transaction to be on-chain in the transaction on-chain request according to a predetermined summary algorithm.
[0219] It should be noted that the predetermined digest algorithm includes but is not limited to the MD5 algorithm, the Poseidon hash algorithm, etc.; by calculating the second transaction digest value of the transaction to be chained in the transaction chain request according to the predetermined digest algorithm, it is possible to effectively prevent the relevant information of the transaction to be chained in the transaction chain request from being tampered with, thereby improving the security of the relevant information of the transaction to be chained.
[0220] In step 730, if the second transaction digest value is the same as a first transaction digest value in the first mapping table, the transaction on-chain request is rejected.
[0221] When this embodiment is implemented, the second transaction summary value is compared with each first transaction summary value in the first mapping table to determine whether there is a first transaction summary value that is the same as the second transaction summary value. If the second transaction summary value is the same as a first transaction summary value in the first mapping table, it is determined that the transaction to be chained in the transaction chaining request is a transaction that has been chained. Based on this, in order to avoid repeated chaining of the same transaction, the blockchain system will reject the transaction chaining request.
[0222] Furthermore, if the second transaction summary value is different from the first transaction summary value in the first mapping table, it is determined that the transaction to be chained in the transaction chaining request is a transaction that has not been chained. Based on this, it is necessary to chain the transaction to be chained, and the blockchain system can chain the transaction to be chained through the data processing method of the embodiment of the present disclosure, so that the relevant data of the transaction to be chained is stored in the block of the blockchain.
[0223] Through the above steps 710-730, the embodiment of the present disclosure sets a first mapping table to store the mapping relationship between each block on the blockchain and the transaction summary value of each transaction in the block, which can achieve systematic management of transactions that have been chained and the blocks where the transactions that have been chained are located. Further, when there is a transaction to be chained that needs to be chained, the transaction summary value of the transaction to be chained is first compared with the transaction summary value of each transaction in the first mapping table to verify whether the transaction to be chained is a transaction that has been chained, which can effectively avoid repeated chaining of the same transaction, effectively reduce the waste of resources caused by the same transaction being repeatedly chained to the blockchain, and improve transaction processing efficiency.
[0224] Detailed description of a data processing method based on blockchain according to another embodiment of the present invention
[0225] Since the storage space of the intermediate log is limited, in order to continuously write the target block information into the intermediate log, the embodiment of the present disclosure provides a solution for regularly cleaning the intermediate log, which can continuously write the target block information into the intermediate log, improve the resource utilization efficiency of the intermediate log, and reduce the cost of transaction processing.
[0226] Reference Fig. 9 In some embodiments, the blockchain-based data processing method includes but is not limited to the following steps 310-920:
[0227] Step 310: Obtain target block information to be written into the blockchain information storage space;
[0228] Step 320, write the target block information into the intermediate log;
[0229] Step 330: After determining that the target block information has been written into the intermediate log, write the block status information into the blockchain information storage space;
[0230] Step 340: Detect the writing speed of the blockchain information storage space. If the writing speed meets the first condition, write each transaction in the intermediate log into the blockchain information storage space;
[0231] Step 910: Determine that each transaction has been written into the blockchain information storage space;
[0232] Step 920: Delete the target block information from the intermediate log.
[0233] Steps 310-920 are described in detail below.
[0234] Since steps 310-340 have been described in detail above, they will not be repeated here to save space.
[0235] In step 910, it is determined that each transaction has been written into the blockchain information storage space.
[0236] In the specific implementation of this embodiment, after each transaction of the target block is written into the blockchain information storage space, the node that generates the target block will broadcast it to other nodes in the blockchain. Based on this, in the embodiment of the present disclosure, it can be determined that each transaction has been written into the blockchain information storage space according to the broadcast message of the node.
[0237] In step 920, the target block information is deleted from the intermediate log.
[0238] In the specific implementation of this embodiment, after it is determined that each transaction has been written into the blockchain information storage space, the target block information corresponding to each transaction is queried in the intermediate log, and the queried target block information is deleted from the intermediate log.
[0239] Through the above steps 310-920, the embodiment of the present disclosure deletes the target block information in the intermediate log after determining that each transaction has been written into the blockchain information storage space, so that the intermediate log can be cleaned up regularly, so that the target block information can be continuously written into the intermediate log, so that the storage data of the intermediate log is maintained in a relatively balanced state, thereby improving the resource utilization efficiency of the intermediate log and reducing the cost of transaction processing.
[0240] Since in the process of writing the target block information into the blockchain storage space, the system may often crash due to network failures and other problems, which may cause a portion of the data just written into the blockchain storage space to be lost, affecting the data security and integrity. Based on this, the disclosed embodiment provides a solution for recovering the data just written into the blockchain storage space based on the target block information stored in the intermediate log, which can reduce the data recovery time, reduce the risk of data loss, and improve data security and integrity.
[0241] Combine the following Fig.10 , Fig.11 The data processing process when the blockchain node fails is described in detail.
[0242] Reference Fig.10 In some embodiments, the data processing process when a blockchain node fails includes but is not limited to the following steps 1010-1020:
[0243] Step 1010: If a blockchain node executing the data processing method fails before each transaction is written into the blockchain information storage space, the location of the target block information in the intermediate log is recorded with the first pointer;
[0244] Step 1020: If the blockchain node fails and recovers, locate the target block information in the intermediate log based on the first pointer, and write each transaction in the target block information into the blockchain information storage space.
[0245] Steps 1010 - 1020 are described in detail below.
[0246] In step 1010, if the blockchain node executing the data processing method fails before each transaction is written into the blockchain information storage space, the position of the target block information in the intermediate log is recorded with the first pointer.
[0247] The first pointer is used to mark the location of the target block information in the intermediate log.
[0248] When this embodiment is implemented, the intermediate log often contains multiple pointers for marking positions. For example, the intermediate log contains a pointer for marking the position where the intermediate log starts recording, a pointer for marking the storage position of the next information that should be recorded in the intermediate log, and a first pointer for marking the position of the target block information. Based on this, if the blockchain node that executes the data processing method fails before each transaction is written to the blockchain information storage space, the position of the first pointer in the intermediate log is determined, and the position of the target block information in the intermediate log can be queried.
[0249] like Fig.11 As shown in the figure, it is a schematic diagram of the first pointer position of a certain intermediate log. Specifically, there are three pointers in the intermediate log redo log, which are used to record the position of the target block information in the intermediate log, the pointer to mark the position where the intermediate log starts recording, and the pointer to mark the storage position of the next information that should be recorded in the intermediate log. Three areas are divided in the intermediate log through these three pointers. The area ③ defined by the first pointer and the pointer to the storage position of the next information that should be recorded in the intermediate log is the area where the intermediate log stores the target block information; the area ② defined by the pointer to the start recording position and the pointer to the storage position of the next information that should be recorded in the intermediate log is the unused free area of the intermediate log; the area ① defined by the pointer to the start recording position and the first pointer is the area in the intermediate log where the block information was previously stored. Since the transactions in the block information in this area have been written into the blockchain information storage space, the block information in this area has been deleted.
[0250] In step 1020, if the blockchain node fails and recovers, the target block information in the intermediate log is located based on the first pointer, and each transaction in the target block information is written into the blockchain information storage space.
[0251] In the specific implementation of this embodiment, if the blockchain node failure is recovered, the target block information in the intermediate log can be located based on the first pointer, and each transaction of the target block information can be extracted from the intermediate log, and each transaction in the target block information can be rewritten into the blockchain information storage space to achieve data recovery of the lost transactions in the blockchain information storage space.
[0252] Furthermore, since the blockchain node executing the data processing method fails before each transaction is written to the blockchain information storage space, resulting in the loss of block status information in the target block information previously written to the blockchain information storage space, it is also possible, according to the specific implementation method of steps 1010-1020, to locate the target block information in the intermediate log based on the first pointer when the blockchain node fails and extract the block status information of the target block information from the intermediate log, and write the block status information in the target block information into the blockchain information storage space, thereby rewriting the lost block status information in the blockchain information storage space and reducing the risk of data loss.
[0253] Through the above steps 1010-1020, the embodiment of the present disclosure, because the target block information stored in the intermediate log has not been deleted before each transaction is written into the blockchain information storage space, the intermediate log stores complete target block information. Based on this, if the blockchain node executing the data processing method fails before each transaction is written into the blockchain information storage space, the data just written into the blockchain storage space can be restored according to the target block information stored in the intermediate log. Compared with the related art of writing the target block information into the blockchain storage space in real time, the system downtime will cause data loss and data is difficult to recover. The embodiment of the present disclosure can reduce data recovery time, reduce the risk of data loss, improve data security and integrity, and thus improve system availability.
[0254] Detailed description of delaying writing transactions into blockchain information storage space according to an embodiment of the present disclosure
[0255] In addition to the writing speed of the blockchain information storage space, the writing performance of the blockchain information storage space will also greatly affect the transaction processing efficiency. If the writing speed of the blockchain information storage space meets the first condition, but the writing performance of the blockchain information storage space is poor, writing a large number of transactions to the blockchain information storage space will also cause network congestion, resulting in problems such as low writing efficiency. Based on this, the present disclosure provides a solution for delaying the writing of transactions to the blockchain information storage space based on the writing performance of the blockchain information storage space, which can reasonably determine the timing of writing transactions to the blockchain information storage space and improve transaction processing efficiency.
[0256] Reference Fig.12 In some embodiments, the process of writing transactions of the intermediate log into the blockchain information storage space based on the write performance of the blockchain information storage space includes but is not limited to the following steps 1210-1230:
[0257] Step 1210: Obtain the write performance index of the blockchain information storage space;
[0258] Step 1220: If it is determined that the write performance index meets the second condition, each transaction in the intermediate log is written into the blockchain information storage space;
[0259] Step 1230: If it is determined that the write performance indicator does not meet the second condition, delay writing each transaction in the intermediate log into the blockchain information storage space.
[0260] Steps 1210 - 1230 are described in detail below.
[0261] In step 1210, the write performance index of the blockchain information storage space is obtained.
[0262] Write performance indicators are used to reflect the performance of blockchain information storage space when writing data. For example, write performance indicators include CPU memory, number of transactions processed per second by the system, network latency, etc.
[0263] When this embodiment is implemented, a commonly used performance testing tool can be used to perform a performance test on the blockchain information storage space to obtain a performance test index of the blockchain information storage space. Then, the write performance index of the blockchain information storage space is selected from the multiple performance test indexes.
[0264] In step 1220, if it is determined that the write performance indicator meets the second condition, each transaction in the intermediate log is written into the blockchain information storage space.
[0265] The second condition is used to measure whether the write performance index meets the requirements for writing each transaction into the blockchain information storage space.
[0266] When this embodiment is implemented, the write performance index is first compared with the specific index requirements in the second condition. If the write performance index meets the specific index requirements in the second condition, it is considered that the write performance index meets the second condition, and the blockchain information storage space can meet the requirements for writing transactions. Based on this, each transaction in the intermediate log is written into the blockchain information storage space.
[0267] In step 1230, if it is determined that the write performance indicator does not meet the second condition, the writing of each transaction in the intermediate log into the blockchain information storage space is delayed.
[0268] When this embodiment is specifically implemented, the write performance index is first compared with the specific index requirements in the second condition. If the write performance index does not meet the specific index requirements in the second condition, it is considered that the write performance index does not meet the second condition, and the blockchain information storage space does not meet the requirements for writing transactions. Based on this, the writing of each transaction in the intermediate log to the blockchain information storage space is delayed until the blockchain information storage space meets the requirements for writing transactions, and then each delayed transaction is extracted from the intermediate log, and each delayed transaction is written to the blockchain information storage space.
[0269] For example, when the second condition requires that the CPU memory meets the first memory amount, each transaction in the intermediate log can be written into the blockchain information storage space; at this time, the CPU memory in the write performance indicator is less than the first memory amount, indicating that the memory of the blockchain information storage space is insufficient, and then each transaction in the intermediate log cannot be written into the blockchain information storage space. Therefore, the writing of each transaction into the blockchain information storage space is delayed.
[0270] Through the above steps 1210-1230, the embodiment of the present disclosure delays writing transactions into the blockchain information storage space based on the write performance of the blockchain information storage space. If it is determined that the write performance index meets the second condition, each transaction in the intermediate log is written into the blockchain information storage space; if it is determined that the write performance index does not meet the second condition, each transaction in the intermediate log is delayed from being written into the blockchain information storage space, so that only when the write speed and write performance meet the conditions, the transaction in the intermediate log is written into the blockchain information storage space, which can reasonably determine the timing of writing transactions into the blockchain information storage space, avoid network congestion, and thus reduce the write burden of the system and improve transaction processing efficiency.
[0271] In some embodiments, the write performance index includes the write response speed, the remaining processing capacity of the write processing unit, etc. The write response speed is used to reflect how quickly the blockchain information storage space responds to the written data. The remaining processing capacity of the write processing unit is used to reflect the remaining storage and processing capacity of the blockchain information storage space after writing a part of the data. Based on this, the way to determine whether the write performance index meets the second condition includes but is not limited to the following ways:
[0272] In one embodiment, whether the write performance meets the second condition is determined only based on the write response speed. Specifically, based on the write response speed, a first score is determined; if the first score is greater than a second threshold, it is determined that the write performance indicator meets the second condition.
[0273] In the specific implementation of this embodiment, a preset function is first determined, wherein the preset function is a function with response speed as an independent variable and a first score as a dependent variable, and the first score increases as the response speed increases. Next, the write response speed is substituted into the preset function, the write response speed is used as an independent variable, and the output of the preset function is used as the first score corresponding to the write response speed. Further, the first score and the second threshold are compared. If the first score is greater than the second threshold, it indicates that the performance of the blockchain information storage space meets the requirements of the write transaction, and it is determined that the write performance index meets the second condition.
[0274] It should be noted that the second threshold is determined according to actual business needs and is not restricted.
[0275] In this way, whether the write performance meets the second condition can be judged based on the write response speed, which can effectively improve the judgment efficiency and further improve the transaction processing efficiency.
[0276] In another embodiment, whether the write performance meets the second condition is determined only based on the remaining processing capacity of the write processing unit. Specifically, based on the remaining processing capacity of the write processing unit, a second score is determined; if the second score is greater than a third threshold, it is determined that the write performance indicator meets the second condition.
[0277] It should be noted that the third threshold is determined according to actual business needs and is not restricted.
[0278] When this embodiment is implemented, its specific implementation process is similar to the above-mentioned process of judging whether the write performance meets the second condition only based on the write response speed. To save space, it will not be described in detail.
[0279] In this way, whether the write performance meets the second condition can be determined based on the remaining processing capacity of the write processing unit, which can effectively improve the determination efficiency and further improve the transaction processing efficiency.
[0280] Reference Fig.13 In another embodiment, determining that the write performance indicator meets the second condition includes but is not limited to the following steps 1310-1340:
[0281] Step 1310: Determine a first score based on the write response speed;
[0282] Step 1320: Determine a second score based on the remaining processing capacity of the write processing unit;
[0283] Step 1330: Determine a total score based on the first score and the second score;
[0284] Step 1340: If the total score is greater than the first threshold, determine that the write performance indicator meets the second condition.
[0285] Steps 1310 - 1340 are described in detail below.
[0286] In step 1310 , a first score is determined based on the write response speed.
[0287] In the specific implementation of this embodiment, the specific implementation process of determining the first score based on the write response speed is similar to the specific implementation process of determining the first score when determining whether the write performance indicator meets the second condition only based on the write response speed. To save space, it is not repeated here.
[0288] In step 1320, a second score is determined based on the remaining processing capacity of the write processing unit.
[0289] When this embodiment is implemented, the specific implementation process of determining the second score based on the remaining processing capacity of the write processing unit is similar to the specific implementation process of determining the first score when the write performance index meets the second condition only based on the write response speed in the above embodiment. The difference is that step 1320 determines the second score based on the remaining processing capacity of the write processing unit, while the above embodiment determines the first score based on the write response speed when determining whether the write performance index meets the second condition only based on the write response speed. The scoring indicators of the two are different. In order to save space, they will not be repeated.
[0290] In step 1330, a total score is determined based on the first score and the second score.
[0291] In the specific implementation of this embodiment, first obtain the first weight of the first score and the second weight of the second score. Then, multiply the first weight and the first score to obtain the first weighted score; multiply the second score of the second weight to obtain the second weighted score. Finally, add the first weighted score and the second weighted score to obtain the total score.
[0292] The first weight is used to indicate the importance of the write response speed to determining whether the write performance index meets the second condition; the second weight is used to indicate the importance of the remaining processing capacity of the write processing unit to determining whether the write performance index meets the second condition. The sum of the first weight and the second weight is 1.
[0293] In step 1340 , if the total score is greater than the first threshold, it is determined that the write performance indicator meets the second condition.
[0294] The first threshold is used to compare with the total score to measure whether the write performance indicator meets the second condition. The first threshold is set according to actual business needs and is not limited.
[0295] In the specific implementation of this embodiment, the total score is first compared with the first threshold. If the total score is greater than the first threshold, it is determined that the write performance index meets the second condition. If the total score is less than or equal to the first threshold, it is determined that the write performance index meets the second condition.
[0296] Through the above steps 1310-1340, the embodiment of the present disclosure comprehensively scores the write performance index by taking into account the write response speed and the remaining processing capacity of the write processing unit, thereby achieving multi-dimensional and multi-faceted scoring, so that the total score of the write performance index has good rationality and accuracy, and then converts the judgment of whether the write performance index meets the second condition into the judgment of the relationship between the total score and the first threshold value, which can simplify the process of judging whether the write performance index meets the second condition, improve the judgment efficiency and accuracy, and thus improve the transaction processing efficiency.
[0297] Detailed description of another embodiment of the present disclosure delaying writing transactions into blockchain information storage space
[0298] Since there are often multiple target block information, when the write performance of the blockchain information storage space is good, it is often not necessary to delay the writing of all transactions. You can choose to write a part of the target block information transactions into the blockchain information storage space in real time, and delay the writing of another part of the target block information transactions into the blockchain information storage space, thereby improving transaction processing efficiency. However, transaction processing efficiency is often limited by the ratio of transactions written in real time to transactions written with delays. Based on this, the embodiment of the present disclosure provides a solution for delaying the writing of transactions into the blockchain information storage space based on the ratio of transactions written in real time to transactions written with delays, which can flexibly adjust the ratio of transactions written in real time to transactions written with delays, thereby improving transaction processing efficiency.
[0299] Reference Fig.14 In some embodiments, the target block information is a plurality of target block information, and the process of screening out a portion of the target block information from the plurality of target block information and delaying writing the target block information into the blockchain information storage space includes but is not limited to the following steps 1410-1450:
[0300] Step 1410: Obtain the write performance index of the blockchain information storage space;
[0301] Step 1420: Determine a first ratio based on the write performance indicator;
[0302] Step 1430, determining a first number based on the number of target block information and the first ratio;
[0303] Step 1440: Select a first number of target block information from a plurality of target block information to obtain delayed target block information;
[0304] Step 1450: If the writing speed meets the first condition, each transaction of the delayed target block information in the intermediate log is written into the blockchain information storage space.
[0305] Steps 1410-1450 are described in detail below.
[0306] In step 1410, the write performance index of the blockchain information storage space is obtained.
[0307] The specific implementation process of step 1410 is similar to the specific implementation process of obtaining the write performance index of the blockchain information storage space in step 1210. The difference is that step 1410 obtains the write performance index in order to calculate the number of target block information delayed to be written into the blockchain information storage space; while step 1210 obtains the write performance index in order to determine whether to delay writing each transaction into the blockchain information storage space. The purposes of obtaining the write performance index are different. To save space, it will not be repeated.
[0308] In step 1420 , a first ratio is determined based on the write performance indicator.
[0309] The first ratio is used to indicate the proportion of target block information that needs to be delayed in writing into the blockchain information storage space in all target block information.
[0310] In the specific implementation of this embodiment, firstly, a performance score is determined based on the write performance index, and then a first ratio is determined based on the performance score. The write performance index includes a write response speed and a remaining processing capacity of a write processing unit.
[0311] The specific implementation process of determining the performance score based on the write performance index is similar to the specific implementation process of the above steps 1310-1330, which will not be described in detail to save space.
[0312] Furthermore, when determining the first ratio based on the performance score, it can be achieved by a table lookup method. Specifically, first obtain a first relationship comparison table, wherein the first relationship comparison table is used to indicate the first ratio corresponding to each performance score interval. Then, determine the score interval where the performance score is located in the first relationship comparison table, and use the first ratio corresponding to the score interval where the performance score is located as the determined first ratio.
[0313] In step 1430 , a first number is determined based on the number of target block information and the first ratio.
[0314] The first number is used to indicate the total number of target block information that needs to be delayed to be written into the blockchain information storage space.
[0315] In a specific implementation of this embodiment, the number of target block information and the first ratio are multiplied to obtain a product result, and the product result is used as the first number.
[0316] For example, the number of target block information is 50, and the first ratio is 20%, then the first number is 50×20%=10.
[0317] In step 1440 , a first number of target block information is selected from a plurality of target block information to obtain delayed target block information.
[0318] When this embodiment is implemented specifically, a first number of target block information can be randomly selected from multiple target block information, and the transactions of the selected first number of target block information can be used as delayed target block information, and each transaction of the delayed target block information can be delayed and written into the blockchain information storage space.
[0319] In step 1450, if the writing speed satisfies the first condition, each transaction of the delayed target block information in the intermediate log is written into the blockchain information storage space.
[0320] The specific implementation process of step 1450 is similar to the above step 340, and will not be repeated here to save space.
[0321] Through the above steps 1410-1450, the embodiment of the present disclosure determines the first ratio based on the write performance index of the blockchain information storage space, so as to flexibly adjust the ratio of real-time write transactions to delayed write transactions according to the first ratio and the number of target block information, thereby making full use of system resources and improving transaction processing efficiency.
[0322] Since the first number of target block information is randomly selected from multiple target block information, target block information with an earlier submission time or higher real-time performance will often not be written into the blockchain information storage space in priority, which will cause the problem of low rationality of transaction processing and affect the quality of transaction processing. Based on this, the present disclosure provides a solution for screening the first number of target block information based on the real-time performance of the target block information, which can enable target block information with higher real-time performance to be written into the blockchain information storage space in priority, and can improve the rationality and quality of transaction processing.
[0323] Reference Fig.15 In some embodiments, the process of selecting a first number of target block information from a plurality of target block information includes but is not limited to the following steps 1510-1520:
[0324] Step 1510, obtaining the real-time level of information of multiple target blocks;
[0325] Step 1520: sort the plurality of target block information according to the real-time level, and select the first number of target block information in the sorting.
[0326] Steps 1510-1520 are described in detail below.
[0327] In step 1510, the real-time level of information of multiple target blocks is obtained.
[0328] The real-time level is used to indicate the urgency of writing the target block information into the blockchain information storage space. If the real-time level is higher, it means that the target block information is more urgent and the target block information needs to be written into the blockchain information storage space as soon as possible.
[0329] When this embodiment is specifically implemented, the real-time level of the target block information can be determined based on multiple indicators such as the total number of transactions in the target block information and the source of the transactions. Specifically, taking the determination of the real-time level of the target block information based on the total number of transactions in the target block information as an example, for each target block information, the total number of transactions in the target block information is counted, and the total number of transactions is used as the real-time score of the target block information. Further, a preset score level table is queried, wherein the score level table is used to indicate the real-time level corresponding to each real-time score interval. The score interval where the real-time score of the target block information is located is determined in the score level table, and the real-time level corresponding to the score interval where the real-time score of the target block information is located is used as the determined real-time level of the target block information. Among them, the real-time level can be divided into three urgent levels: urgent, general, and non-urgent.
[0330] In step 1520 , the plurality of target block information are sorted according to the real-time level, and the first number of target block information in the sorting are selected.
[0331] In the specific implementation of this embodiment, first, multiple target block information is sorted in descending order according to the size of the real-time level. In the sorting, the target block information with a greater real-time level is ranked at the front, and the target block information with a smaller real-time level is ranked at the back. Then, in the sorting, the last first number of target block information in the sorting is selected, wherein the transactions in the last first number of target block information in the selected sorting will be delayed to be written into the blockchain information storage space.
[0332] Through the above steps 1510-1520, the embodiment of the present disclosure screens the first number of target block information based on the real-time performance of the target block information, sorts the multiple target block information according to the real-time performance level, selects the first number of target block information in the sorting, and can delay writing the transaction of the target block information with lower real-time performance into the blockchain information storage space, so that the transaction of the target block information with higher real-time performance is preferentially written into the blockchain information storage space, which can improve the rationality and quality of transaction processing.
[0333] Detailed description of another embodiment of the present disclosure delaying writing transactions into blockchain information storage space
[0334] Since the writing speed at each moment is constantly changing, if the writing speed is not determined regularly and whether the writing speed meets the predetermined conditions, it often takes a lot of time and cost. Based on this, the embodiment of the present disclosure provides a solution for determining the writing speed at a predetermined interval and judging whether the writing speed meets the predetermined conditions. The writing speed can be detected periodically, making the timing of writing transactions in the intermediate log into the blockchain information storage space more reasonable, thereby improving transaction processing efficiency.
[0335] Reference Fig.16 In some embodiments, the process of writing transactions in the intermediate log into the blockchain information storage space based on a preset duration includes but is not limited to the following steps 1610-1620:
[0336] Step 1610: Determine the writing speed of the blockchain information storage space at first intervals;
[0337] Step 1620: If the writing speed meets the predetermined conditions, each transaction in the intermediate log is written into the blockchain information storage space.
[0338] Steps 1610-1620 are described in detail below.
[0339] In step 1610, a writing speed of the blockchain information storage space is determined every first period of time.
[0340] In the specific implementation of this embodiment, the total amount of block state information written into the blockchain information storage space within the first time period is first obtained. Then, the total amount of data is divided by the first time period to obtain the unit data writing amount, and this unit data writing amount is used as the writing speed of the blockchain information storage space.
[0341] For example, the first time duration is 5s, and the total amount of data written into the blockchain information storage space within the first time duration is 100, then the writing speed of the blockchain information storage space is 100 / 5=20.
[0342] In step 1620, if the writing speed meets the predetermined condition, each transaction in the intermediate log is written into the blockchain information storage space.
[0343] The predetermined condition refers to the first condition mentioned above, and the predetermined condition is used to measure whether the writing speed meets the conditions for writing each transaction into the blockchain information storage space. For example, the predetermined condition is: when the writing speed is greater than the preset speed, each transaction is written into the blockchain information storage space, where the preset speed is determined according to actual business needs and is not limited.
[0344] When this embodiment is implemented, the writing speed is first compared with the preset speed specified by the predetermined condition. If the writing speed is greater than the preset speed, it is determined that the writing speed meets the predetermined condition, and each transaction in the intermediate log is written into the blockchain information storage space in the order of submission time.
[0345] Through the above steps 1610-1620, the embodiment of the present disclosure determines the writing speed of the blockchain information storage space every first time period, and can periodically detect the writing speed. Further, if the writing speed meets the predetermined condition, each transaction in the intermediate log is written into the blockchain information storage space, and there is no need to always pay attention to the change of the writing speed, which can effectively reduce resource consumption and make the timing of writing transactions into the blockchain information storage space more reasonable, thereby improving transaction processing efficiency.
[0346] Reference Fig.17 In some embodiments, the first duration is determined by:
[0347] Step 1710: Obtain a write performance indicator when writing block status information into a blockchain information storage space;
[0348] Step 1720, obtaining target processing accuracy;
[0349] Step 1730: Determine a first duration based on the write performance indicator and the target processing accuracy.
[0350] Steps 1710-1730 are described in detail below.
[0351] In step 1710, a write performance indicator is obtained when writing block status information into the blockchain information storage space.
[0352] The specific implementation process of step 1710 is similar to the specific implementation process of obtaining the write performance index of the blockchain information storage space in step 1210. The difference is that step 1710 obtains the write performance index when writing the block status information into the blockchain information storage space; while step 1210 obtains the write performance index of the blockchain information storage space, and the timing of obtaining the write performance index is different. To save space, it will not be repeated.
[0353] In step 1720, the target processing accuracy is obtained.
[0354] The target processing accuracy is used to measure the accuracy of writing block status information into the blockchain information storage space.
[0355] When this embodiment is implemented, the target processing accuracy can be set according to actual needs without limitation. Specifically, the target processing accuracy is closely related to the block status information and the importance of the transaction written into the blockchain information storage space. Based on this, the importance of the target block information written into the blockchain information storage space is first scored to obtain the importance score of the target block information. Then, based on the importance score, the target processing accuracy is determined through a preset mapping table. Among them, the preset mapping table is used to indicate the mapping relationship between each importance score and the target processing accuracy. The higher the importance score, the higher the target processing accuracy.
[0356] In step 1730, a first duration is determined based on the write performance indicator and the target processing accuracy.
[0357] When this embodiment is implemented, the first duration may be determined only according to the write performance index; the first duration may be determined only according to the target processing accuracy; or the first duration may be determined in combination with the write performance index and the target processing accuracy.
[0358] Reference Fig.18 In some embodiments, step 1730 includes, but is not limited to, the following steps 1810-1830:
[0359] Step 1810: Determine a third score based on the write performance indicator;
[0360] Step 1820: Determine a fourth score based on the target processing accuracy;
[0361] Step 1830: Determine the first duration based on the third score and the fourth score.
[0362] Steps 1810-1830 are described in detail below.
[0363] In step 1810, a third score is determined based on the write performance indicator.
[0364] The third score is used to measure the performance of the write performance indicator when writing the block status information into the blockchain information storage space in determining the first duration.
[0365] The specific implementation process of step 1810 is similar to the specific implementation process of the above step 1310. The difference is that step 1810 determines the third score based on the write performance index, while step 1310 determines the first score based on the write response speed, and the scoring objects of the two are different. To save space, it will not be repeated.
[0366] It should be noted that the better the write performance index is, the better the throughput of the blockchain information storage space is, and the shorter the required first duration is. Therefore, the write performance index and the third score change in direct proportion. The better the write performance index is, the higher the third score is.
[0367] In step 1820, a fourth score is determined based on the target processing accuracy.
[0368] The fourth score is used to measure the performance of the target processing accuracy in determining the first duration.
[0369] The specific implementation process of step 1820 is similar to the specific implementation process of the above step 1310. The difference is that step 1820 determines the fourth score based on the target processing accuracy, while step 1310 determines the first score based on the write response speed, and the scoring objects of the two are different. To save space, it will not be repeated.
[0370] It should be noted that the higher the target processing accuracy, the slower the throughput of the blockchain information storage space, and the longer the required first duration will be. Therefore, the target processing accuracy and the fourth score change in inverse proportion. The higher the target processing accuracy, the lower the fourth score.
[0371] In step 1830, a first duration is determined based on the third score and the fourth score.
[0372] In the specific implementation of this embodiment, firstly, the third weight of the third score and the fourth weight of the fourth score are obtained. Then, the third score and the fourth score are weighted and summed according to the third weight and the fourth weight to obtain a weighted total score. Finally, the first duration is determined according to the weighted total score.
[0373] The third weight is used to indicate the importance of the write performance index when writing the block status information into the blockchain information storage space in determining the first duration. The fourth weight is used to indicate the importance of the target processing accuracy in determining the first duration. The sum of the third weight and the fourth weight is 1.
[0374] When determining the first duration according to the weighted total score, first obtain the second relationship comparison table, wherein the second relationship comparison table is used to indicate the first duration corresponding to each score interval. Then, determine the score interval where the weighted total score is located in the second relationship comparison table, and use the first duration corresponding to the score interval where the weighted total score is located as the determined first duration.
[0375] For example, in the second relationship comparison table, the first duration corresponding to the score interval [0,20] is 10s; the first duration corresponding to the score interval (20,40] is 8s; the first duration corresponding to the score interval (20,40] is 8s;
[0376] The first duration corresponding to the score interval (40, 60] is 6 seconds; the first duration corresponding to the score interval (60, 80] is 4 seconds; the first duration corresponding to the score interval (80, 100] is 2 seconds. When the weighted sum of the third score and the fourth score is 66 points, the first duration is determined to be 4 seconds.
[0377] Through the above steps 1810-1830, the embodiment of the present disclosure comprehensively determines the first duration by combining the write performance index when writing the block status information into the blockchain information storage space and the target processing accuracy, and can determine the first duration from multiple dimensions and aspects, thereby improving the accuracy of the determined first duration.
[0378] Reference Fig.19 In some embodiments, the write performance index includes a write response speed and a remaining processing capacity of a write processing unit. Step 1810 includes but is not limited to the following steps 1910-1930:
[0379] Step 1910: Determine a first sub-score based on the write response speed;
[0380] Step 1920: Determine a second sub-score based on the remaining processing capacity of the write processing unit;
[0381] Step 1930: Determine a third score based on the first sub-score and the second sub-score.
[0382] Steps 1910-1930 are described in detail below.
[0383] The first sub-score is used to measure the performance of the write response speed when writing the block status information into the blockchain information storage space in determining the first duration.
[0384] The second sub-score is used to measure the performance of the remaining processing capacity of the write processing unit when writing the block state information into the blockchain information storage space in determining the first duration.
[0385] The specific implementation process of steps 1910-1930 is similar to the specific implementation process of steps 1310-1330, and will not be described in detail to save space.
[0386] Through the above steps 1910-1930, the embodiment of the present disclosure comprehensively determines the third score of the write performance indicator in determining the first duration by combining the write response speed when writing the block status information into the blockchain information storage space and the remaining processing capacity of the write processing unit, which can improve the accuracy of the scoring of the write performance indicator and thus improve the accuracy of the determined first duration.
[0387] Detailed description of the implementation details of the blockchain-based data processing method disclosed in the present invention
[0388] Refer to the following Fig. 20 , Fig.21 , which illustrates in detail the implementation details of the blockchain-based data processing method of the embodiment of the present disclosure.
[0389] like Fig. 20 As shown in the figure, it is the implementation process of writing the target block information into the intermediate log and writing the block status information of the target block information into the blockchain information storage space:
[0390] First, execute step 2010, receive the transaction chain request of the object, and determine the target block information to be written based on the transaction chain request. The specific implementation process is similar to the specific implementation process of the above step 310.
[0391] Next, step 2020 is executed to write the target block information into the intermediate log redo log, and its specific implementation process is similar to the specific implementation process of the above step 320.
[0392] Next, execute step 2030 to write the first transaction summary value of the transaction in the target block information, the transaction receipt, the block header and other target block information into the blockchain information storage space in real time. The specific implementation process is similar to the specific implementation process of the above step 330.
[0393] Finally, execute step 2040 to maintain the first mapping table in the blockchain information storage space. The specific implementation process is similar to the specific implementation process of generating the first mapping table in the above step 710.
[0394] like Fig.21 As shown in the figure, it is the implementation process of writing each transaction in the target block information into the blockchain information storage space:
[0395] First, execute step 2110 to determine whether the blockchain system is in an idle state. The determination of whether the blockchain system is in an idle state can be determined based on whether the write speed of the blockchain information storage space meets the first condition, and its specific implementation process is similar to the specific implementation process of the above step 340.
[0396] Next, execute step 2120. If the blockchain system is in a space state, extract each delayed transaction from the intermediate log redo log, and write each extracted transaction into the blockchain information storage space. The specific implementation process is similar to the specific implementation process of the above step 340.
[0397] Finally, step 2130 is executed to determine that all transactions have been written into the blockchain information storage space, and the target block information is deleted from the intermediate log redo log. The specific implementation process is similar to the specific implementation process of the above steps 910-920.
[0398] Refer to the following Fig. 22 , the interaction process between the terminal and the server in the blockchain-based data processing method of an embodiment of the present disclosure is described in detail and exemplarily.
[0399] like Fig. 22 As shown, the interaction process between the object terminal and the blockchain system server of the blockchain-based data processing method of an embodiment of the present disclosure is described in detail, and the process includes but is not limited to the following steps 2201 to 2216.
[0400] Step 2201: The target terminal 140 sends a transaction on-chain request to the blockchain system server 110;
[0401] Step 2202: The blockchain system server 110 obtains target block information to be written into the blockchain information storage space based on the transaction on-chain request;
[0402] Step 2203, the blockchain system server 110 writes the target block information into the intermediate log;
[0403] Step 2204: The blockchain system server 110 writes the block header and the first transaction summary value into the target block to record it into the blockchain, and writes the transaction receipt and the associated resource pool status into the blockchain auxiliary storage space;
[0404] Step 2205: The target terminal 140 sends a resource processing transaction request to the blockchain system server 110;
[0405] Step 2206: The blockchain system server 110 processes the resources in the associated resource pool based on the resource processing transaction request, and updates the status of the associated resource pool;
[0406] Step 2207: The blockchain system server 110 generates a first mapping table in the blockchain information storage space;
[0407] Step 2208: The target terminal 140 sends a transaction on-chain request to the blockchain system server 110;
[0408] Step 2209: The blockchain system server 110 calculates the second transaction digest value of the transaction to be on-chain in the transaction on-chain request;
[0409] Step 2210: If the second transaction summary value is the same as a first transaction summary value in the first mapping table, the blockchain system server 110 rejects the transaction on-chain request;
[0410] Step 2211, the blockchain system server 110 sends a feedback to the target terminal 140 rejecting the transaction on-chain request;
[0411] Step 2212: The blockchain system server 110 determines whether the writing speed of the blockchain information storage space meets the first condition;
[0412] Step 2213: If the writing speed of the blockchain information storage space meets the first condition, the blockchain system server 110 obtains the writing performance index of the blockchain information storage space;
[0413] Step 2214: The blockchain system server 110 determines whether the write performance index of the blockchain information storage space meets the second condition;
[0414] Step 2215: If it is determined that the write performance indicator meets the second condition, the blockchain system server 110 writes each transaction of the intermediate log into the blockchain information storage space;
[0415] Step 2216: After confirming that all transactions have been written into the blockchain information storage space, the blockchain system server 110 deletes the target block information from the intermediate log.
[0416] It can be understood that the specific process of steps 2201-2202 is similar to step 310 in the above embodiment. The specific process of step 2203 is similar to step 320 in the above embodiment. The specific process of step 2204 is similar to step 330 in the above embodiment. The specific process of steps 2205-2206 is similar to steps 610-620 in the above embodiment. The specific process of step 2207 is similar to step 710 in the above embodiment. The specific process of steps 2208-2211 is similar to steps 720-730 in the above embodiment. The specific process of step 2212 is similar to step 340 in the above embodiment. The specific process of steps 2213-2215 is similar to steps 1210-1230 in the above embodiment. The specific process of step 2216 is similar to steps 910-920 in the above embodiment. In order to save space, it will not be repeated here.
[0417] Description of the apparatus and device of the present disclosure
[0418] It is to be understood that, although the steps in the above-mentioned flowcharts are sequentially displayed according to the characterization of arrows, these steps are not necessarily executed in sequence according to the order of arrow characterization. Unless there is a clear description in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the above-mentioned flowcharts can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0419] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to the characteristics of the target object such as the target object attribute information or attribute information set, the permission or consent of the target object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain the attribute information of the target object, the separate permission or separate consent of the target object will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the separate permission or separate consent of the target object, the necessary target object-related data used to enable the normal operation of the embodiment of the present application is obtained.
[0420] Fig.23 A schematic diagram of the structure of a blockchain-based data processing device 2300 provided in an embodiment of the present disclosure. The blockchain-based data processing device 2300 includes:
[0421] An acquisition unit 2310 is used to acquire target block information to be written into the blockchain information storage space, wherein the target block information includes each transaction included in the target block and block status information of the target block;
[0422] The first writing unit 2320 is used to write the target block information into the intermediate log;
[0423] The second writing unit 2330 is used to write the block status information into the blockchain information storage space after determining that the target block information has been written into the intermediate log;
[0424] The third writing unit 2340 is used to detect the writing speed of the blockchain information storage space. If the writing speed meets the first condition, each transaction in the intermediate log is written into the blockchain information storage space until the writing speed of the blockchain information storage space meets the first condition.
[0425] Optionally, the data processing device 2300 further includes a confirmation unit (not shown), and the confirmation unit (not shown) is used to:
[0426] Confirm that each transaction has been written into the blockchain information storage space;
[0427] Delete the target block information from the intermediate log.
[0428] Optionally, the data processing device 2300 further includes a recovery unit (not shown), and the recovery unit (not shown) is used to:
[0429] If a blockchain node executing the data processing method fails before each transaction is written into the blockchain information storage space, the location of the target block information in the intermediate log is recorded with the first pointer;
[0430] If the blockchain node fails and recovers, the target block information in the intermediate log is located based on the first pointer, and each transaction in the target block information is written into the blockchain information storage space.
[0431] Optionally, the blockchain information storage space includes the blockchain and the blockchain auxiliary storage space, and the block status information includes the first transaction summary value of each transaction, the transaction receipt of each transaction, the block header of the target block, and the associated resource pool status after the transaction is executed;
[0432] The second writing unit 2330 is used for:
[0433] Write the block header and the first transaction summary value into the target block to record it into the blockchain, and write the transaction receipt and the associated resource pool status into the blockchain auxiliary storage space;
[0434] The third writing unit 2340 is used for:
[0435] Write each transaction in the intermediate log to the target block on the blockchain.
[0436] Optionally, the data processing device 2300 further includes a state updating unit (not shown), and the state updating unit (not shown) is used to:
[0437] In response to a resource processing transaction request received after each transaction included in the target block, the resource processing transaction request is directed to an associated resource pool;
[0438] Based on the resource processing transaction request, the resources in the associated resource pool are processed and the status of the associated resource pool is updated.
[0439] Optionally, the data processing device 2300 further includes a transaction chaining unit (not shown), and the transaction chaining unit (not shown) is used to:
[0440] Generate a first mapping table, the first mapping table indicating a mapping relationship between the first transaction summary value and the target block;
[0441] In response to a transaction on-chain request received after each transaction included in the target block, calculate a second transaction digest value of the transaction to be on-chained in the transaction on-chain request;
[0442] If the second transaction digest value is the same as a first transaction digest value in the first mapping table, the transaction on-chain request is rejected.
[0443] Optionally, the first mapping table is generated in the following manner:
[0444] In the blockchain information storage space, determine the mapping relationship between each block and the summary value of each transaction in the block;
[0445] Based on multiple mapping relationships in the blockchain information storage space, a first mapping table is constructed.
[0446] Optionally, the third writing unit 2340 specifically includes:
[0447] A first indicator acquisition unit (not shown), used to acquire a write performance indicator of the blockchain information storage space;
[0448] A writing unit (not shown), configured to write each transaction in the intermediate log into the blockchain information storage space if it is determined that the writing performance indicator meets the second condition;
[0449] A delayed writing unit (not shown) is used to delay writing each transaction in the intermediate log into the blockchain information storage space if it is determined that the writing performance indicator does not meet the second condition.
[0450] Optionally, the target block information is multiple target block information;
[0451] The third writing unit 2340 specifically includes:
[0452] A second indicator acquisition unit (not shown), used to acquire a write performance indicator of the blockchain information storage space;
[0453] a ratio determination unit (not shown), configured to determine a first ratio based on the write performance indicator;
[0454] a number determination unit (not shown), configured to determine a first number based on the number of target block information and a first ratio;
[0455] A selection unit (not shown) is used to select a first number of target block information from a plurality of target block information to obtain delayed target block information;
[0456] An information writing unit (not shown) is used to write each transaction of the delayed target block information in the intermediate log into the blockchain information storage space if the writing speed meets the first condition.
[0457] Optionally, the information writing unit (not shown) is specifically used for:
[0458] The real-time level of obtaining information of multiple target blocks;
[0459] The plurality of target block information are sorted according to the real-time level, and the first number of target block information in the sorting are selected.
[0460] Optionally, the block status information includes the first transaction summary value of each transaction, the transaction receipt of each transaction, the block header of the target block, and the associated resource pool status after the transaction is executed;
[0461] The intermediate log includes a first key-value pair for indicating each transaction, a second key-value pair for indicating a first transaction summary value of each transaction, a third key-value pair for indicating a transaction receipt of each transaction, a fourth key-value pair for indicating a block header, and a fifth key-value pair for indicating the state of an associated resource pool after the transaction is executed;
[0462] The first writing unit 2320 is used for:
[0463] Get the block height and block summary of the target block;
[0464] Generate the first key-value pair using the block height, block summary, and each transaction as keywords and the summary result of each transaction as the value;
[0465] Generate a second key-value pair using the block height, block summary, and the first transaction summary value of each transaction as keywords and the summary result of the first transaction summary value of each transaction as a value;
[0466] Generate a third key-value pair using the block height, block summary, and transaction receipt of each transaction as keywords and the summary result of the transaction receipt of each transaction as a value;
[0467] Generate a fourth key-value pair using the block height, block summary, and block header as keywords and the summary result of the block header as a value;
[0468] A fifth key-value pair is generated using the block height, the block summary, and the associated resource pool state after the transaction is executed as keywords, and the summary result of the associated resource pool state after the transaction is executed as a value.
[0469] Reference Fig.24 , Fig.24The structural block diagram of the terminal part of the data processing method based on blockchain in the embodiment of the present disclosure is as follows: the terminal includes: radio frequency (RF) circuit 2410, memory 2415, input unit 2430, display unit 2440, sensor 2450, audio circuit 2460, wireless fidelity (WiFi) module 2470, processor 2480, power supply 2490 and other components. Those skilled in the art can understand that Fig.24 The terminal structure shown does not constitute a limitation on the mobile phone or computer, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0470] The RF circuit 2410 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 2480 for processing; in addition, the designed uplink data is sent to the base station.
[0471] The memory 2415 may be used to store software programs and modules. The processor 2480 executes various functional applications and data processing of the target terminal by running the software programs and modules stored in the memory 2415 .
[0472] The input unit 2430 may be used to receive input digital or character information and generate key signal input related to the setting and function control of the target terminal. Specifically, the input unit 2430 may include a touch panel 2431 and other input devices 2432.
[0473] The display unit 2440 may be used to display input information or provided information and various menus of the target terminal. The display unit 2440 may include a display panel 2441.
[0474] The audio circuit 2460, the speaker 2461, and the microphone 2462 may provide an audio interface.
[0475] In this embodiment, the processor 2480 included in the terminal can execute the blockchain-based data processing method of the previous embodiment.
[0476] The terminals of the embodiments of the present disclosure include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiments of the present invention can be applied to various scenarios, including but not limited to data security, blockchain, data storage, information technology, etc.
[0477] Fig.25A block diagram of the structure of a portion of a server for implementing a blockchain-based data processing method according to an embodiment of the present disclosure. The server may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 2522 (e.g., one or more processors) and memory 2532, and one or more storage media 2130 (e.g., one or more mass storage devices) storing application programs 2542 or data 2544. Among them, the memory 2532 and the storage medium 2530 may be short-term storage or permanent storage. The program stored in the storage medium 2530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 2522 may be configured to communicate with the storage medium 2530 and execute a series of instruction operations in the storage medium 2530 on the server.
[0478] The server may also include one or more power supplies 2525, one or more wired or wireless network interfaces 2550, one or more input and output interfaces 2558, and / or one or more operating systems 2541, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0479] The central processor 2522 in the server can be used to execute the blockchain-based data processing method of the embodiment of the present disclosure.
[0480] The embodiments of the present disclosure also provide a computer-readable storage medium, which is used to store program codes, and the program codes are used to execute the blockchain-based data processing methods of the aforementioned embodiments.
[0481] The embodiment of the present disclosure also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, so that the computer device executes and implements the above-mentioned transaction on-chain.
[0482] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "comprises" and "comprising" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0483] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0484] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to not include the number, and above, below, within, etc. are understood to include the number.
[0485] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0486] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0487] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0488] 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 disclosure 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 a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0489] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.
[0490] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Technical personnel familiar with the art can also make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.
Claims
1. A data processing method based on blockchain, characterized in that: include: Obtaining target block information to be written into the blockchain information storage space, wherein the target block information includes each transaction included in the target block and block status information of the target block; Writing the target block information into an intermediate log; After determining that the target block information has been written into the intermediate log, writing the block status information into the blockchain information storage space; The writing speed of the blockchain information storage space is detected, and if the writing speed satisfies a first condition, each of the transactions in the intermediate log is written into the blockchain information storage space.
2. The data processing method according to claim 1, characterized in that: After writing each of the transactions in the intermediate log into the blockchain information storage space, the data processing method further includes: Determining that each of the transactions has been written into the blockchain information storage space; The target block information is deleted from the intermediate log.
3. The data processing method according to claim 2, characterized in that: Before determining that each of the transactions has been written into the blockchain information storage space, the data processing method further includes: If a blockchain node executing the data processing method fails before each of the transactions is written into the blockchain information storage space, the location of the target block information in the intermediate log is recorded with a first pointer; If the blockchain node fails and recovers, the target block information in the intermediate log is located based on the first pointer, and each transaction in the target block information is written into the blockchain information storage space.
4. The data processing method according to claim 1, characterized in that: The blockchain information storage space includes a blockchain and a blockchain auxiliary storage space, and the block status information includes a first transaction summary value of each transaction, a transaction receipt of each transaction, a block header of the target block, and an associated resource pool status after the transaction is executed; Writing the block status information into the blockchain information storage space includes: writing the block header and the first transaction summary value into the target block to record them into the blockchain, and writing the transaction receipt and the associated resource pool status into the blockchain auxiliary storage space; Writing each of the transactions in the intermediate log into the blockchain information storage space includes: writing each of the transactions in the intermediate log into the target block on the blockchain.
5. The data processing method according to claim 4, characterized in that: After writing the transaction receipt and the associated resource pool status into the blockchain auxiliary storage space, and before writing each of the transactions in the intermediate log into the blockchain information storage space, the data processing method further includes: In response to a resource processing transaction request received after each of the transactions included in the target block, the resource processing transaction request is directed to the associated resource pool; Based on the resource processing transaction request, resources in the associated resource pool are processed, and the state of the associated resource pool is updated.
6. The data processing method according to claim 4, characterized in that: After writing the block status information into the blockchain information storage space, the data processing method further includes: Generate a first mapping table, wherein the first mapping table indicates a mapping relationship between the first transaction summary value and the target block; In response to a transaction on-chain request received after each of the transactions included in the target block, calculating a second transaction digest value of the transaction to be on-chained in the transaction on-chain request; If the second transaction digest value is the same as one of the first transaction digest values in the first mapping table, the transaction on-chain request is rejected.
7. The data processing method according to claim 6, characterized in that: The first mapping table is generated in the following manner: In the blockchain information storage space, determining a mapping relationship between each block and a summary value of each transaction in the block; Based on the multiple mapping relationships in the blockchain information storage space, the first mapping table is constructed.
8. The data processing method according to claim 1, characterized in that: Writing each of the transactions in the intermediate log into the blockchain information storage space includes: Obtaining a write performance indicator of the blockchain information storage space; If it is determined that the write performance indicator meets the second condition, each of the transactions in the intermediate log is written into the blockchain information storage space; If it is determined that the write performance indicator does not meet the second condition, the writing of each of the transactions in the intermediate log into the blockchain information storage space is delayed.
9. The data processing method according to claim 1, characterized in that: The target block information is a plurality of target block information; Writing each of the transactions in the intermediate log into the blockchain information storage space includes: Obtaining a write performance indicator of the blockchain information storage space; Based on the write performance indicator, determining a first ratio; Determining a first number based on the number of target block information and the first ratio; Selecting a first number of the target block information from the plurality of the target block information to obtain delayed target block information; If the writing speed satisfies the first condition, each transaction of the delayed target block information in the intermediate log is written into the blockchain information storage space.
10. The data processing method according to claim 9, characterized in that: The selecting a first number of the target block information from the plurality of the target block information comprises: Obtaining the real-time level of the information of the plurality of target blocks; The plurality of target block information are sorted according to the real-time level, and the target block information of the last first number in the sorting is selected.
11. The data processing method according to claim 1, characterized in that: The block status information includes the first transaction summary value of each transaction, the transaction receipt of each transaction, the block header of the target block, and the associated resource pool status after the transaction is executed; The intermediate log includes a first key-value pair for indicating each of the transactions, a second key-value pair for indicating a first transaction summary value of each of the transactions, a third key-value pair for indicating a transaction receipt of each of the transactions, a fourth key-value pair for indicating the block header, and a fifth key-value pair for indicating a state of an associated resource pool after the transaction is executed; The step of writing the target block information into an intermediate log includes: Obtaining the block height and block summary of the target block; Generate the first key-value pair by using the block height, the block summary, and each of the transactions as keywords and the summary result of each of the transactions as a value; Generate the second key-value pair by using the block height, the block summary, and the first transaction summary value of each transaction as keywords, and using the summary result of the first transaction summary value of each transaction as a value; Generate the third key-value pair by using the block height, the block summary, and the transaction receipt of each transaction as keywords and the summary result of the transaction receipt of each transaction as a value; Generate the fourth key-value pair using the block height, the block summary, and the block header as keywords and the summary result of the block header as a value; The fifth key-value pair is generated by taking the block height, the block summary, and the associated resource pool state after the transaction is executed as keywords, and taking the summary result of the associated resource pool state after the transaction is executed as a value.
12. A data processing device based on blockchain, characterized in that: The data processing device comprises: An acquisition unit, configured to acquire target block information to be written into the blockchain information storage space, wherein the target block information includes each transaction included in the target block and block status information of the target block; A first writing unit, used for writing the target block information into an intermediate log; A second writing unit, configured to write the block status information into the blockchain information storage space after determining that the target block information has been written into the intermediate log; The third writing unit is used to detect the writing speed of the blockchain information storage space, and if the writing speed meets the first condition, write each of the transactions in the intermediate log into the blockchain information storage space.
13. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the blockchain-based data processing method described in any one of claims 1 to 11 is implemented.
14. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the blockchain-based data processing method according to any one of claims 1 to 11 is implemented.
15. A computer program product, comprising a computer program, wherein the computer program is read and executed by a processor of a computer device, so that the computer device executes the blockchain-based data processing method according to any one of claims 1 to 11.