Data block generation method, device, electronic device, and computer-readable storage medium

By establishing a block index table in the blockchain system and quickly determining and sending the target data based on the block number, the problem of low block efficiency in blockchain technology is solved and the rapid uploading of data is achieved.

CN114443640BActive Publication Date: 2025-09-26ASIAINFO TECH CHINA INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011205942.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-02
Publication Date
2025-09-26
Estimated Expiration
2040-11-02

AI Technical Summary

Technical Problem

Existing blockchain technology performs poorly in terms of block generation efficiency, resulting in slow data upload.

Method used

By establishing a block index table between the terminal and the node, the target data can be quickly determined and sent for on-chain processing based on the correspondence between the block number and the data.

Benefits of technology

It improves the speed of data on-chain, solves the speed bottleneck when a large amount of data needs to be on-chain, and realizes the rapid and concurrent on-chain of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114443640B_ABST
    Figure CN114443640B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a data block generation method, device, electronic device, and computer-readable storage medium, relating to the field of blockchain. The method comprises: receiving a block generation request sent by at least one node, wherein the block generation request includes at least one block number; and sending target data corresponding to the block number to a target node corresponding to the block generation request according to a preset block generation index table, so that the target node performs on-chain processing on the target data, wherein the block generation index table includes a correspondence between block numbers and data. The embodiments of the present application enable data to be quickly and concurrently generated, data to be uploaded to the chain, thereby improving the data upload speed and resolving the problem of slow upload speed caused by the need to upload a large amount of data to the chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology. Specifically, the present application relates to a data block generation method, device, electronic device and computer-readable storage medium. Background Art

[0002] Blockchain is a new application model for computer technologies, including distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain features decentralization, immutability, full traceability, traceability, collective maintenance, and openness and transparency. These characteristics guarantee the integrity and transparency of blockchain, laying the foundation for building trust in it.

[0003] The development of blockchain, from blockchain 2.0 to blockchain 3.0, has often focused on performance issues. Solving performance issues is the mission of blockchain 3.0, but most current blockchain technology frameworks do not perform well in terms of performance issues. The existing block generation scheme is linear, and the block generation efficiency is low. Summary of the Invention

[0004] The purpose of this application is to solve at least one of the above technical deficiencies, and the following technical solutions are proposed:

[0005] In a first aspect, a method for generating data blocks is provided, which is applied to a terminal. The method for generating data blocks includes:

[0006] Receive a block request sent by at least one node, where the block request includes at least one block number;

[0007] According to a preset block index table, the target data corresponding to the block number is sent to the target node corresponding to the block request, so that the target node can process the target data on the chain, wherein the block index table includes the correspondence between the block number and the data.

[0008] In a second aspect, a data block generation method is provided, which is applied to a node of a blockchain system. The data block generation method includes:

[0009] Sending a block request to the terminal, the block request including at least one block number, so that the terminal sends at least one target data corresponding to the at least one block number to a target node corresponding to the block request according to a preset block index table, wherein the block index table includes a correspondence between block numbers and data;

[0010] The received target data is uploaded to the chain for processing.

[0011] In a third aspect, a data block output device is provided, which is applied to a terminal. The data block output device includes:

[0012] A request receiving module, configured to receive a block request sent by at least one node, the block request including at least one block number;

[0013] The data sending module is used to send the target data corresponding to the block number to the target node corresponding to the block request according to the preset block index table, so that the target node can process the target data on the chain, wherein the block index table includes the correspondence between the block number and the data.

[0014] In a fourth aspect, a data block generation device is provided, which is applied to a node of a blockchain system, and the data block generation device includes:

[0015] A request sending module, configured to send a block request to a terminal, the block request including at least one block number, so that the terminal sends at least one target data corresponding to the block number to a target node corresponding to the block request according to a preset block index table, wherein the block index table includes a correspondence between block numbers and data;

[0016] The uplink module is used to process the received target data on the uplink.

[0017] According to a fifth aspect, an electronic device is provided, comprising:

[0018] one or more processors;

[0019] Memory;

[0020] One or more applications, wherein the one or more applications are stored in a memory and configured to be executed by one or more processors, and the one or more programs are configured to: execute the data blocking method shown in the first aspect or the second aspect of the present application.

