Blockchain-based transaction polling method, device, equipment, and medium

By building initial transaction data queues and real-time blockchain information, and dynamically adjusting the polling strategy, the problems of waste of resources and low success rates in blockchain transaction polling are solved, and efficient and accurate tracking of transaction results is achieved.

CN116205735BActive Publication Date: 2025-09-02PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310209960.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2025-09-02
Estimated Expiration
2043-02-27

AI Technical Summary

Technical Problem

In the blockchain transaction polling, the fixed polling time and number of times method will lead to low resource waste and polling success rate, poor system robustness, and inability to accurately track transaction results.

Method used

By building an initial transaction data queue, counting historical polling information, combining real-time blockchain information, dynamically adjusting the polling time and number of times, using prediction formulas to optimize the polling strategy, reducing meaningless requests, and improving transaction polling efficiency.

Benefits of technology

Improve the success rate of transaction polling and system robustness, reduce resource consumption, and ensure that transaction results can be tracked efficiently and accurately under high load conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116205735B_ABST
    Figure CN116205735B_ABST
Patent Text Reader

Abstract

The present invention relates to blockchain technology in the field of financial technology and discloses a blockchain-based transaction polling method, comprising: obtaining real-time transaction data, and when the total number of transaction data in an initial transaction data queue meets a preset queue number threshold and the number of abnormal transaction data in the initial transaction data queue is less than a preset abnormal number threshold, collecting historical polling information of the initial transaction data queue, obtaining real-time blockchain information of the real-time transaction data, calculating optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information, and performing transaction polling on the real-time transaction data based on the optimized polling information to obtain a transaction polling result. The present invention also proposes a blockchain-based transaction polling device, electronic device, and readable storage medium. In the financial field, when a large amount of digital resources are polled for transactions through blockchain, the polling accuracy and efficiency are low. The present invention can improve the efficiency of transaction polling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of financial technology and blockchain technology, and in particular to a blockchain-based transaction polling method, device, electronic device, and readable storage medium. Background Art

[0002] With the rapid development of the internet, virtual technology has been widely applied across various industries, increasingly integrated with blockchain technology. In the financial sector, with the digitization of assets, transactions in securities, insurance, and other businesses are stored on the blockchain to ensure the security of digital assets. However, due to the blockchain's consensus strategy, transactions are not accepted immediately but are first stored in the chain's transaction pool. After verification between nodes, the blockchain bundles a certain number of transaction requests into a block based on the configured block gas limit, the gas used by each transaction in the transaction pool, and the block cycle. Finally, the block is uploaded to the blockchain, completing all transactions within the block.

[0003] In the prior art, for sending transactions and tracking their results, existing libraries, after asynchronously sending multiple transactions, need to continue polling the blockchain client until the transaction is packaged and uploaded to the blockchain before receiving data. To reduce polling overhead, fixed polling times and polling counts can be set. This can meet the business needs of tracking transaction results, given the relatively small data volumes of traditional blockchain projects. However, as business grows, digital asset transactions in scenarios such as flash sales and bulk purchases can cause a large number of transaction requests sent from the backend to accumulate in the blockchain's transaction pool. Transactions are then packaged and uploaded to blocks in batches, significantly increasing the time it takes for consensus mechanisms to confirm and upload the results, making accurate data acquisition impossible. Using fixed polling times and polling counts to poll each transaction result can result in a large number of meaningless requests in a short period of time, occupying system and network resources. Alternatively, the maximum polling count can be reached before the transaction is uploaded to the blockchain, resulting in abnormal results and a low polling success rate. This severely reduces the robustness of the system, leading to excessive resource consumption and low transaction polling accuracy and efficiency. Summary of the Invention

[0004] The present invention provides a blockchain-based transaction polling method, device, electronic device, and readable storage medium, the main purpose of which is to improve the efficiency of transaction polling.

[0005] To achieve the above objectives, the present invention provides a blockchain-based transaction polling method, comprising:

[0006] Building an initial transaction data queue based on a set of historical transaction data, obtaining real-time transaction data, and querying whether the total number of transaction data in the initial transaction data queue meets a preset queue number threshold;

[0007] When the total amount of transaction data in the initial transaction data queue meets a preset queue amount threshold, calculating the abnormal amount of transaction data in the initial transaction data queue;

[0008] When the number of abnormal transaction data in the initial transaction data queue is less than a preset abnormal number threshold, collecting historical polling information of each transaction data in the initial transaction data queue;

[0009] Acquire real-time blockchain information of the real-time transaction data based on a preset blockchain port, and calculate optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information;

[0010] Transaction polling is performed on the real-time transaction data based on the optimized polling information to obtain a transaction polling result.

[0011] Optionally, constructing an initial transaction data queue based on the historical transaction data set includes:

[0012] A preset number of transaction data are selected from the historical transaction data set in chronological order and arranged to obtain the initial transaction data queue.

[0013] Optionally, after querying whether the total amount of transaction data in the initial transaction data queue meets a preset queue amount threshold, the method further includes:

[0014] When the total number of transaction data in the initial transaction data queue does not meet the preset queue number threshold, the real-time transaction data is subjected to transaction polling using a preset polling rule, the real-time transaction data after polling is pushed into the initial transaction data queue to obtain an updated initial transaction data queue, the transaction polling result of the real-time transaction data is recorded, and the process returns to the step of querying whether the total number of transaction data in the initial transaction data queue meets the preset queue number threshold.

[0015] Optionally, after calculating the abnormal number of transaction data in the initial transaction data queue, the method further includes:

[0016] When the number of abnormal transaction data in the initial transaction data queue is greater than or equal to a preset abnormal number threshold, an error is reported to the target client and a new communication blockchain node is replaced.

