A method, device and electronic device for determining transactions to be confirmed on blockchain
By using the transaction processing device to be confirmed in the blockchain network to communicate with multiple blockchain nodes, the problem of synchronization delay of transaction data is solved, accurate statistics and query of transaction confirmation is realized, and transaction fee calculation and networking are improved. Monitoring efficiency.
Patent Information
- Application Number
- CN202011644285.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2040-12-31
AI Technical Summary
In the blockchain network, the different network segments and geographical locations of the blockchain nodes lead to delays in synchronization of transaction data, making it difficult to accurately and comprehensively obtain transaction information to be confirmed, affecting transaction fee calculation and network congestion monitoring.
Through the transaction processing device to be confirmed, the transaction data to be confirmed is connected to multiple blockchain nodes, the transaction data to be confirmed is obtained and stored, the transaction data to be confirmed is carried out, and the statistics are repeated when the newly uploaded transaction data is received, using hash value comparison and details Information acquisition mechanism to ensure data consistency and accuracy.
It achieves a timely and accurate grasp of the number of transactions to be packaged on the blockchain network, helps to calculate the best handling fee and monitor network congestion, and improves the efficiency of users' transaction status query to be confirmed.
Smart Images

Figure CN112669156B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a method, device and electronic device for determining transactions to be confirmed on a blockchain. Background Art
[0002] After the creation of the "Genesis Block", the blockchain shared value system was emulated by many cryptocurrencies, and improvements were made in proof of work and algorithms. The blockchain ecosystem continues to evolve around the world. People are currently using this shared value system to develop decentralized computer programs in various industries and build decentralized autonomous organizations and decentralized autonomous communities around the world. However, no matter how the blockchain and its corresponding value system evolve, it still operates around the three basic concepts of blocks, addresses, and transactions.
[0003] A miner collects and packages transactions through the transaction broadcast channel. A list of transactions to be packaged is maintained inside each miner program. Due to the point-to-point transmission characteristics of the blockchain network, the transaction content and weight of the transactions to be packaged in the list of transactions to be packaged maintained by each miner are different. When these transactions to be packaged are not packaged into blocks and published on the blockchain, the total transaction amount of all these transactions to be packaged, their respective transaction fees, etc. will determine the speed at which these transactions are packaged into blocks. Therefore, being able to grasp the transactions to be packaged of all nodes on the network at the first time will play an important role in calculating the best transaction fee, understanding the network congestion situation, and querying the status of transactions to be confirmed issued by users themselves. Summary of the invention
[0004] Therefore, the present invention provides a method, device and electronic device for determining transactions to be confirmed on a blockchain, so as to quickly and accurately obtain transactions to be packaged on a blockchain network.
[0005] According to the first aspect, an embodiment of the present invention discloses a method for determining blockchain pending confirmation transactions, which is used for a pending confirmation transaction processing device, wherein the pending confirmation transaction processing device is communicatively connected to multiple blockchain nodes in a blockchain network, and the multiple blockchain nodes are located in different network segments and / or different geographical locations. The method includes: obtaining and storing the existing pending confirmation transaction data in each blockchain node, and performing a quantity counting operation on the acquired pending confirmation transactions; when receiving the newly uploaded pending confirmation transaction data from any of the blockchain nodes, repeatedly responding to the statistical operation on the number of pending confirmation transactions in the blockchain network.
[0006] Optionally, the transaction data to be confirmed includes: a hash value of the transaction to be confirmed; when receiving the transaction data to be confirmed newly uploaded by any of the blockchain nodes, repeatedly responding to the statistical operation of the number of transactions to be confirmed in the blockchain network, including: when receiving the hash value of the transaction to be confirmed newly uploaded by the blockchain node, comparing the hash value of the transaction to be confirmed with the acquired historical hash value database; when the hash value of the transaction to be confirmed does not exist in the historical hash value database, storing the hash value of the transaction to be confirmed in the historical hash value database and sending an instruction to obtain detailed information of the transaction to be confirmed to the blockchain node that uploaded the transaction to be confirmed; and associating the received detailed information of the transaction to be confirmed with the hash value of the transaction to be confirmed.
[0007] Optionally, the method further includes: sending stored transaction records to be confirmed to the multiple blockchain nodes.
[0008] Optionally, the method further includes: when the stored transactions to be confirmed are packaged into the chain, deleting the transaction data that has been packaged into the chain from the database storing the transactions to be confirmed.
[0009] Optionally, the method further includes: upon receiving a query instruction for transaction information to be confirmed, feeding back transaction information to be confirmed corresponding to the query instruction for transaction information to be confirmed.
[0010] According to the second aspect, an embodiment of the present invention discloses a method for determining blockchain pending confirmation transactions, which is used for any blockchain node among multiple blockchain nodes located in different network segments and / or different geographical locations in a blockchain network, and the multiple blockchain nodes located in different network segments and / or different geographical locations are respectively communicated with pending confirmation transaction processing devices, and the method includes: sending existing pending confirmation transactions to the pending confirmation transaction processing device; when a new pending confirmation transaction is received, sending the new pending confirmation transaction data to the pending confirmation transaction processing device, so that the pending confirmation transaction processing device performs quantitative statistics on the acquired pending confirmation transactions.
[0011] Optionally, the new transaction data to be confirmed includes a hash value of the new transaction to be confirmed; the method also includes: when a new transaction to be confirmed is received, sending the hash value of the new transaction to be confirmed to the transaction processing device to be confirmed; when an instruction to obtain detailed information of the transaction to be confirmed sent by the transaction processing device to be confirmed is received, sending detailed data of the new transaction to be confirmed to the transaction processing device to be confirmed.
[0012] Optionally, the method also includes: receiving stored transaction records to be confirmed sent by a transaction processing device to be confirmed; when a new transaction to be confirmed is received, comparing the new transaction to be confirmed with the stored transaction records to be confirmed; when the new transaction to be confirmed is not included in the stored transaction records to be confirmed, sending the new transaction data to the transaction processing center to be confirmed.
[0013] According to the third aspect, an embodiment of the present invention further discloses a blockchain pending confirmed transaction determination device, which is used for a pending confirmed transaction processing device, wherein the pending confirmed transaction processing device is communicatively connected to multiple blockchain nodes in a blockchain network, and the multiple blockchain nodes are located in different network segments and / or different geographical locations. The device includes: a first execution module, which is used to obtain and store the existing pending confirmed transaction data in each blockchain node, and perform quantity statistics operations on the acquired pending confirmed transactions; and a second execution module, which is used to repeatedly respond to the statistical operation on the number of pending confirmed transactions in the blockchain network when receiving newly uploaded pending confirmed transaction data from any of the blockchain nodes.
[0014] According to the fourth aspect, an embodiment of the present invention also discloses a blockchain pending confirmed transaction determination device, which is used for any blockchain node among multiple blockchain nodes located in different network segments and / or different geographical locations in a blockchain network, and the multiple blockchain nodes located in different network segments and / or different geographical locations are respectively communicated with pending confirmed transaction processing devices, and the device includes: a first sending module, used to send existing pending confirmed transactions to the pending confirmed transaction processing device; a second sending module, used to send the new pending confirmed transaction data to the pending confirmed transaction processing device when a new pending confirmed transaction is received, so that the pending confirmed transaction processing device performs quantitative statistics on the acquired pending confirmed transactions.
[0015] According to the fifth aspect, an embodiment of the present invention also discloses an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method for determining blockchain transactions to be confirmed as described in the first aspect or any optional implementation manner of the first aspect, or the second aspect or any optional implementation manner of the second aspect.
[0016] According to the sixth aspect, an embodiment of the present invention further discloses a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method for determining blockchain transactions to be confirmed as described in the first aspect or any optional embodiment of the first aspect, or the second aspect or any optional embodiment of the second aspect are implemented.
[0017] The technical solution of the present invention has the following advantages:
[0018] The blockchain pending transaction determination method / device provided by the present invention communicates and connects with multiple blockchain nodes located in different network segments and / or different geographical locations through a pending transaction processing device, obtains and stores existing pending transactions in each blockchain node that is communicated with it through the pending transaction processing device, performs a quantity counting operation on the acquired pending transactions, and when receiving the pending transaction data newly uploaded by any blockchain node, promptly repeats the statistical operation on the number of pending transactions in the blockchain network, so that the pending transaction processing device can timely perform statistical processing on the number of pending transactions on the blockchain network, and can grasp the pending transactions of all nodes on the network at the first time, which plays an important role in calculating the optimal transaction fee, grasping the network congestion situation, and querying the status of pending transactions issued by users themselves. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 This is a flowchart of a specific example of a method for determining a blockchain transaction to be confirmed in an embodiment of the present invention;
[0021] Figure 2 This is a flowchart of a specific example of a method for determining a blockchain transaction to be confirmed in an embodiment of the present invention;
[0022] Figure 3 It is a principle block diagram of a specific example of a device for determining a blockchain transaction to be confirmed in an embodiment of the present invention;
[0023] Figure 4 It is a principle block diagram of a specific example of a device for determining a blockchain transaction to be confirmed in an embodiment of the present invention;
[0024] Figure 5 FIG. 4 is a specific example diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0027] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, it can also be the internal connection of two components, it can be a wireless connection, or it can be a wired connection. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0028] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0029] When transaction data is submitted to the blockchain, due to the different network segments and / or geographical locations of the blockchain nodes in the blockchain network, the synchronization of the same transaction data to each blockchain node may be delayed to varying degrees, resulting in different blockchain nodes receiving the same transaction data at different times. In order to accurately and comprehensively obtain pending transactions in the blockchain network, the pending transaction processing device in the blockchain pending transaction determination method provided in the embodiment of the present application is communicatively connected to multiple blockchain nodes in the blockchain network, wherein the multiple connected blockchain nodes are located in different network segments and / or different geographical locations.
[0030] The transaction processing device to be confirmed can be a centralized device independent of the blockchain network, or it can be any blockchain node in the blockchain network, so that in addition to assuming the basic functions of the blockchain, the blockchain node also undertakes statistical operations on the amount of transaction data to be confirmed in the blockchain network.
[0031] The embodiment of the present invention discloses a method for determining a blockchain transaction to be confirmed, which is used in a transaction processing device to be confirmed, such as Figure 1 As shown, the method comprises the following steps:
[0032] Step 101, obtain and store the existing pending transaction data in each blockchain node, and perform a quantity counting operation on the acquired pending transactions.
[0033] Exemplarily, the existing pending transactions in each blockchain node can be that when the pending transaction processing device is connected to any blockchain node, it sends a transaction data acquisition instruction to the corresponding blockchain node, so that the blockchain node receiving the instruction sends all the pending transaction data existing in the current node to the pending transaction processing device. When the pending transaction data uploaded by any connected blockchain node is received, the statistical operation of the amount of pending transaction data in the blockchain network is responded.
[0034] Step 102, when receiving the newly uploaded transaction data to be confirmed by any of the blockchain nodes, repeatedly respond to the statistical operation of the number of transactions to be confirmed in the blockchain network.
[0035] Exemplarily, since the pending transactions of any blockchain node in the blockchain network will change dynamically over time, when any blockchain node receives a new pending transaction (such as a pending transaction that is synchronized due to delay factors, or a pending transaction newly uploaded by a user node), the new pending transaction data will be transmitted to the pending transaction processing device. When the pending transaction processing device receives the pending transaction data newly uploaded by any blockchain node, it will repeatedly respond to the statistical operation of the number of pending transactions in the blockchain network, so that the pending transaction processing device can timely perform statistical processing on the number of pending transactions on the blockchain network, and can grasp the pending transactions of all nodes on the network at the first time, which plays an important role in calculating the optimal transaction fee, grasping the network congestion situation, and querying the status of pending transactions issued by users themselves.
[0036] As an optional implementation of the present invention, the transaction data to be confirmed includes: a hash value of the transaction to be confirmed; step 102 includes:
[0037] When receiving the hash value of the transaction to be confirmed newly uploaded by the blockchain node, the hash value of the transaction to be confirmed is compared with the acquired historical hash value database; when the hash value of the transaction to be confirmed does not exist in the historical hash value database, the hash value of the transaction to be confirmed is stored in the historical hash value database and an instruction to obtain detailed information of the transaction to be confirmed is sent to the blockchain node that uploaded the transaction to be confirmed;
[0038] Exemplarily, the transaction data to be confirmed may include the hash value of the transaction to be confirmed, and the hash value is the digital fingerprint of the transaction to be confirmed. Each transaction to be confirmed has one and only one hash value. When the transaction data to be confirmed in each blockchain node is obtained, the hash value of the transaction to be confirmed is stored synchronously to construct a historical hash value database of transactions to be confirmed. When any blockchain node receives a new transaction to be confirmed, it first sends the hash value of the newly received transaction to be confirmed to the transaction processing device to be confirmed, and the transaction processing device to be confirmed compares the hash value of the newly uploaded transaction to be confirmed with the hash value contained in the historical hash value database; the received detailed information of the transaction to be confirmed is associated with the hash value of the transaction to be confirmed.
[0039] When the new data to be confirmed in any blockchain node is the data to be confirmed that has just been synchronized from other blockchain nodes in the blockchain network, since the time when the transaction to be confirmed was received by other blockchain nodes is earlier than the blockchain node that has just synchronized to the transaction to be confirmed, the transaction to be confirmed that has just been synchronized may have been sent to the transaction processing device to be confirmed by the blockchain node that has synchronized to the transaction to be confirmed earlier. Therefore, for the hash value of the transaction to be confirmed newly uploaded by any blockchain node, the hash value is compared with the historical hash value database. When the hash value of the transaction to be confirmed is included in the historical hash value database, the newly received transaction information to be confirmed is ignored; when the hash value of the transaction to be confirmed does not exist in the historical hash value database, the hash value of the transaction to be confirmed is stored in the historical hash value database, the historical hash value database is updated, and a detailed information acquisition instruction for the transaction to be confirmed is sent to the blockchain node that uploaded the transaction to be confirmed, so that the blockchain node that uploaded the transaction to be confirmed uploads the detailed information of the transaction to be confirmed, and the detailed information of the transaction to be confirmed is associated with the hash value of the confirmed transaction and stored. The detailed information of the transaction to be confirmed may include any of the transaction time, transaction fee, transaction amount, transaction sender and receiver address data. The embodiment of the present application does not limit the type of information included in the detailed information of the transaction to be confirmed, and those skilled in the art may determine it according to actual needs.
[0040] As an optional embodiment of the present invention, the method further includes: sending stored transaction records to be confirmed to the multiple blockchain nodes.
[0041] Exemplarily, since the transaction data in the blockchain network will be synchronized to each blockchain node, but there is a time delay in each blockchain node synchronizing to the same pending transaction, the same pending transaction may be uploaded to the pending transaction processing device by multiple blockchain nodes, so that the pending transaction processing device repeatedly responds to the number counting operation of the same pending transaction, which wastes the computing resources of the pending transaction processing device, and multiple blockchain nodes repeatedly upload the same pending transaction, which will also occupy the communication channel resources. Therefore, the pending transaction processing device of the embodiment of the present application sends the stored pending transaction record to each blockchain node, and the timing of sending can be sent according to the preset interval time, or when the data of the stored pending transaction changes, the pending transaction record is sent to each blockchain node, so that the blockchain node receiving the pending transaction record compares the newly received pending transaction with the pending transaction record, and when the new confirmed transaction is included in the pending transaction record, the upload operation of the newly received pending transaction is stopped; when the new confirmed transaction is not included in the pending transaction record, the new pending transaction is sent to the pending transaction processing center for blockchain pending transaction number statistics and storage. The stored transaction records to be confirmed sent by the transaction processing device to each blockchain node may only contain the hash value of the transaction to be confirmed. Since any transaction to be confirmed corresponds to a unique hash value, by sending the hash value to the blockchain node for comparison by the blockchain node, the accuracy of the comparison result is ensured. Due to the small amount of hash value data, the occupancy of the data transmission channel is reduced and the transmission efficiency of the transaction records to be confirmed is improved.
[0042] As an optional implementation of the present invention, the method further includes: when the stored transactions to be confirmed are packaged into the chain, deleting the transaction data packaged into the chain from the database storing the transactions to be confirmed.
[0043] Exemplarily, the method for determining whether the stored pending transactions are packaged into the chain can be to receive all the current pending transaction data sent by each blockchain node at a preset interval, and compare the pending transaction data of the blockchain nodes obtained twice adjacently. When the pending transaction data is not included in the transaction data obtained for the second time, it indicates that the transaction data not included in the second transaction data obtained has been packaged and chained, and the transaction data not included in the existing pending transaction data sent for the second time is deleted; the method for determining whether the stored pending transactions are packaged into the chain can also be to parse the generated new block, obtain the transaction data contained in the new block, and search in the database storing the pending transactions according to the transaction data contained in the obtained new block, and delete the transaction data contained in the retrieved new block from the database. By regularly clearing the transaction data that has been packaged and chained, it is avoided that the transaction data that has been chained occupies the storage resources of the pending transaction processing device.
[0044] As an optional implementation manner of the present invention, the method further includes: when receiving a query instruction for transaction information to be confirmed, feeding back transaction information to be confirmed corresponding to the query instruction for transaction information to be confirmed.
[0045] Exemplarily, by setting up an interactive module with the user, the user can upload an information query instruction through the interactive module, and the corresponding pending transaction information is fed back to the user according to the type of information to be queried corresponding to the information query instruction. If the user wants to query the information of all pending transactions within a period of time, the time range and the corresponding type of information to be queried can be set through the interactive module, and the pending transaction processing device will feed back the corresponding confirmed transaction information to the user according to the user's query conditions.
[0046] The embodiment of the present invention discloses a method for determining a blockchain transaction to be confirmed, which is used for any blockchain node among multiple blockchain nodes located in different network segments and / or different geographical locations in a blockchain network, such as Figure 2 As shown, the method includes:
[0047] Step 201: Send the existing transaction to be confirmed to the transaction processing device to be confirmed. Please refer to the above embodiment for details, which will not be repeated here.
[0048] Step 202: When a new transaction to be confirmed is received, the new transaction data to be confirmed is sent to the transaction processing device to be confirmed, so that the transaction processing device to be confirmed counts the number of the acquired transactions to be confirmed.
[0049] As an optional implementation of the present application, the new transaction data to be confirmed includes a hash value of the new transaction to be confirmed; the method further includes: when a new transaction to be confirmed is received, the hash value of the new transaction to be confirmed is sent to the transaction processing device to be confirmed; when a detailed information acquisition instruction for the transaction to be confirmed is received from the transaction processing device to be confirmed, the detailed data of the new transaction to be confirmed is sent to the transaction processing device to be confirmed. For details, please refer to the above embodiment, which will not be repeated here.
[0050] As an optional implementation of the present application, the method further includes: receiving a stored transaction record to be confirmed sent by a transaction processing device to be confirmed; when a new transaction to be confirmed is received, comparing the new transaction to be confirmed with the stored transaction record to be confirmed; when the new transaction to be confirmed is not included in the stored transaction record to be confirmed, sending the new transaction data to the transaction processing center to be confirmed. Please refer to the above embodiment for details, which will not be repeated here.
[0051] The embodiment of the present invention also discloses a blockchain pending transaction determination device, which is used for a pending transaction processing device, wherein the pending transaction processing device is communicatively connected with a plurality of blockchain nodes in a blockchain network, and the plurality of blockchain nodes are located in different network segments and / or different geographical locations, such as Figure 3 As shown, the device comprises:
[0052] The first execution module 301 is used to obtain and store the existing pending transaction data in each blockchain node, and perform a quantity counting operation on the acquired pending transactions;
[0053] The second execution module 302 is used to repeatedly respond to the statistical operation of the number of transactions to be confirmed in the blockchain network when receiving the transaction data to be confirmed newly uploaded by any of the blockchain nodes.
[0054] As an optional embodiment of the present invention, the transaction data to be confirmed includes: a hash value of the transaction to be confirmed; the second execution module 301 is also used to compare the hash value of the transaction to be confirmed with the acquired historical hash value database when receiving the hash value of the transaction to be confirmed newly uploaded by the blockchain node; when the hash value of the transaction to be confirmed does not exist in the historical hash value database, the hash value of the transaction to be confirmed is stored in the historical hash value database and an instruction to obtain detailed information of the transaction to be confirmed is sent to the blockchain node that uploaded the transaction to be confirmed; the received detailed information of the transaction to be confirmed is associated with the hash value of the transaction to be confirmed.
[0055] As an optional embodiment of the present invention, the device also includes: a transaction record sending module to be confirmed, which is used to send the stored transaction records to be confirmed to the multiple blockchain nodes.
[0056] As an optional embodiment of the present invention, the device further includes: a deletion module, which is used to delete the transaction data that has been packaged into the chain from the database storing the transaction to be confirmed when the stored transaction to be confirmed is packaged into the chain.
[0057] As an optional implementation of the present invention, the device further includes: a feedback module, which is used to feedback the unconfirmed transaction information corresponding to the unconfirmed transaction query instruction when receiving the unconfirmed transaction information query instruction.
[0058] The embodiment of the present invention further discloses a blockchain pending confirmation transaction determination device, which is used for any blockchain node among multiple blockchain nodes located in different network segments and / or different geographical locations in a blockchain network, wherein the multiple blockchain nodes located in different network segments and / or different geographical locations are respectively connected to the pending confirmation transaction processing device for communication, such as Figure 4 As shown, the device comprises:
[0059] The first sending module 401 is used to send the existing pending transaction to the pending transaction processing device;
[0060] The second sending module 402 is used to send the new transaction data to the transaction processing device when receiving the new transaction to be confirmed, so that the transaction processing device to be confirmed can count the number of the acquired transactions to be confirmed.
[0061] As an optional implementation of the present invention, the new transaction data to be confirmed includes a hash value of the new transaction to be confirmed; the second sending module 402 is further used to send the hash value of the new transaction to be confirmed to the transaction processing device to be confirmed when a new transaction to be confirmed is received; and to send the detailed data of the new transaction to be confirmed to the transaction processing device to be confirmed when a detailed information acquisition instruction for the transaction to be confirmed is received from the transaction processing device to be confirmed.
[0062] As an optional embodiment of the present invention, the device also includes: a receiving module, which is used to receive the stored transaction records to be confirmed sent by the transaction processing device to be confirmed; a comparison module, which is used to compare the new transaction to be confirmed with the stored transaction records to be confirmed when a new transaction to be confirmed is received; and a third sending module, which is used to send the new transaction data to the transaction processing center to be confirmed when the new transaction to be confirmed is not included in the stored transaction records to be confirmed.
[0063] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, the electronic device may include a processor 501 and a memory 502, wherein the processor 501 and the memory 502 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.
[0064] The processor 501 may be a central processing unit (CPU). The processor 501 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0065] The memory 502 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the blockchain pending confirmation transaction determination method in the embodiment of the present invention. The processor 501 executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory 502, that is, the blockchain pending confirmation transaction determination method in the above method embodiment is implemented.
[0066] The memory 502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the processor 501, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 502 may optionally include a memory remotely arranged relative to the processor 501, and these remote memories may be connected to the processor 501 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0067] The one or more modules are stored in the memory 502, and when executed by the processor 501, the following is performed: Figure 1 , Figure 2 A method for determining transactions to be confirmed on a blockchain in the illustrated embodiment.
[0068] For details of the above electronic equipment, please refer to Figure 1 , Figure 2The corresponding related descriptions and effects in the illustrated embodiments can be understood and will not be repeated here.
[0069] Those skilled in the art can understand that the implementation of all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0070] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for determining transactions to be confirmed on a blockchain, characterized in that: For a transaction processing device to be confirmed, the transaction processing device to be confirmed is communicatively connected with a plurality of blockchain nodes in a blockchain network, the plurality of blockchain nodes are located in different network segments and / or different geographical locations, the method comprising: Obtain and store the existing pending transaction data in each blockchain node, and perform quantitative operations on the acquired pending transactions; When receiving the transaction data to be confirmed newly uploaded by any of the blockchain nodes, repeatedly responding to the statistical operation of the number of transactions to be confirmed in the blockchain network; The transaction data to be confirmed includes: a hash value of the transaction to be confirmed; each transaction to be confirmed corresponds to a hash value; When receiving the transaction data to be confirmed newly uploaded by any of the blockchain nodes, repeatedly responding to the statistical operation of the number of transactions to be confirmed in the blockchain network, including: When receiving the hash value of the transaction to be confirmed newly uploaded by the blockchain node, the hash value of the transaction to be confirmed is compared with the acquired historical hash value database; When the hash value of the transaction to be confirmed does not exist in the historical hash value database, the hash value of the transaction to be confirmed is stored in the historical hash value database and an instruction for obtaining detailed information of the transaction to be confirmed is sent to the blockchain node that uploaded the transaction to be confirmed; The received detailed information of the transaction to be confirmed is associated with the hash value of the transaction to be confirmed and stored.
2. The method according to claim 1, characterized in that The method further comprises: Send the stored transaction records to be confirmed to the multiple blockchain nodes.
3. The method according to claim 2, characterized in that The method further comprises: When the stored transactions to be confirmed are packaged into the chain, the transaction data packaged into the chain is deleted from the database storing the transactions to be confirmed.
4. The method according to claim 1, characterized in that: The method further comprises: When receiving a query instruction for transaction information to be confirmed, the query instruction for transaction information to be confirmed is fed back with the transaction information to be confirmed corresponding to the query instruction for transaction to be confirmed.
5. A method for determining transactions to be confirmed on a blockchain, characterized in that: For any blockchain node among a plurality of blockchain nodes located in different network segments and / or different geographical locations in a blockchain network, the plurality of blockchain nodes located in different network segments and / or different geographical locations are respectively connected in communication with a transaction processing device to be confirmed, the method comprising: Sending existing pending transactions to the pending transaction processing device; When a new transaction to be confirmed is received, the new transaction data to be confirmed is sent to the transaction processing device to be confirmed, so that the transaction processing device to be confirmed counts the number of the acquired transactions to be confirmed, and when the transaction data to be confirmed newly uploaded by any of the blockchain nodes is received, the statistical operation of the number of transactions to be confirmed in the blockchain network is repeated; the transaction data to be confirmed includes: a hash value of the transaction to be confirmed; each transaction to be confirmed corresponds to a hash value; When receiving the transaction data to be confirmed newly uploaded by any of the blockchain nodes, repeatedly responding to the statistical operation of the number of transactions to be confirmed in the blockchain network, including: When receiving the hash value of the transaction to be confirmed newly uploaded by the blockchain node, the hash value of the transaction to be confirmed is compared with the acquired historical hash value database; When the hash value of the transaction to be confirmed does not exist in the historical hash value database, the hash value of the transaction to be confirmed is stored in the historical hash value database and an instruction for obtaining detailed information of the transaction to be confirmed is sent to the blockchain node that uploaded the transaction to be confirmed; The received detailed information of the transaction to be confirmed is associated with the hash value of the transaction to be confirmed and stored.
6. The method according to claim 5, characterized in that The new transaction data to be confirmed includes a hash value of the new transaction to be confirmed; the method further includes: When a new transaction to be confirmed is received, the hash value of the new transaction to be confirmed is sent to the transaction processing device to be confirmed; When receiving the instruction for obtaining detailed information of the transaction to be confirmed sent by the transaction processing device to be confirmed, the detailed data of the new transaction to be confirmed is sent to the transaction processing device to be confirmed.
7. The method according to claim 5, characterized in that The method further comprises: Receiving a stored transaction record to be confirmed sent by a transaction processing device to be confirmed; When a new transaction to be confirmed is received, the new transaction to be confirmed is compared with the stored transaction record to be confirmed; When the new transaction to be confirmed is not included in the stored transaction record to be confirmed, the new transaction data to be confirmed is sent to the transaction processing center to be confirmed.
8. A device for determining transactions to be confirmed on a blockchain, characterized in that: Used in a transaction processing device to be confirmed, the transaction processing device to be confirmed is communicatively connected with a plurality of blockchain nodes in a blockchain network, the plurality of blockchain nodes are located in different network segments and / or different geographical locations, the device comprises: The first execution module is used to obtain and store the existing pending transaction data in each blockchain node, and perform a quantity counting operation on the acquired pending transactions; The second execution module is used to repeatedly respond to the statistical operation of the number of transactions to be confirmed in the blockchain network when receiving the transaction data to be confirmed newly uploaded by any of the blockchain nodes; the transaction data to be confirmed includes: the hash value of the transaction to be confirmed; each transaction to be confirmed corresponds to a hash value; The second execution module is further configured to, when receiving a hash value of a transaction to be confirmed newly uploaded by the blockchain node, compare the hash value of the transaction to be confirmed with the acquired historical hash value database; When the hash value of the transaction to be confirmed does not exist in the historical hash value database, the hash value of the transaction to be confirmed is stored in the historical hash value database and an instruction for obtaining detailed information of the transaction to be confirmed is sent to the blockchain node that uploaded the transaction to be confirmed; The received detailed information of the transaction to be confirmed is associated with the hash value of the transaction to be confirmed and stored.
9. A device for determining transactions to be confirmed on a blockchain, characterized in that: For any blockchain node among a plurality of blockchain nodes located in different network segments and / or different geographical locations in a blockchain network, the plurality of blockchain nodes located in different network segments and / or different geographical locations are respectively connected in communication with a transaction processing device to be confirmed, the device comprising: A first sending module, used for sending an existing transaction to be confirmed to a transaction processing device to be confirmed; The second sending module is used to send the new pending transaction data to the pending transaction processing device when receiving the new pending transaction, so that the pending transaction processing device counts the number of the acquired pending transactions, and when receiving the pending transaction data newly uploaded by any of the blockchain nodes, repeatedly responds to the counting operation of the number of pending transactions in the blockchain network; the pending transaction data includes: the hash value of the pending transaction; each pending transaction corresponds to a hash value; When receiving the transaction data to be confirmed newly uploaded by any of the blockchain nodes, repeatedly responding to the statistical operation of the number of transactions to be confirmed in the blockchain network, including: When receiving the hash value of the transaction to be confirmed newly uploaded by the blockchain node, the hash value of the transaction to be confirmed is compared with the acquired historical hash value database; When the hash value of the transaction to be confirmed does not exist in the historical hash value database, the hash value of the transaction to be confirmed is stored in the historical hash value database and an instruction for obtaining detailed information of the transaction to be confirmed is sent to the blockchain node that uploaded the transaction to be confirmed; The received detailed information of the transaction to be confirmed is associated with the hash value of the transaction to be confirmed and stored.
10. An electronic device, characterized in that: include: at least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor performs the steps of the method for determining blockchain transactions to be confirmed as described in any one of claims 1 to 7.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for determining blockchain transactions to be confirmed as described in any one of claims 1 to 7 are implemented.