[0021] In a sixth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the data block output method shown in the first aspect or the second aspect of the present application is implemented.

[0022] The technical solution provided by the present application has the following beneficial effects: a terminal can receive a block request sent by at least one node, the block request including at least one block number, and send the target data corresponding to the block number to the target node corresponding to the block request according to a preset block index table, so that the target node can process the target data on the chain, thereby enabling the data to be quickly and concurrently issued into blocks and uploaded to the chain, thereby improving the data upload speed and solving the problem of a large amount of data needing to be uploaded to the chain, resulting in a slow upload speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments of the present application.

[0024] Figure 1 A flowchart of a data block generation method provided in an embodiment of the present application;

[0025] Figure 2 A data block generation method provided in an embodiment of the present application also includes a flow chart;

[0026] Figure 3 for Figure 1 Detailed flow diagram of step S102;

[0027] Figure 4 A flowchart of another data block generation method provided in an embodiment of the present application;

[0028] Figure 5 for Figure 4 Detailed flow diagram of step S402;

[0029] Figure 6 A schematic structural diagram of a data block output device provided in an embodiment of the present application;

[0030] Figure 7 A schematic structural diagram of another data block output device provided in an embodiment of the present application;

[0031] Figure 8 A schematic diagram of the structure of an electronic device for data block output provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The following describes in detail embodiments of the present application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application and are not to be construed as limiting the present invention.

[0033] Those skilled in the art will appreciate that, unless expressly stated otherwise, the singular forms "a", "an", "" and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of this application refers to the presence of features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, "connected" or "coupled" as used herein may include wireless connections or wireless couplings. The term "and / or" as used herein includes all or any units and all combinations of one or more associated listed items.

[0034] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0035] The data block generation method, device, electronic device, and computer-readable storage medium provided in this application are intended to solve the above technical problems in the prior art.

[0036] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0037] The data block method provided in this application can be applied to Figure 1 In the application environment shown. Specifically,

[0038] Those skilled in the art will understand that the “terminal” used here may be a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), an MID (Mobile Internet Device), etc.; the “server” may be implemented as an independent server or a server cluster consisting of multiple servers.

[0039] See also Figure 1 In an embodiment of the present application, a data block method is provided. The data block method can be applied to a terminal. The method includes:

[0040] S101: Receive a block request sent by at least one node, where the block request includes at least one block number.

[0041] A blockchain system includes numerous nodes, known as block nodes, which can function as consensus nodes or accounting nodes. All nodes are connected to terminals. Nodes can store consensus-based data in the terminals. The specific type of data is not limited; for example, the data can be transaction data.

[0042] All data of the nodes in the blockchain system can be stored in the terminal's in-memory database. The in-memory database has good performance, high availability and scalability.

[0043] In this application, there may be multiple blockchain systems connected to the terminal. Different blockchain systems can be connected to the same terminal, and nodes in different blockchain systems can store data in the terminal's memory database. Data from different blockchain systems is stored in different data tables.

[0044] In a blockchain system, nodes, after reaching consensus, can act as block producers and send block production requests to terminals. One or more nodes can send block production requests to a terminal at the same time. Multiple nodes sending block production requests simultaneously can be from the same blockchain system. Nodes from different blockchain systems can also send block production requests to a terminal simultaneously.

[0045] A block request may include one or more block numbers. A node may contain multiple block production threads, each used to produce blocks. The number of block production threads in a node is the same as the number of block numbers included in the node's block request.

[0046] The block number is used to find the data corresponding to the block number.

[0047] S102: According to a preset block index table, the target data corresponding to the block number is sent to the target node corresponding to the block request, so that the target node processes the target data on the chain, wherein the block index table includes the correspondence between the block number and the data.

[0048] The block index table is pre-set. It contains the correspondence between block numbers and data. Based on this table, the data corresponding to the block number, also known as the target data, can be determined. Once the target data is determined, it is sent to the node corresponding to the block request, also known as the target node, which then uploads the target data to the blockchain. Different blockchain systems correspond to different block index tables; that is, each blockchain system's data corresponds to a separate block index table.