[0017] Optionally, the calculating the optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information includes:

[0018] Calculate a first predicted polling duration of the real-time transaction data using a preset polling average formula based on the real-time blockchain information and the historical polling information;

[0019] Calculating a second predicted polling duration of the real-time transaction data using a preset time series weighted moving average formula based on the real-time timestamp in the real-time blockchain information and the historical timestamp in the historical polling information;

[0020] Selecting a maximum value from the first predicted polling duration and the second predicted polling duration as the real-time polling duration of the real-time transaction data;

[0021] Calculating a real-time polling interval for the real-time transaction data based on the real-time polling duration and a preset correction coefficient;

[0022] The real-time polling duration and the real-time polling interval are used as optimized polling information for the real-time transaction data.

[0023] Optionally, the calculating the first predicted polling duration of the real-time transaction data by using a preset polling average value formula includes:

[0024]

[0025] Po i =T i ×M′ i

[0026] β i =[Pe i / Tc' max ]+1

[0027] β k =[Pe k / Tc' max ]+1

[0028] β i ≥1, Tc' max =max(Tc k ,Tc max )

[0029] in, Indicates the first prediction polling duration, β k For real-time transaction weight, Po i Indicates the polling time of the i-th transaction data in the initial transaction data queue, T i Indicates the polling interval of the i-th transaction data in the initial transaction data queue, M' i Indicates the actual polling times of the i-th transaction data in the initial transaction data queue, Pe i It represents the number of transactions in the blockchain node transaction pool when the i-th transaction data in the initial transaction data queue is sent, Pe kIndicates the number of transactions in the current blockchain node transaction pool in real-time blockchain information, β i Indicates the transaction weight of the i-th transaction data in the initial transaction data queue, Tc' max Indicates the number of transactions Tc contained in the current block recorded in the real-time blockchain information k And the block recorded in the historical polling information contains the maximum number of transactions Tc max The maximum value of .

[0030] Optionally, the calculating the second predicted polling duration of the real-time transaction data by using a preset time series weighted moving average formula includes:

[0031]

[0032] μ i =γ i / Σ i γ i

[0033] T i =Ts k -Ts i +1

[0034] γ i =T n+1-i

[0035] in, Indicates the second prediction polling duration, μ i Po represents the correlation coefficient of the i-th transaction data in the initial transaction data queue. i represents the polling duration of the i-th transaction data in the initial transaction data queue, γ i represents the relevant weight of the i-th transaction data in the initial transaction data queue, T i Indicates the time interval between the real-time transaction data and the i-th transaction data in the initial transaction data queue, Ts k Indicates the real-time timestamp in the real-time blockchain information, Ts i represents the historical timestamp of the i-th transaction data in the initial transaction data queue in the historical polling information, n represents the total number of transaction data in the initial transaction data queue, γ i =T n+1-i Represents γ i With T i It is a reverse order correspondence.

[0036] In order to solve the above problems, the present invention also provides a transaction polling device based on blockchain, which includes:

[0037] a transaction anomaly query module, configured to construct an initial transaction data queue based on a set of historical transaction data, obtain real-time transaction data, query whether the total number of transaction data in the initial transaction data queue meets a preset queue number threshold, and calculate the number of anomalies in the transaction data in the initial transaction data queue when the total number of transaction data in the initial transaction data queue meets the preset queue number threshold;

[0038] a historical polling information acquisition module, configured to collect historical polling information of each transaction data in the initial transaction data queue when the number of abnormal transaction data in the initial transaction data queue is less than a preset abnormal number threshold;

[0039] An optimized polling information calculation module, configured to obtain the real-time blockchain information of the real-time transaction data based on a preset blockchain port, and calculate the optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information;

[0040] The transaction polling module is used to perform transaction polling on the real-time transaction data based on the optimized polling information to obtain a transaction polling result.

[0041] In order to solve the above problem, the present invention further provides an electronic device, comprising:

[0042] a memory storing at least one computer program; and

[0043] The processor executes the computer program stored in the memory to implement the above-mentioned blockchain-based transaction polling method.

[0044] In order to solve the above problems, the present invention also provides a computer-readable storage medium, which stores at least one computer program. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned blockchain-based transaction polling method.

[0045] The present invention constructs an initial transaction data queue from a collection of historical transaction data, collects historical polling information for each transaction data in the initial transaction data queue, obtains real-time blockchain information for real-time transaction data, and calculates optimized polling information for the real-time transaction data based on the real-time blockchain information and the historical polling information. The polling time and frequency are dynamically adjusted based on both real-time and historical information, thereby improving the success rate of transaction polling and avoiding the occurrence of a large number of meaningless requests occupying system and network resources in a short period of time when a large number of transactions accumulate. This improves the robustness of the system and significantly increases the accuracy and efficiency of transaction polling. Therefore, the blockchain-based transaction polling method, device, electronic device, and computer-readable storage medium proposed in the present invention can improve the efficiency of transaction polling. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 A flowchart of a blockchain-based transaction polling method provided by one embodiment of the present invention;

[0047] Figure 2 A functional module diagram of a blockchain-based transaction polling device provided by one embodiment of the present invention;

[0048] Figure 3 A schematic diagram of the structure of an electronic device for implementing the blockchain-based transaction polling method provided in one embodiment of the present invention.

[0049] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0050] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0051] An embodiment of the present invention provides a blockchain-based transaction polling method. The execution subject of the blockchain-based transaction polling method includes, but is not limited to, at least one of electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present invention. In other words, the blockchain-based transaction polling method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to: a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0052] Reference Figure 1 FIG. 1 is a flow chart of a blockchain-based transaction polling method according to an embodiment of the present invention. In this embodiment, the blockchain-based transaction polling method includes the following steps S1-S5:

[0053] S1. Build an initial transaction data queue based on a historical transaction data set, obtain real-time transaction data, and query whether the total number of transaction data in the initial transaction data queue meets a preset queue number threshold.

[0054] In the embodiment of the present invention, the real-time transaction data refers to the real-time business records obtained in the blockchain, for example, in the financial field, the securities business scenario includes real-time business records such as bulk purchase business, activity (such as a securities flash sale activity) purchase business, etc. st Refers to the maximum amount of transaction data that the initial transaction data queue can accommodate.

[0055] Specifically, the process of constructing an initial transaction data queue based on a historical transaction data set includes:

[0056] A preset number of transaction data are selected from the historical transaction data set in chronological order and arranged to obtain an initial transaction data queue.

[0057] In another optional embodiment of the present invention, after querying whether the total number of transaction data in the initial transaction data queue meets the preset queue number threshold, the method further includes: when the total number of transaction data in the initial transaction data queue does not meet the preset queue number threshold, performing transaction polling on the real-time transaction data using a preset polling rule, pushing the polled real-time transaction data into the initial transaction data queue to obtain an updated initial transaction data queue, recording the transaction polling result of the real-time transaction data, and returning to the step of querying whether the total number of transaction data in the initial transaction data queue meets the preset queue number threshold.

[0058] In the embodiment of the present invention, the preset polling rules include polling time and number of polling, etc., and fixed polling time and polling number can be set based on the transaction receipt processor TransactionReceiptProcessors. st , which will cause the number of transactions in the initial transaction data queue to be less than N St ,In order to avoid over-optimization, the preset polling rules are used directly for polling.

[0059] The transaction polling refers to querying the transaction results, transaction process, etc. of the transaction data. When the query result fails or times out, the transaction polling result is determined to be a polling abnormality. When the query is normal, the transaction polling result is determined to be a polling normal.

[0060] S2. When the total number of transaction data in the initial transaction data queue meets a preset queue number threshold, calculate the abnormal number of transaction data in the initial transaction data queue.

[0061] In the embodiments of the present invention, due to the dramatic changes in the amount of transaction data, using fixed polling rules for blockchain transaction polling may result in resource waste or waiting timeouts, which may cause the historical transaction data set to include transaction data with abnormal polling results. For example, in the financial field, in business scenarios such as flash sales and bulk purchases of securities data resources, a large number of meaningless requests may occupy system and network resources in a short period of time, or the maximum number of polling times may be reached before the transaction is uploaded to the chain, resulting in the return of abnormal polling query results.

[0062] In detail, the calculating of the abnormal number of transaction data in the initial transaction data queue includes:

[0063] The maximum number of consecutive abnormal transaction data in the initial transaction data queue is used as the abnormal number of transaction data in the initial transaction data queue.

[0064] In another optional embodiment of the present invention, after calculating the abnormal number of transaction data in the initial transaction data queue, the method further includes: when the abnormal number of transaction data in the initial transaction data queue is greater than or equal to a preset failure threshold, reporting an error to the target client and replacing a new communication blockchain node.

[0065] In the embodiment of the present invention, it is determined whether N consecutive err If all of them are query results failed or timed out, an error will be reported and recorded, and a new node of the blockchain will be switched for communication. err A self-set failure threshold.

[0066] S3. When the number of abnormal transaction data in the initial transaction data queue is less than a preset abnormal number threshold, historical polling information of each transaction data in the initial transaction data queue is collected.

[0067] In the embodiment of the present invention, for the transaction data Tx in the initial transaction data queue i The historical polling information includes: the time interval T of the historical polling i , the number of polling times for historical settings M i , the actual number of historical polling times M' i , the number of transactions in the blockchain node transaction pool when the transaction was issued historically Pe i and the maximum number of transactions contained in the block is Tc max And the historical timestamp Ts i , the importance index α of the transaction data i , and other information Me of the transaction data i .

[0068] S4. Obtain real-time blockchain information of the real-time transaction data based on a preset blockchain port, and calculate optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information.

[0069] In the embodiment of the present invention, the preset blockchain port can be the RPC port of the blockchain. k , the real-time blockchain information includes: the number of transactions in the current blockchain node transaction pool Pe k And the number of transactions contained in the current block Tc k , the importance index α of the real-time transaction data k , and the system timestamp Ts k etc. Take the nearest N st For the total transaction polling time, we have a length of N st The sequence of Po i =T i ×M' i , while Tc k Compare the maximum number of transactions in the block with the most recently recorded information and update it to Tc' max .

[0070] In detail, the calculating of the optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information includes:

[0071] Calculate a first predicted polling duration of the real-time transaction data using a preset polling average formula based on the real-time blockchain information and the historical polling information;

[0072] Calculating a second predicted polling duration of the real-time transaction data using a preset time series weighted moving average formula based on the real-time timestamp in the real-time blockchain information and the historical timestamp in the historical polling information;

[0073] Selecting a maximum value from the first predicted polling duration and the second predicted polling duration as the real-time polling duration of the real-time transaction data;

[0074] Calculating a real-time polling interval for the real-time transaction data based on the real-time polling duration and a preset correction coefficient;

[0075] The real-time polling duration and the real-time polling interval are used as optimized polling information for the real-time transaction data.

[0076] In an optional embodiment of the present invention, calculating the first predicted polling duration of the real-time transaction data using a preset polling average formula includes:

[0077]

[0078] Po i =T i ×M' i