[0049] When a block request includes multiple block numbers, the terminal sends the multiple target data corresponding to the multiple block numbers to the target node corresponding to the block request. Specifically, if the terminal receives a block request A from target node B, and block request A includes block numbers A1, A2, and A3, the terminal sends the target data corresponding to block numbers A1, A2, and A3 to target node B.

[0050] The data block generation method provided by the embodiments of the present application is that a terminal can receive a block generation request sent by at least one node, the block generation request including at least one block number, and according to a preset block generation index table, send the target data corresponding to the block number to the target node corresponding to the block generation request, so that the target node can process the target data on the chain, thereby enabling the data to be quickly and concurrently generated and the data to be on the chain, thereby improving the data on-chain speed and solving the problem of a large amount of data needing to be on-chain, resulting in a slow on-chain speed.

[0051] See also Figure 2, the embodiment of the present application further provides a possible implementation manner, before receiving a block generation request sent by at least one node, the data block generation method further includes:

[0052] S201: Store the received data of the nodes of the blockchain system in a data table of the memory database, where each data includes basic information of the data, wherein data corresponding to different blockchain systems are stored in different data tables.

[0053] The in-memory database includes multiple data tables. The number of data tables corresponds to the number of blockchain systems. Each data table stores the data of a blockchain system, and the data corresponding to different blockchain systems are stored in different data tables.

[0054] Basic data information refers to the relevant information about the data. It may include transaction number, transaction content, transaction size, transaction timestamp, etc. Each data item only includes one transaction number and transaction timestamp. Each transaction number corresponds to only one data item.

[0055] S202: Generate a correspondence between the block number and basic data information according to the preset block generation scheme and node data.

[0056] The block generation plan is used to determine the time to generate the correspondence between block numbers and basic data information. The specific block generation plan is not limited. For example, the time for the correspondence between block numbers and basic data information to be generated exceeds the preset time, or the amount of data for which the correspondence between block numbers and basic data information is not generated exceeds the preset amount of data.

[0057] The basic data information corresponds to the block number. In this application, the transaction number of the basic data information corresponds to the block number, so that each piece of data corresponds to only one block number, and each block number corresponds to only one piece of data. The specific number of the block number can be set according to a preset rule. In this application, the block number increases according to the numerical increment method. For example, the first block number is 1. For each subsequent block number, the value of the new block number increases by 1. That is, the second block number is 2, the third block number is 3, and the fourth block number is 4. The block number value increases according to this numerical increment method.

[0058] S203: Store the corresponding relationship in the block index table.

[0059] After generating the correspondence between the block number and the basic information of the data, the correspondence can be stored in the block index table, so that after receiving the block request, the data corresponding to the block number of the block request can be sent to the node corresponding to the block request.

[0060] The technical solution of the embodiment of the present application generates a correspondence between block numbers and basic data information, and stores the correspondence in a block index table. After receiving a block request, the data corresponding to the block request can be quickly determined, thereby improving the efficiency of chain processing after the data is blocked.

[0061] The embodiment of the present application also provides a possible implementation method, which generates a correspondence between block numbers and basic data information based on a preset block generation scheme and node data, including:

[0062] If any of the following conditions is met: the amount of unblocked data is greater than a preset number threshold, the size of the unblocked data is greater than a preset storage threshold, and the time for not receiving a block request is greater than a preset time threshold, a correspondence between the block number and the basic information of the data is generated according to the data of the node.

[0063] Unblocked data refers to data that has not been sent to the node for on-chain processing. The amount of unblocked data refers to the amount of data that has not been sent to the node for on-chain processing. There is no limit on the preset number threshold, for example, the preset number threshold can be 10, 20, 35, etc. The size of unblocked data refers to the amount of data that has not been sent to the node for on-chain processing. There is no limit on the size of the preset storage threshold, for example, the preset storage threshold can be 10Mb, 15Mb, etc. The preset time threshold is not limited, for example, it can be 10 minutes, 1 hour, etc. If the time for not receiving a block request is greater than the preset time threshold, it is possible that the stored data has not yet generated a corresponding block number. Therefore, data without a corresponding block number cannot be sent to the node, and data without a corresponding block number cannot be processed on-chain.

[0064] See also Figure 3 The embodiment of the present application further provides a possible implementation method, which sends the target data corresponding to the block number to the target node corresponding to the block request according to the preset block index table, including:

[0065] S301: Obtain basic data information according to the block number and block index table.

[0066] The block request includes a block number, and the block index table includes the correspondence between the block number and the basic data information of the data. Based on this correspondence, the basic data information corresponding to the block number can be determined. In this embodiment, the basic data information is the transaction number of the data. It will be appreciated that if there are multiple block numbers, such as multiple block numbers in a block request, it is necessary to obtain the basic data information corresponding to each block number.

[0067] S302: Determine target data based on basic data information.

[0068] After determining the basic data information, the data corresponding to the basic data information, i.e., the target data, can be determined. For example, after determining the transaction number, the data corresponding to the transaction number can be determined. It will be appreciated that after obtaining multiple basic data information, the target data corresponding to each basic data information can be determined.

[0069] S303: Send the target data to the target node corresponding to the block request.

[0070] If the terminal simultaneously receives a block request A sent by the target node B and a block request C sent by the target node D, where the block request A includes block numbers A1, A2, and A3, and the block request C includes block numbers C1 and C2, then the terminal will send the target data corresponding to block numbers A1, A2, and A3 respectively to the target node B, and the terminal will send the target data corresponding to block numbers C1 and C2 respectively to the target node D.

[0071] The technical solution of the embodiment of the present application can quickly determine the target data corresponding to the block number, send the target data to the corresponding node, and can concurrently send the block to the chain, thereby improving the efficiency of data on-chain processing.

[0072] See also Figure 4 In an embodiment of the present application, a data block method is provided. The data block method can be applied to a node of a blockchain system. The method includes:

[0073] S401: Sending a block request to a terminal, where the block request includes at least one block number, so that the terminal sends at least one target data corresponding to the at least one block number to a target node corresponding to the block request according to a preset block index table, wherein the block index table includes a correspondence between block numbers and data.

[0074] Only nodes that have reached consensus can send block generation requests to the terminal. Through consensus, nodes can obtain the block numbers corresponding to the data to be generated. After reaching consensus, nodes can obtain one or more block numbers and then send block generation requests including the block numbers to the terminal. Once the terminal obtains the block numbers, it can send the data corresponding to the block numbers to the node.

[0075] S402: Uplink processing is performed on the received target data.

[0076] After receiving the target data, the node can process the target data on the chain.

[0077] According to the method of the embodiment of the present application, the terminal can receive a block request sent by at least one node, where the block request includes at least one block number, and according to a preset block index table, send the target data corresponding to the block number to the target node corresponding to the block request, so that the target node can process the target data on the chain, thereby enabling the data to be quickly and concurrently issued into blocks and the data to be on the chain, thereby improving the data on-chain speed and solving the problem of a large amount of data needing to be on-chain, resulting in a slow on-chain speed.

[0078] See also Figure 5 The embodiment of the present application also provides a possible implementation method for uplinking the received target data, including:

[0079] S501: Packing at least one received target data so that each target data forms a block of data, and each block of data includes a block number corresponding to the target data.

[0080] If the target data includes multiple data, each target data can be packaged in the order of block numbers so that each target data forms a block data. The block data includes the block number corresponding to the target data, that is, the block number corresponding to the block data.

[0081] S502: Send the block data to at least one accounting node so that each accounting node caches the block data separately. If the block number of the block data is continuous with the block number of the last block data on the chain, the accounting node will store the cached block data with the block number continuous with the last block data on the chain on the chain.

[0082] Accounting nodes are used to store block data on-chain. There can be one or more accounting nodes. When a node sends block data to an accounting node, it can do so using a peer-to-peer (P2P) communication protocol. If block data corresponding to multiple target data items is identified, each of these target data items can be sent simultaneously to the corresponding accounting nodes.

[0083] After receiving block data, a bookkeeping node caches the block data. Only when the block number of the cached block data is continuous with the block number of the last block data uploaded to the chain will the bookkeeping node upload the cached block data with a continuous block number to the chain. If the block number of the block data is not continuous with the block number of the last block data uploaded to the chain, the bookkeeping node waits to receive other block data. Specifically, if the block number of the last block data uploaded to the chain is 5 and the block number of the cached block data is 7, and block numbers 7 and 5 are not continuous, the bookkeeping node will continue to wait until it receives and caches block data with block number 6. Only then will it upload block data with block number 6 to the chain for storage, and then upload block data with block number 7 to the chain for storage.