[0079] β i =[Pe i / Tc' max ]+1

[0080] β k =[Pe k / Tc' max ]+1

[0081] β i ≥1, Tc' max =max(Tc k ,Tc max )

[0082] in, Indicates the first prediction polling duration, β k For real-time transaction weight, Po i Indicates the polling time of the i-th transaction data in the initial transaction data queue, T i Indicates the polling interval of the i-th transaction data in the initial transaction data queue, M' i Indicates the actual polling times of the i-th transaction data in the initial transaction data queue, Pe i It represents the number of transactions in the blockchain node transaction pool when the i-th transaction data in the initial transaction data queue is sent, Pe k Indicates the number of transactions in the current blockchain node transaction pool in real-time blockchain information, β i Indicates the transaction weight of the i-th transaction data in the initial transaction data queue, Tc' max Indicates the number of transactions Tc contained in the current block recorded in the real-time blockchain information k And the block recorded in the historical polling information contains the maximum number of transactions Tc max The maximum value of .

[0083] In the embodiment of the present invention, for a length of N st The initial transaction data queue, the polling time for each transaction Po i =T i ×M' i , while Tc k Compare the maximum number of transactions in the block with the most recently recorded information and update it to Tc' max , according to the number of transactions Pe in the transaction pool recorded in the historical polling information i , the transaction weight β can be simply predicted by the arithmetic mean i =[Pe i / Tc' max ]+1,β i ≥1, the first predicted polling duration where β k =[Pe k / Tc' max ]+1.

[0084] In an optional embodiment of the present invention, calculating the second predicted polling duration of the real-time transaction data using a preset time series weighted moving average formula includes:

[0085]

[0086] μ i =γ i / ∑ i γ i

[0087] T i =Ts k -Ts i +1

[0088] γ i =T n+1-i

[0089] in, Indicates the second prediction polling duration, μ i Po represents the correlation coefficient of the i-th transaction data in the initial transaction data queue. i represents the polling duration of the i-th transaction data in the initial transaction data queue, γ i represents the relevant weight of the i-th transaction data in the initial transaction data queue, T i Indicates the time interval between the real-time transaction data and the i-th transaction data in the initial transaction data queue, Ts k Indicates the real-time timestamp in the real-time blockchain information, Ts i represents the historical timestamp of the i-th transaction data in the initial transaction data queue in the historical polling information, n represents the total number of transaction data in the initial transaction data queue, γ i =T n+1-i Represents γ i With T i It is a reverse order correspondence.

[0090] In an optional embodiment of the present invention, the time interval array T is calculated based on the recorded historical timestamp data in accordance with the weighted moving average method of the time series. i =Ts k -Ts i +1. To ensure that the value closer to the current timestamp has a higher correlation weight, set the correlation weight γ i =T n+1-i, that is, the time interval array T i After reverse sorting, the corresponding time interval is used as the correlation weight, and the correlation coefficient is μ i =γ i / ∑ i γ i , then the second predicted polling duration

[0091] In the embodiment of the present invention, the maximum value of the two predicted values ​​is taken as the transaction Tx k Predicted real-time polling duration According to the artificially set information importance index α in real-time blockchain information k , α k >1, and whether it is during special business time such as flash sales Ts a Time correction factor t k = Where C>1, C and ε are artificially set values ​​according to business needs, and finally the transaction Tx is obtained. k Real-time polling interval

[0092] In an embodiment of the present invention, by collecting and calculating data such as the system performance of blockchain nodes, block-related setting parameters, the existing number of transactions in the transaction pool, the polling time, number of times and results set for a certain number of recent transactions, and the manually set weight of the transaction, the optimized polling time and number of real-time transaction data are obtained, thereby improving the robustness of the system, reducing the background system resource consumption while ensuring high connection availability.

[0093] S5. Perform transaction polling on the real-time transaction data based on the optimized polling information to obtain a transaction polling result.

[0094] In the embodiment of the present invention, the maximum number of polling times M can be set by optimizing the polling information. k =2α k t k , that is, the polling exceeds M k The transaction is considered abnormal, and the transaction polling result is determined to be abnormal. For the recorded initial transaction data queue, the transaction Tx is pushed. k As well as related information (transaction polling results, etc.), the last transaction is launched, the transaction is completed, and the next transaction is waiting.

[0095] In the embodiment of the present invention, by recording the polling information and other parameters of previous transactions and dynamically adjusting the real-time polling time and frequency, in special business scenarios (such as securities asset flash sales), it will greatly reduce the meaningless requests sent by the backend to the blockchain when a large number of transactions accumulate. Reasonable parameter design can also greatly improve the success rate of polling, thereby improving the stability and robustness of the backend system without reducing the user experience. In addition, it has certain universal characteristics for all related polling needs.

[0096] The present invention constructs an initial transaction data queue from a collection of historical transaction data, collects historical polling information for each transaction data in the initial transaction data queue, obtains real-time blockchain information for real-time transaction data, and calculates optimized polling information for the real-time transaction data based on the real-time blockchain information and the historical polling information. The method dynamically adjusts the polling time and frequency based on both real-time and historical information, thereby improving the success rate of transaction polling and avoiding the occurrence of a large number of meaningless requests within a short period of time that occupy system and network resources when a large number of transactions accumulate. This improves the robustness of the system and significantly increases the accuracy and efficiency of transaction polling. Therefore, the blockchain-based transaction polling method proposed in the present invention can improve the efficiency of transaction polling.

[0097] like Figure 2 , which is a functional module diagram of a blockchain-based transaction polling device provided by one embodiment of the present invention.

[0098] The blockchain-based transaction polling device 100 described in the present invention can be installed in an electronic device. Depending on the functionality implemented, the blockchain-based transaction polling device 100 may include a transaction anomaly query module 101, a historical polling information acquisition module 102, an optimized polling information calculation module 103, and a transaction polling module 104. A module, also referred to as a unit, is a series of computer program segments that can be executed by an electronic device processor and perform a fixed function, and is stored in the electronic device's memory.

[0099] In this embodiment, the functions of each module / unit are as follows:

[0100] The transaction anomaly query module 101 is configured to construct an initial transaction data queue based on a set of historical transaction data, obtain real-time transaction data, query whether the total number of transaction data in the initial transaction data queue meets a preset queue number threshold, and calculate the number of anomalies in the transaction data in the initial transaction data queue when the total number of transaction data in the initial transaction data queue meets the preset queue number threshold;

[0101] The historical polling information acquisition module 102 is configured to collect historical polling information of each transaction data in the initial transaction data queue when the number of abnormal transaction data in the initial transaction data queue is less than a preset abnormal number threshold;

[0102] The optimized polling information calculation module 103 is used to obtain the real-time blockchain information of the real-time transaction data based on a preset blockchain port, and calculate the optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information;

[0103] The transaction polling module 104 is configured to perform transaction polling on the real-time transaction data based on the optimized polling information to obtain a transaction polling result.

[0104] In detail, the specific implementation of each module of the blockchain-based transaction polling device 100 is as follows:

[0105] Step 1: construct an initial transaction data queue based on the historical transaction data set, obtain real-time transaction data, and query whether the total number of transaction data in the initial transaction data queue meets a preset queue number threshold.

[0106] In the embodiment of the present invention, the real-time transaction data refers to the real-time business records obtained in the blockchain, for example, in the financial field, the securities business scenario includes real-time business records such as bulk purchase business, activity (such as a securities flash sale activity) purchase business, etc. sy Refers to the maximum amount of transaction data that the initial transaction data queue can accommodate.

[0107] Specifically, the process of constructing an initial transaction data queue based on a historical transaction data set includes:

[0108] A preset number of transaction data are selected from the historical transaction data set in chronological order and arranged to obtain an initial transaction data queue.

[0109] In another optional embodiment of the present invention, after querying whether the total number of transaction data in the initial transaction data queue meets the preset queue number threshold, the method further includes: when the total number of transaction data in the initial transaction data queue does not meet the preset queue number threshold, performing transaction polling on the real-time transaction data using a preset polling rule, pushing the polled real-time transaction data into the initial transaction data queue to obtain an updated initial transaction data queue, recording the transaction polling result of the real-time transaction data, and returning to the step of querying whether the total number of transaction data in the initial transaction data queue meets the preset queue number threshold.

[0110] In the embodiment of the present invention, the preset polling rules include polling time and number of polling, etc., and fixed polling time and polling number can be set based on the transaction receipt processor TransactionReceiptProcessors. st , which will cause the number of transactions in the initial transaction data queue to be less than N st ,In order to avoid over-optimization, the preset polling rules are used directly for polling.

[0111] The transaction polling refers to querying the transaction results, transaction process, etc. of the transaction data. When the query result fails or times out, the transaction polling result is determined to be a polling abnormality. When the query is normal, the transaction polling result is determined to be a polling normal.

[0112] Step 2: When the total number of transaction data in the initial transaction data queue meets a preset queue number threshold, the abnormal number of transaction data in the initial transaction data queue is calculated.

[0113] In the embodiments of the present invention, due to the dramatic changes in the amount of transaction data, using fixed polling rules for blockchain transaction polling may result in resource waste or waiting timeouts, which may cause the historical transaction data set to include transaction data with abnormal polling results. For example, in the financial field, in business scenarios such as flash sales and bulk purchases of securities data resources, a large number of meaningless requests may occupy system and network resources in a short period of time, or the maximum number of polling times may be reached before the transaction is uploaded to the chain, resulting in the return of abnormal polling query results.

[0114] In detail, the calculating of the abnormal number of transaction data in the initial transaction data queue includes:

[0115] The maximum number of consecutive abnormal transaction data in the initial transaction data queue is used as the abnormal number of transaction data in the initial transaction data queue.

[0116] In another optional embodiment of the present invention, after calculating the abnormal number of transaction data in the initial transaction data queue, the method further includes: when the abnormal number of transaction data in the initial transaction data queue is greater than or equal to a preset failure threshold, reporting an error to the target client and replacing a new communication blockchain node.

[0117] In the embodiment of the present invention, it is determined whether N consecutive err If all of them are query results failed or timed out, an error will be reported and recorded, and a new node of the blockchain will be switched for communication. err A self-set failure threshold.

[0118] Step 3: When the number of abnormal transaction data in the initial transaction data queue is less than a preset abnormal number threshold, historical polling information of each transaction data in the initial transaction data queue is collected.

[0119] In the embodiment of the present invention, for the transaction data Tx in the initial transaction data queue i The historical polling information includes: the time interval T of the historical polling i , the number of polling times for historical settings M i , the actual number of historical polling times M' i , the number of transactions Pe in the blockchain node transaction pool when the transaction was issued historically i and the maximum number of transactions contained in the block is Tc max And the historical timestamp Ts i , the importance index α of the transaction data i , and other information about the transaction data i .

[0120] Step 4: Obtain real-time blockchain information of the real-time transaction data based on a preset blockchain port, and calculate optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information.

[0121] In the embodiment of the present invention, the preset blockchain port can be the RPC port of the blockchain. k The real-time blockchain information includes: the number of transactions Pe in the current blockchain node transaction pool k And the number of transactions contained in the current block Tc k , the importance index α of the real-time transaction data k , and the system timestamp Ts k etc. Take the nearest N st For the total transaction polling time, we have a length of N st The sequence of Po i =T i ×M' i , while Tc k Compare the maximum number of transactions in the block with the most recently recorded information and update it to Tc' max .

[0122] In detail, the calculating of the optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information includes:

[0123] Calculate a first predicted polling duration of the real-time transaction data using a preset polling average formula based on the real-time blockchain information and the historical polling information;

[0124] Calculating a second predicted polling duration of the real-time transaction data using a preset time series weighted moving average formula based on the real-time timestamp in the real-time blockchain information and the historical timestamp in the historical polling information;

[0125] Selecting a maximum value from the first predicted polling duration and the second predicted polling duration as the real-time polling duration of the real-time transaction data;

[0126] Calculating a real-time polling interval for the real-time transaction data based on the real-time polling duration and a preset correction coefficient;

[0127] The real-time polling duration and the real-time polling interval are used as optimized polling information for the real-time transaction data.

[0128] In an optional embodiment of the present invention, calculating the first predicted polling duration of the real-time transaction data using a preset polling average formula includes:

[0129]

[0130] β i =[Pe i / Tc' max ]+1

[0131] β k =[Pe k / Tc' max ]+1

[0132] β i ≥1, Tc' max =max(Tc k ,Tc max )

[0133] in, Indicates the first prediction polling duration, β k For real-time transaction weight, Po i Indicates the polling time of the i-th transaction data in the initial transaction data queue, T i Indicates the polling interval of the i-th transaction data in the initial transaction data queue, M' i Indicates the actual polling times of the i-th transaction data in the initial transaction data queue, Pe i It represents the number of transactions in the blockchain node transaction pool when the i-th transaction data in the initial transaction data queue is sent, Pe k Indicates the number of transactions in the current blockchain node transaction pool in real-time blockchain information, β i Indicates the transaction weight of the i-th transaction data in the initial transaction data queue, Tc' max Indicates the number of transactions Tc contained in the current block recorded in the real-time blockchain informationk And the block recorded in the historical polling information contains the maximum number of transactions Tc max The maximum value of .

[0134] In the embodiment of the present invention, for a length of N st The initial transaction data queue, the polling time for each transaction Po i =T i ×M' i , while Tc k Compare the maximum number of transactions in the block with the most recently recorded information and update it to Tc' max , according to the number of transactions Pe in the transaction pool recorded in the historical polling information i , the transaction weight β can be simply predicted by the arithmetic mean i =[P i / Tc' max ]+1,β i ≥1, the first predicted polling duration where β k =[Pe k / Tc' max ]+1.

[0135] In an optional embodiment of the present invention, calculating the second predicted polling duration of the real-time transaction data using a preset time series weighted moving average formula includes:

[0136]

[0137] μ i =γ i / ∑ i γ i

[0138] T i =Ts k -Ts i +1

[0139] γ i =T n+1-i

[0140] in, Indicates the second prediction polling duration, μ i Po represents the correlation coefficient of the i-th transaction data in the initial transaction data queue. i represents the polling duration of the i-th transaction data in the initial transaction data queue, γ i represents the relevant weight of the i-th transaction data in the initial transaction data queue, T i Indicates the time interval between the real-time transaction data and the i-th transaction data in the initial transaction data queue, Ts kIndicates the real-time timestamp in the real-time blockchain information, Ts i represents the historical timestamp of the i-th transaction data in the initial transaction data queue in the historical polling information, n represents the total number of transaction data in the initial transaction data queue, γ i =T n+1-i Represents γ i With T i It is a reverse order correspondence.

[0141] In an optional embodiment of the present invention, the time interval array T is calculated based on the recorded historical timestamp data in accordance with the weighted moving average method of the time series. i =Ts k -Ts i +1. To ensure that the value closer to the current timestamp has a higher correlation weight, set the correlation weight γ i =T n+1-i , that is, the time interval array T i After reverse sorting, the corresponding time interval is used as the correlation weight, and the correlation coefficient is μ i =γ i / ∑ i γ i , then the second predicted polling duration

[0142] In the embodiment of the present invention, the maximum value of the two predicted values ​​is taken as the transaction Tx k Predicted real-time polling duration According to the artificially set information importance index α in real-time blockchain information k , α k >1, and whether it is during special business time such as flash sales Ts a Time correction factor t k = Where C>1, C and ε are artificially set values ​​according to business needs, and finally the transaction Tx is obtained. k Real-time polling interval T k =Po k f / (α k ×t k ).

[0143] In an embodiment of the present invention, by collecting and calculating data such as the system performance of blockchain nodes, block-related setting parameters, the existing number of transactions in the transaction pool, the polling time, number of times and results set for a certain number of recent transactions, and the manually set weight of the transaction, the optimized polling time and number of real-time transaction data are obtained, thereby improving the robustness of the system, reducing the background system resource consumption while ensuring high connection availability.

[0144] Step 5: Perform transaction polling on the real-time transaction data based on the optimized polling information to obtain a transaction polling result.

[0145] In the embodiment of the present invention, the maximum number of polling times M can be set by optimizing the polling information. k =2α k t k , that is, the polling exceeds M k The transaction is considered abnormal, and the transaction polling result is determined to be abnormal. For the recorded initial transaction data queue, the transaction Tx is pushed. k As well as related information (transaction polling results, etc.), the last transaction is launched, the transaction is completed, and the next transaction is waiting.

[0146] In the embodiment of the present invention, by recording the polling information and other parameters of previous transactions and dynamically adjusting the real-time polling time and frequency, in special business scenarios (such as securities asset flash sales), it will greatly reduce the meaningless requests sent by the backend to the blockchain when a large number of transactions accumulate. Reasonable parameter design can also greatly improve the success rate of polling, thereby improving the stability and robustness of the backend system without reducing the user experience. In addition, it has certain universal characteristics for all related polling needs.

[0147] The present invention constructs an initial transaction data queue from a collection of historical transaction data, collects historical polling information for each transaction data in the initial transaction data queue, obtains real-time blockchain information for real-time transaction data, and calculates optimized polling information for the real-time transaction data based on the real-time blockchain information and the historical polling information. The polling time and frequency are dynamically adjusted based on both real-time and historical information, thereby improving the success rate of transaction polling and avoiding the occurrence of a large number of meaningless requests occupying system and network resources in a short period of time when a large number of transactions accumulate. This improves the robustness of the system and significantly increases the accuracy and efficiency of transaction polling. Therefore, the blockchain-based transaction polling device proposed in the present invention can improve the efficiency of transaction polling.

[0148] like Figure 3 , which is a schematic diagram of the structure of an electronic device for implementing the blockchain-based transaction polling method provided by one embodiment of the present invention.

[0149] The electronic device may include a processor 10, a memory 11, a communication interface 12 and a bus 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a blockchain-based transaction polling program.

[0150] The memory 11 includes at least one type of readable storage medium, including flash memory, mobile hard disk, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of the electronic device, such as a plug-in mobile hard disk, smart memory card (SMC), secure digital (SD) card, flash card, etc. equipped on the electronic device. Furthermore, the memory 11 may include both an internal storage unit of the electronic device and an external storage device. The memory 11 can be used not only to store application software and various types of data installed in the electronic device, such as the code of a blockchain-based transaction polling program, but also to temporarily store data that has been output or is about to be output.

[0151] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The processor 10 is the control core (Control Unit) of the electronic device, connecting the various components of the entire electronic device using various interfaces and lines, and executing programs or modules stored in the memory 11 (such as a blockchain-based transaction polling program, etc.), as well as calling data stored in the memory 11, to perform various functions of the electronic device and process data.

[0152] The communication interface 12 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0153] The bus 13 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus 13 may be divided into an address bus, a data bus, a control bus, etc. The bus 13 is configured to enable communication between the memory 11 and at least one processor 10.

[0154] Figure 3 Only the electronic device with components is shown, and it can be understood by those skilled in the art that Figure 3 The structure shown does not limit the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0155] For example, although not shown, the electronic device may further include a power source (such as a battery) for powering various components. Preferably, the power source may be logically connected to the at least one processor 10 via a power management device, thereby implementing functions such as charge management, discharge management, and power consumption management through the power management device. The power source may further include any components such as one or more DC or AC power sources, a recharging device, a power failure detection circuit, a power converter or inverter, a power status indicator, etc. The electronic device may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0156] Furthermore, the electronic device may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices.

[0157] Optionally, the electronic device may further include a user interface, which may be a display or an input unit (such as a keyboard). Optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.

[0158] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0159] The blockchain-based transaction polling program stored in the memory 11 of the electronic device is a combination of multiple instructions. When running in the processor 10, it can achieve:

[0160] Building an initial transaction data queue based on a set of historical transaction data, obtaining real-time transaction data, and querying whether the total number of transaction data in the initial transaction data queue meets a preset queue number threshold;

[0161] When the total amount of transaction data in the initial transaction data queue meets a preset queue amount threshold, calculating the abnormal amount of transaction data in the initial transaction data queue;

[0162] When the number of abnormal transaction data in the initial transaction data queue is less than a preset abnormal number threshold, collecting historical polling information of each transaction data in the initial transaction data queue;

[0163] Acquire real-time blockchain information of the real-time transaction data based on a preset blockchain port, and calculate optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information;

[0164] Transaction polling is performed on the real-time transaction data based on the optimized polling information to obtain a transaction polling result.

[0165] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.

[0166] Furthermore, if the module / unit integrated into the electronic device is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0167] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor of an electronic device, the computer program can implement:

[0168] Building an initial transaction data queue based on a set of historical transaction data, obtaining real-time transaction data, and querying whether the total number of transaction data in the initial transaction data queue meets a preset queue number threshold;

[0169] When the total amount of transaction data in the initial transaction data queue meets a preset queue amount threshold, calculating the abnormal amount of transaction data in the initial transaction data queue;

[0170] When the number of abnormal transaction data in the initial transaction data queue is less than a preset abnormal number threshold, collecting historical polling information of each transaction data in the initial transaction data queue;