[0084] See also Figure 6 The embodiment of the present application provides a data block output device 600, which can be applied to a terminal. The data block output device 600 may include:

[0085] A request receiving module 601 is configured to receive a block generation request from at least one node, where the block generation request includes at least one block number.

[0086] The data sending module 602 is used to send the target data corresponding to the block number to the target node corresponding to the block request according to the preset block index table, so that the target node can process the target data on the chain, wherein the block index table includes the correspondence between the block number and the data.

[0087] The data block generation device provided by the embodiments of the present application can receive a block generation request sent by at least one node, and the block generation request includes at least one block number. The terminal can send the target data corresponding to the block number to the target node corresponding to the block generation request according to the preset block generation index table, so that the target node can process the target data on the chain, thereby enabling the data to be quickly and concurrently generated and the data to be on the chain, thereby improving the data on-chain speed and solving the problem of a large amount of data needing to be on-chain, resulting in a slow on-chain speed.

[0088] The embodiment of the present application further provides a possible implementation method, in which the data block output device 600 may further include:

[0089] A data table storage module is used to store the received data of the blockchain system nodes in a data table of the memory database, where each data includes basic information of the data, wherein the data corresponding to different blockchain systems are stored in different data tables;

[0090] The relationship generation module is used to generate the corresponding relationship between the block number and the basic data information according to the preset block generation plan and the node data;

[0091] The index table storage module is used to store the corresponding relationship in the block index table.

[0092] The embodiment of the present application also provides a possible implementation method, a relationship generation module, which can be specifically used to: if any of the following conditions is met: the number of unblocked data is greater than a preset number threshold, the size of the unblocked data is greater than a preset storage threshold, and the time for not receiving a block request is greater than a preset time threshold, a corresponding relationship between the block number and the basic information of the data is generated according to the data of the node.

[0093] This embodiment of the present application further provides a possible implementation method, in which the data sending module 602 may include:

[0094] An information acquisition unit, used to obtain basic data information based on the block number and the block index table;

[0095] A data determination unit, configured to determine target data based on basic data information;

[0096] The data sending unit is used to send the target data to the target node corresponding to the block request.

[0097] See also Figure 7 The embodiment of the present application provides a data block generating device 700, which can be applied to a node of a blockchain system. The data block generating device 700 may include:

[0098] The request sending module 701 is configured to send a block request to a terminal, where the block request includes at least one block number, so that the terminal sends at least one target data corresponding to the block number to a target node corresponding to the block request according to a preset block index table, where the block index table includes a correspondence between block numbers and data.

[0099] The uplink module 702 is used to perform uplink processing on the received target data.

[0100] In the apparatus of the embodiment of the present application, the terminal can receive a block request sent by at least one node, the block request including at least one block number, and send the target data corresponding to the block number to the target node corresponding to the block request according to the preset block index table, so that the target node can process the target data on the chain, thereby enabling the data to be quickly and concurrently issued blocks and the data to be on the chain, thereby improving the data on-chain speed and solving the problem of a large amount of data needing to be on-chain, resulting in a slow on-chain speed.

[0101] This embodiment of the present application further provides a possible implementation method, in which the uplink module 702 may include:

[0102] a packing unit, configured to pack at least one received target data so that each target data forms a block of data, and each block of data includes a block number corresponding to the target data;

[0103] The on-chain unit is used to send block data to at least one accounting node, so that each accounting node caches the block data separately. If the block number of the block data is continuous with the block number of the last block data on the chain, the accounting node will store the cached block data with a block number continuous with the last block data on the chain on the chain.

[0104] See also Figure 8 In an optional embodiment, an electronic device is provided. The electronic device 8000 includes: a processor 8001 and a memory 8003. The processor 8001 and the memory 8003 are connected, for example, via a bus 8002. Optionally, the electronic device 8000 may further include a transceiver 8004. It should be noted that in actual applications, the number of transceivers 8004 is not limited to one, and the structure of the electronic device 8000 does not constitute a limitation on the embodiments of the present application.