[0171] Acquire real-time blockchain information of the real-time transaction data based on a preset blockchain port, and calculate optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information;

[0172] Transaction polling is performed on the real-time transaction data based on the optimized polling information to obtain a transaction polling result.

[0173] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the module division is merely a logical function division, and other division methods may be used in actual implementation.

[0174] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected to achieve the purpose of the solution of this embodiment according to actual needs.

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

[0176] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0177] Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the claims are intended to be embraced therein. Any reference to a figure in a claim should not be construed as limiting the claim to which it relates.

[0178] Embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.

[0179] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0180] Blockchain, as used in this article, refers to a novel application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each block contains information about a batch of online transactions, used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0181] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. Second-order terms are used to indicate names and do not imply any particular order.

[0182] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A transaction polling method based on blockchain, characterized in that: The method comprises: Building an initial transaction data queue based on a set of historical transaction data, obtaining real-time transaction data, and querying whether the total number of transaction data in the initial transaction data queue meets a preset queue number threshold; When the total amount of transaction data in the initial transaction data queue meets a preset queue amount threshold, calculating the abnormal amount of transaction data in the initial transaction data queue; When the number of abnormal transaction data in the initial transaction data queue is less than a preset abnormal number threshold, collecting historical polling information of each transaction data in the initial transaction data queue; Acquire real-time blockchain information of the real-time transaction data based on a preset blockchain port, and calculate optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information; Performing transaction polling on the real-time transaction data based on the optimized polling information to obtain a transaction polling result; Among them, the calculation of the optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information includes: based on the real-time blockchain information and the historical polling information, using a preset polling average formula to calculate the first predicted polling duration of the real-time transaction data; based on the real-time timestamp in the real-time blockchain information and the historical timestamp in the historical polling information, using a preset time series weighted moving average formula to calculate the second predicted polling duration of the real-time transaction data; selecting the maximum value from the first predicted polling duration and the second predicted polling duration as the real-time polling duration of the real-time transaction data; calculating the real-time polling interval of the real-time transaction data based on the real-time polling duration and a preset correction coefficient; and using the real-time polling duration and the real-time polling interval as the optimized polling information of the real-time transaction data.

2. The blockchain-based transaction polling method according to claim 1, wherein: The step of constructing an initial transaction data queue based on a historical transaction data set includes: A preset number of transaction data are selected from the historical transaction data set in chronological order and arranged to obtain the initial transaction data queue.

3. The blockchain-based transaction polling method according to claim 1, wherein: After querying whether the total amount of transaction data in the initial transaction data queue meets a preset queue amount threshold, the method further includes: When the total number of transaction data in the initial transaction data queue does not meet the preset queue number threshold, the real-time transaction data is subjected to transaction polling using a preset polling rule, the real-time transaction data after polling is pushed into the initial transaction data queue to obtain an updated initial transaction data queue, the transaction polling result of the real-time transaction data is recorded, and the process returns to the step of querying whether the total number of transaction data in the initial transaction data queue meets the preset queue number threshold.

4. The blockchain-based transaction polling method as claimed in claim 1, characterized in that: After calculating the abnormal number of transaction data in the initial transaction data queue, the method further includes: When the number of abnormal transaction data in the initial transaction data queue is greater than or equal to a preset abnormal number threshold, an error is reported to the target client and a new communication blockchain node is replaced.

5. The blockchain-based transaction polling method according to claim 1, wherein: The calculating the first predicted polling duration of the real-time transaction data by using a preset polling average value formula includes: in, Indicates the first prediction polling duration, is the real-time transaction weight, Indicates the first transaction data in the queue The polling time for transaction data, Indicates the first transaction data in the queue The polling interval for transaction data, Indicates the first transaction data in the queue The actual number of polling times for transaction data, Indicates the first transaction data in the queue The number of transactions in the blockchain node transaction pool when the transaction data is sent. Indicates the number of transactions in the current blockchain node transaction pool in real-time blockchain information. Indicates the first transaction data in the queue The transaction weight of each transaction data, Indicates the number of transactions contained in the current block recorded in the real-time blockchain information The maximum number of transactions in the block recorded in the historical polling information The maximum value of .