[0105] The processor 8001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor 8001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0106] Bus 8002 may include a path for transmitting information between the aforementioned components. Bus 8002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, for example. Bus 8002 may be divided into an address bus, a data bus, a control bus, and so on. For ease of illustration, the figure shows only one thick line, but this does not indicate that there is only one bus or only one type of bus.

[0107] The memory 8003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0108] The memory 8003 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 8001. The processor 8001 is used to execute the application code stored in the memory 8003 to implement the content shown in the above method embodiment.

[0109] Among them, electronic equipment includes but is not limited to: terminals and servers.

[0110] An electronic device is provided in an embodiment of the present application, which includes: a memory and a processor; at least one program, stored in the memory, for implementing the corresponding content in the aforementioned method embodiment when executed by the processor. Compared with the prior art, it can be achieved that: a terminal can receive a block request sent by at least one node, the block request includes at least one block number, and according to a preset block index table, the target data corresponding to the block number is sent to the target node corresponding to the block request, so that the target node performs on-chain processing on the target data, thereby enabling the data to be quickly and concurrently issued blocks and the data to be on-chain, thereby improving the data on-chain speed and solving the problem that a large amount of data needs to be on-chain, resulting in a slow on-chain speed.

[0111] The embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed on a computer, enables the computer to execute the corresponding contents of the aforementioned method embodiment. Compared with the prior art, the terminal can receive a block request sent by at least one node, the block request including at least one block number, and according to a preset block index table, send the target data corresponding to the block number to the target node corresponding to the block request, so that the target node performs on-chain processing on the target data, thereby enabling the data to be quickly and concurrently issued blocks and the data to be on-chain, thereby improving the data on-chain speed and solving the problem that a large amount of data needs to be on-chain, resulting in a slow on-chain speed.

[0112] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0113] The above are only some of the embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A data block method, characterized in that: Applied to a terminal, the method includes: Generate a correspondence between a block number and basic data information based on a preset block generation scheme and node data; store the correspondence in a block generation index table; receive a block generation request sent by at least one node of the blockchain system, the block generation request including the block number of at least one data requested by the at least one node; wherein the consensus data of the nodes of the blockchain system are stored in a memory database of the terminal, the basic data information of each data has a corresponding block number, and the correspondence between the basic data information of each data and the block number is stored in the preset block generation index table; If multiple block generation requests are received, determine the basic data information corresponding to the block number in each block generation request according to the preset block generation index table, determine the corresponding target data according to the basic data information, and determine the target node corresponding to each block generation request; For each block request, the target data corresponding to the block number is sent to the target node corresponding to the block request, so that multiple target nodes can process their respective target data on the chain in parallel, wherein the block index table includes the correspondence between block numbers and data; Generating a correspondence between the block number and the basic data information according to a preset block generation scheme and the node data includes: If any of the following conditions is met: the amount of unblocked data is greater than a preset amount threshold, the size of the unblocked data is greater than a preset storage threshold, and the time for not receiving the block request is greater than a preset time threshold, a correspondence between the block number and the basic information of the data is generated according to the data of the node.

2. The data block generation method according to claim 1, characterized in that: Before generating the correspondence between the block number and the basic data information according to the preset block generation scheme and the node data, the method further includes: The received data of the nodes of the blockchain system are stored in a data table of the memory database, where each data includes basic information of the data, wherein the data corresponding to different blockchain systems are stored in different data tables.

3. The data block generation method according to claim 1, wherein: The block number is increased according to a numerical auto-increment method.

4. A data block method, characterized in that: Applied to a node of a blockchain system, the method includes: Sending a block request to a terminal, the block request including at least one block number, so that the terminal sends at least one target data corresponding to the at least one block number to a target node corresponding to the block request according to a preset block index table, wherein the block index table includes a correspondence between the block number and basic information of the data; Performing uplink processing on the received target data; The data of the nodes of the blockchain system that have reached consensus are stored in the memory database of the terminal, and the basic information of each data has a corresponding block number; the target data corresponding to the block number in the block request is determined by the terminal in the following manner: If multiple block generation requests are received, determine the basic data information corresponding to the block number in each block generation request according to the preset block generation index table; Determine the corresponding target data based on the basic information of the data, and determine the target node corresponding to each block request; For each block request, the target data corresponding to the block number is sent to the target node corresponding to the block request, so that multiple target nodes can process their respective target data on the chain in parallel, wherein the block index table includes the correspondence between block numbers and data; The corresponding relationship included in the block generation index table is generated by the terminal according to the preset block generation scheme and the data of the node in the following manner: If any of the following conditions is met: the amount of unblocked data is greater than a preset amount threshold, the size of the unblocked data is greater than a preset storage threshold, and the time for not receiving the block request is greater than a preset time threshold, a correspondence between the block number and the basic information of the data is generated according to the data of the node.

5. The data block generation method according to claim 4, characterized in that: The uplink processing of the received target data includes: Packing at least one of the received target data so that each target data forms a block of data, each of the block of data including a block number corresponding to the target data; The block data is sent to at least one accounting node, so that each accounting node caches the block data respectively. If the block number of the block data is continuous with the block number of the last block data on the chain, the accounting node stores the cached block data with a block number continuous with the last block data on the chain on the chain.

6. A data block device, applied to a terminal, characterized in that: The device comprises: A request receiving module, configured to generate a correspondence between a block number and basic data information based on a preset block generation scheme and node data; store the correspondence in a block generation index table; receive a block generation request sent by at least one node of a blockchain system, the block generation request including the block number of at least one data requested by the at least one node; wherein the consensus data of the nodes of the blockchain system is stored in a memory database of the terminal, the basic data information of each data has a corresponding block number, and the correspondence between the basic data information of each data and the block number is stored in a preset block generation index table; A data sending module is configured to, upon receiving multiple block generation requests, determine the basic data information corresponding to the block number in each block generation request based on a preset block generation index table, determine the corresponding target data based on the basic data information, and determine the target node corresponding to each block generation request; for each block generation request, send the target data corresponding to the block number to the target node corresponding to the block generation request, so that the multiple target nodes can perform parallel on-chain processing on their respective target data, wherein the block generation index table includes the correspondence between block numbers and data; When the request receiving module generates a correspondence between the block number and the basic information of the data according to a preset block generation scheme and the data of the node, it is specifically used to: If any of the following conditions is met: the amount of unblocked data is greater than a preset amount threshold, the size of the unblocked data is greater than a preset storage threshold, and the time for not receiving the block request is greater than a preset time threshold, a correspondence between the block number and the basic information of the data is generated according to the data of the node.

7. A data block generating device, applied to a node of a blockchain system, characterized in that: The device comprises: a request sending module, configured to send a block request to a terminal, wherein the block request includes at least one block number, so that the terminal sends at least one target data corresponding to the block number to a target node corresponding to the block request according to a preset block index table, wherein the block index table includes a correspondence between block numbers and basic information of the data; An uplink module, configured to perform uplink processing on the received target data; The data of the nodes of the blockchain system that have reached consensus are stored in the memory database of the terminal, and the basic information of each data has a corresponding block number; the target data corresponding to the block number in the block request is determined by the terminal in the following manner: If multiple block generation requests are received, determine the basic data information corresponding to the block number in each block generation request according to the preset block generation index table; Determine the corresponding target data based on the basic information of the data, and determine the target node corresponding to each block request; For each block request, the target data corresponding to the block number is sent to the target node corresponding to the block request, so that multiple target nodes can process their respective target data on the chain in parallel, wherein the block index table includes the correspondence between block numbers and data; The corresponding relationship included in the block generation index table is generated by the terminal according to the preset block generation scheme and the data of the node in the following manner: If any of the following conditions is met: the amount of unblocked data is greater than a preset amount threshold, the size of the unblocked data is greater than a preset storage threshold, and the time for not receiving the block request is greater than a preset time threshold, a correspondence between the block number and the basic information of the data is generated according to the data of the node.

8. An electronic device, characterized in that: It includes: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to: execute the data block output method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the data block output method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Block generation method and device, block chain node and storage medium

    CN110399424A

  • Data auditing method and device based on block chain network

    CN110599322A