6. The blockchain-based transaction polling method according to claim 1, wherein: The calculating the second predicted polling duration of the real-time transaction data by using a preset time series weighted moving average formula includes: in, Indicates the second prediction polling duration. Indicates the first transaction data in the queue The correlation coefficient of transaction data, Indicates the first transaction data in the queue The polling time for transaction data, Indicates the first transaction data in the queue The relevant weight of transaction data, Indicates the real-time transaction data and the initial transaction data queue. The time interval of transaction data, Represents the real-time timestamp in real-time blockchain information, Indicates the number of the initial transaction data queue in the historical polling information. The historical timestamp of transaction data, Indicates the total number of transaction data in the initial transaction data queue. express and It is a reverse order correspondence.

7. A transaction polling device based on blockchain, characterized in that: The device comprises: a transaction anomaly query module, configured to construct an initial transaction data queue based on a set of historical transaction data, obtain real-time transaction data, query whether the total number of transaction data in the initial transaction data queue meets a preset queue number threshold, and calculate the number of anomalies in the transaction data in the initial transaction data queue when the total number of transaction data in the initial transaction data queue meets the preset queue number threshold; a historical polling information acquisition module, configured to collect historical polling information of each transaction data in the initial transaction data queue when the number of abnormal transaction data in the initial transaction data queue is less than a preset abnormal number threshold; An optimized polling information calculation module, configured to obtain the real-time blockchain information of the real-time transaction data based on a preset blockchain port, and calculate the optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information; A transaction polling module, configured to perform transaction polling on the real-time transaction data based on the optimized polling information to obtain a transaction polling result; Among them, the calculation of the optimized polling information of the real-time transaction data based on the real-time blockchain information and the historical polling information includes: based on the real-time blockchain information and the historical polling information, using a preset polling average formula to calculate the first predicted polling duration of the real-time transaction data; based on the real-time timestamp in the real-time blockchain information and the historical timestamp in the historical polling information, using a preset time series weighted moving average formula to calculate the second predicted polling duration of the real-time transaction data; selecting the maximum value from the first predicted polling duration and the second predicted polling duration as the real-time polling duration of the real-time transaction data; calculating the real-time polling interval of the real-time transaction data based on the real-time polling duration and a preset correction coefficient; and using the real-time polling duration and the real-time polling interval as the optimized polling information of the real-time transaction data.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the blockchain-based transaction polling method according to any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the blockchain-based transaction polling method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Block chain real-time polling cloud side system

    CN106878318A

  • Data processing method and device based on block chain system

    CN110008206A