CN110738497A - data processing method, device, node equipment and storage medium - Google Patents

data processing method, device, node equipment and storage medium Download PDF

Info

Publication number
CN110738497A
CN110738497A CN201911313426.1A CN201911313426A CN110738497A CN 110738497 A CN110738497 A CN 110738497A CN 201911313426 A CN201911313426 A CN 201911313426A CN 110738497 A CN110738497 A CN 110738497A
Authority
CN
China
Prior art keywords
transaction data
priority queue
priority
authenticated
queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911313426.1A
Other languages
Chinese (zh)
Other versions
CN110738497B (en
Inventor
李茂材
朱耿良
杨常青
刘区城
蓝虎
刘攀
周开班
时一防
王宗友
张劲松
黄焕坤
孔利
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201911313426.1A priority Critical patent/CN110738497B/en
Publication of CN110738497A publication Critical patent/CN110738497A/en
Application granted granted Critical
Publication of CN110738497B publication Critical patent/CN110738497B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9024Graphs; Linked lists
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/40Authorisation, e.g. identification of payer or payee, verification of customer or shop credentials; Review and approval of payers, e.g. check credit lines or negative lists
    • G06Q20/401Transaction verification

Abstract

The embodiment of the invention discloses data processing methods, devices, node equipment and storage media, wherein the method comprises the steps of obtaining transaction data to be authenticated from a transaction pool and authenticating the transaction data, adding the transaction data passing the authentication into a priority queue, adding the transaction data passing the authentication into a priority queue, sequencing a priority queue according to electronic resource quantity related to the transaction data, preferentially processing the transaction data with larger electronic resource quantity in the priority queue, obtaining the transaction data from the priority queue in response to a trigger event for uploading the transaction data to a blockchain network, determining target transaction data according to the obtained transaction data, generating a target block, wherein the target block comprises the target transaction data, and uploading the target block to the blockchain network, so that the efficiency of uploading the transaction data to the blockchain network can be improved.

Description

data processing method, device, node equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to data processing methods and apparatuses, a node device, and a storage medium.
Background
With the continuous development of the blockchain technology, based on the characteristic that data stored in a blockchain network cannot be tampered, the massive transaction data needing to ensure real data can be stored in the blockchain network, and the authenticity of the transaction data is ensured when the transaction data is stored.
Disclosure of Invention
The embodiment of the invention provides data processing methods and devices, node equipment and a storage medium, which can improve the efficiency of uploading transaction data to a block chain network.
, the embodiment of the invention provides blockchain-based data processing methods, which are used for any node in a blockchain network, the node includes a transaction pool, the transaction pool includes a priority queue, the priority queue includes a priority queue, the priority queue is used for storing authenticated transaction data, the method includes:
acquiring transaction data to be authenticated from the transaction pool, and authenticating the transaction data;
adding authenticated transaction data to the priority queue, wherein the authenticated transaction data is added to the th priority queue, wherein the th priority queue is ordered according to an amount of electronic resources associated with the transaction data, and wherein in the th priority queue, transaction data having a greater amount of electronic resources is processed preferentially;
responding to a trigger event for uploading the transaction data to the blockchain network, acquiring the transaction data from the priority queue, and determining target transaction data according to the acquired transaction data;
generating a target tile, the target tile comprising the target transaction data;
uploading the target tiles to the blockchain network.
In another aspect, an embodiment of the present invention provides kind of blockchain-based data processing apparatus, where the data processing apparatus is used in any node in a blockchain network, the node includes a transaction pool, the transaction pool includes a priority queue, the priority queue includes a th priority queue, the th priority queue is used to store transaction data that has passed authentication, and the apparatus includes:
the acquisition unit is used for acquiring the transaction data to be authenticated from the transaction pool;
the authentication unit is used for carrying out authentication processing on the transaction data;
an adding unit, configured to add authenticated transaction data to the priority queue, where the authenticated transaction data is added to the th priority queue, the th priority queue is sorted according to an amount of electronic resources related to the transaction data, and in the th priority queue, transaction data with a larger amount of electronic resources is preferentially processed;
the acquisition unit is further used for responding to a trigger event for uploading the transaction data to the blockchain network, acquiring the transaction data from the priority queue, and determining target transaction data according to the acquired transaction data;
a generating unit for generating a target block, the target block including the target transaction data;
and the uploading unit is used for uploading the target block to the block chain network.
In a further aspect, an embodiment of the present invention provides servers, which include a processor, an input device, an output device, and a memory, where the processor, the input device, the output device, and the memory are connected to each other, where the memory is used to store a computer program that supports a terminal to execute the above method, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the following steps:
acquiring transaction data to be authenticated from the transaction pool, and authenticating the transaction data;
adding authenticated transaction data to the priority queue, wherein the authenticated transaction data is added to the th priority queue, wherein the th priority queue is ordered according to an amount of electronic resources associated with the transaction data, and wherein in the th priority queue, transaction data having a greater amount of electronic resources is processed preferentially;
responding to a trigger event for uploading the transaction data to the blockchain network, acquiring the transaction data from the priority queue, and determining target transaction data according to the acquired transaction data;
generating a target tile, the target tile comprising the target transaction data;
uploading the target tiles to the blockchain network.
, embodiments of the invention provide computer-readable storage media having stored thereon computer program instructions that, when executed by a processor, perform the method of blockchain-based data processing according to .
In an embodiment of the present invention, a transaction pool in a node device (or node) includes a priority queue for storing authenticated transaction data, and the transaction pool includes a th priority queue, so that the node may obtain transaction data to be authenticated from the transaction pool and perform authentication processing on the transaction data, so that the authenticated transaction data may be added to the priority queue after the authentication on the transaction data is passed, and when the transaction data that passes the authentication is added to the priority queue, at least the transaction data that passes the authentication is added to a th priority queue, so that when a trigger event that the transaction data is uploaded to a block chain network is detected, target transaction data may be determined according to the authenticated transaction data obtained from the th priority queue, so that after the target transaction data is determined by the node, a target block may be directly generated to store the target transaction data, and the target block may be uploaded to the block chain network, so as to achieve uplink of the transaction data, since the node may obtain at least a transaction data amount from a first transaction queue of the transaction data, and the target transaction data may be arranged based on the electronic transaction data, so that the transaction data amount of the transaction data obtained from the electronic transaction pool is increased based on the priority queue of the transaction data.
Drawings
In order to more clearly illustrate the technical solution of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of data processing methods provided by an embodiment of the invention;
FIG. 2 is a schematic flow chart diagram of data processing methods according to another embodiment of the present invention;
FIG. 3a is a diagram illustrating types of priority queues according to an embodiment of the present invention;
FIG. 3b is a diagram illustrating second priority queues according to an embodiment of the present invention;
FIG. 4 is a schematic block diagram of data processing devices provided by an embodiment of the present invention;
fig. 5 is a schematic block diagram of kinds of node devices provided by the embodiment of the present invention.
Detailed Description
The embodiment of the invention provides data processing methods, which can be applied to any node in a block chain network, wherein the node comprises a transaction pool, the data processing method can enable any node to quickly generate a target block based on transaction data in the transaction pool and upload the generated target block to the block chain network, so that the problem of starvation of an acquisition process caused by waiting of acquisition time when the any node acquires the transaction data from the transaction pool to generate the target block can be avoided.
The transaction pool includes pre-divided priority queues, in embodiments, the transaction pool includes a priority queue, the node adds authenticated transaction data to the priority queue when storing the authenticated transaction data to the priority queue, and the transaction pool further includes pre-divided two priority queues, namely a priority queue and a second priority queue, the node adds the authenticated transaction data to the priority queue and the second priority queue when storing the authenticated transaction data to the priority queues, wherein each transaction data in the priority queue is determined according to a priority of the authenticated transaction data, the transaction data in the second priority queue is determined according to the second priority of the authenticated transaction data, in embodiments, the priority is determined by the node when uploading the authenticated transaction data to the block network, the amount of the transaction data obtained by the node when uploading the authenticated transaction data to the block network is determined by the second priority of the authenticated transaction data, the amount of the transaction data is determined by the private key or the password, and the amount of the electronic resource is determined by the electronic resource receiving data, wherein the amount is determined by the electronic resource receiving the node when the electronic resource is a private key or the electronic resource.
In embodiments, the priority may also be referred to as a 0 priority, the 1 priority may be prioritized transaction data by commission and time of receipt of transaction data by the transaction pool, the priority queue and the second priority queue may be ordered by corresponding priority, the authenticated transaction data may be added to at least the 853 priority queue, in other embodiments the transaction data may be added to the second priority queue, e.g., when the total amount of transaction data in the th priority queue is greater than the total amount of transaction data in the second priority queue, only authenticated transaction data may be stored in the second priority queue without storing the transaction data in the 965 priority queue, further, the authenticated transaction data may be added to the second priority queue 366, the authenticated transaction data may be added to the second priority queue 368, the authentication data may be added to the second priority queue 368, the authenticated transaction data may be added to the second priority queue 368, or the authentication data may be added to the authentication data queue 368, the authentication data may be added to the authentication queue 368, the authentication queue may be added to the authentication queue 368 transaction data may be added according to the authentication queue 368, the authentication queue 368, the authentication queue may be added to the authentication queue, the authentication queue may be added according to the authentication queue 368, the authentication queue may be added to the authentication queue 368, the authentication queue may be added to the authentication queue, or the authentication queue may be added to the authentication queue, or the authentication queue 368.
After the node adds the transaction data authenticated in the transaction pool to the priority queue in advance, , when the node detects a trigger event for uploading the transaction data to the blockchain network, the node may determine target transaction data according to the transaction data obtained from the th priority queue, and when the transaction pool includes two priority queues, the node may obtain transaction data from the th priority queue and the second priority queue, respectively, and determine target transaction data according to the transaction data obtained from the th priority queue and the second priority queue, wherein the node may use the transaction data obtained from the th priority queue as th transaction data, may also obtain transaction data from the second priority queue, and use the transaction data obtained from the second priority queue as second transaction data, and the obtained th transaction data and the determined second transaction data may be target transaction data, , may generate a target block, and generate a target block according to the obtained target transaction data (including the second transaction data ) and a target block of the transaction data including the target block.
In embodiments, the node may obtain the transaction data from the th priority queue and the second priority queue according to the selection policy determined at , specifically, the selection policy may be a proportional selection policy, based on which the node may first determine an th selection proportion of the transaction data selected from the th priority queue and a second selection proportion of the transaction data selected from the second priority queue, and may determine a preset total amount of the transaction data to be obtained according to traffic conditions (e.g., network bandwidth, network congestion, blockchain traffic rule limits and/or amount of transaction data in a transaction pool, etc.) and the selected 583 th selection proportion, the node may determine a th amount of the transaction data to be obtained from the th priority queue and may determine a second amount of the transaction data to be obtained from the second priority queue according to the total amount of the transaction data and the selected second proportion, and may obtain th amount of the second transaction data from the second priority queue according to the total amount of the transaction data selected from the th priority queue, and may generate the second transaction data from the 637 th priority queue and the , and store the second transaction data in the transaction queue.
When the node acquires 0 th transaction data from the th priority queue according to the th transaction data, the th transaction data of the th transaction data can be acquired from the th priority queue according to the descending order of the th priority from the th priority queue, similarly, when the node acquires the second transaction data from the second priority queue according to the second transaction data, the second transaction data of the second quantity can be acquired from the second priority queue according to the descending order of the second priority, or the node can randomly select the th transaction data of the th transaction data from the th priority queue and randomly select the second transaction data of the second quantity from the second priority queue.
After the node acquires th transaction data from the th priority queue and acquires second transaction data from the second priority queue, the node may determine repeat transaction data from the th transaction data (or the second transaction data), where the repeat transaction data is transaction data added to the th priority queue and added to the second priority queue, and in order to avoid that transaction data stored in the target block includes repeat transaction data, the node may delete repeat transaction data in th transaction data or delete repeat transaction data in the second transaction data, and after deleting the repeat transaction data, generate the target block to store th transaction data and the second transaction data in which the repeat transaction data is deleted, thereby achieving fast acquisition of th transaction data and the second transaction data from different priority queues, effectively avoiding a process waiting problem in a transaction data acquisition process, and avoiding a starvation problem caused by waiting of an acquisition process of transaction data.
Please refer to fig. 1, which is a schematic flowchart of data processing methods according to an embodiment of the present invention, the methods may be applied to the above-mentioned nodes, where the node is any node in a blockchain network, the node includes a transaction pool, the transaction pool includes pre-divided priority queues, the priority queues include priority queue, and the priority queue is used for storing authenticated transaction data, as shown in fig. 1, the method includes:
s101, obtaining the transaction data to be authenticated from the transaction pool, and authenticating the transaction data.
According to an embodiment of the present application, the transaction data that is not authenticated and submitted may be obtained from the transaction pool for authentication before the transaction data is uploaded to the trigger event of the blockchain network, it may be understood that the transaction data that is not authenticated (i.e. the transaction data to be authenticated) may be obtained from the transaction pool and authenticated when the transaction data is submitted to the transaction pool, in which way the authentication may be completed at the fastest speed, which may ensure timely authentication of the transaction data in case of a faster transaction speed of the transaction pool, or the node may also periodically obtain the transaction data that is not authenticated from the transaction pool and authenticate the transaction data, in which way batch authentication may be performed to save system resources, or the node may also obtain the transaction data that is not authenticated from the transaction pool and authenticate the transaction data according to the authentication trigger event, and authenticate the transaction data, in embodiments, the node may set a different authentication trigger event to trigger the authentication processing of the transaction data, wherein the trigger event may be, for example, when the authentication trigger event reaches of the authentication data in the authentication pool and the authentication trigger event triggers the authentication of the transaction data to be processed based on the authentication trigger mechanism of the transaction data that is received in the authentication trigger event that the authentication trigger processing of the authentication data when the authentication trigger mechanism of the transaction data to trigger processing of the transaction pool.
S102, storing the authenticated transaction data into the priority queue.
The transaction pool in the node is used for storing transaction data waiting for uplink, the transaction data waiting for uplink comprises authenticated transaction data and transaction data to be authenticated, in embodiments, the node can store the authenticated transaction data into a priority queue, wherein the authenticated transaction data is at least added into a -th priority queue, the -th priority queue is sorted according to an electronic resource amount related to the transaction data, in the -th priority queue, the transaction data with the larger electronic resource amount is preferentially processed, and since the transaction data stored in the priority queue (e.g., the -th priority queue) is authenticated transaction data, when transaction data is subsequently uplink, the node can not perform the authentication step after acquiring the transaction data from the priority queue, but can directly upload the transaction data acquired from the priority queue into the blockchain network, thereby effectively improving the efficiency of uploading the transaction data to the blockchain network by the node.
In embodiments, after receiving transaction data, if the transaction data is to-be-authenticated transaction data, the node may authenticate the transaction data first, wherein the authentication process includes decrypting the to-be-authenticated transaction data encrypted by a private key with a public key, and determining that the authentication of the to-be-authenticated transaction data passes if the decryption passes, the node may authenticate the any transaction data in advance for any transaction data received by the transaction pool, store the transaction data passing the authentication process in a priority queue, and wait for uplink in the priority queue, it may be understood that the transaction data passing the authentication in the transaction pool is stored in the priority queue, and the transaction data to be authenticated is stored in a storage space in the transaction pool other than the priority queue, the priority queue in the transaction pool implements partition of the transaction data according to whether the authentication passes, and when the node obtains the transaction data from the transaction pool for uplink, the transaction data may be obtained from the priority queue in the transaction pool, and directly upload the transaction data to a network.
S103, in response to a trigger event for uploading the transaction data to the blockchain network, acquiring the transaction data from the th priority queue, and determining target transaction data according to the acquired transaction data.
In embodiments, a node in the blockchain network may upload transaction data received into the blockchain network in real time after receiving the transaction data, or the node may upload the transaction data into the blockchain network periodically according to a preset time period, and correspondingly, the node may determine to receive a trigger event for uploading the transaction data into the blockchain network when receiving the transaction data, or the node may determine to receive a trigger event for uploading the transaction data into the blockchain network when the preset time period arrives.
After the node determines that a trigger event for uploading the transaction data to the blockchain network is received, in embodiments, in order to upload the transaction data to the blockchain network, the node may generate a target block for including the transaction data, and in a process of generating the target block by the node, amount of authenticated transaction data may be further acquired from the transaction pool, because the authenticated transaction data in the transaction pool is stored in the priority queue, in order to improve an uploading efficiency of uploading the transaction data to the blockchain network, the node may acquire the transaction data from the priority queue of the transaction pool, and the acquired transaction data is the authenticated transaction data.
In embodiments, after receiving the trigger event, the node may determine target transaction data according to transaction data obtained from the -th priority queue, where the priority queue includes only the -th priority queue, the transaction data obtained by the node from the -th priority queue is the target transaction data, and when the transaction pool includes the -th priority queue and the second priority queue, the node may obtain the transaction data as the target transaction data from the -th priority queue and the second priority queue, specifically, the node may select the -th amount of transaction data as the -th transaction data from the -th priority queue according to the set selection ratio, and may select the second amount of transaction data from the second priority queue according to the second selection ratio, so that the target transaction data may be determined according to the obtained -th transaction data and the second transaction data, where the selection ratio and the second selection ratio may be relative to the total transaction data to be obtained from the network transaction data chain, and the transaction data may be obtained 631- -th transaction data, and the target transaction data may be determined by the steps of the transaction data obtained from the transaction data obtained 631-to- -th transaction data chain, and the transaction data may be obtained transaction data, and the target transaction data may be obtained from the transaction data obtained transaction data in this embodiment, and the target transaction data is determined by the steps of the step S — the step of the step including the step.
In embodiments, the -th priority queue may be sorted according to the amount of electronic resource (i.e., commission) that can be obtained when the corresponding transaction data is uploaded to the blockchain network, and the node may use the amount of electronic resource that can be obtained when the transaction data is uploaded as the -th priority of the corresponding transaction data, so that the authenticated transaction data in the transaction pool may be sorted from high to low according to the -th priority to obtain the -th priority queue, for example, if the authenticated transaction data in the transaction pool includes transaction data 1 and transaction data 2, if the amount of electronic resource that can be obtained when the node uploads transaction data 1 to the blockchain network is a, the amount of electronic resource that can be obtained when transaction data 2 is uploaded to the blockchain network is b, and the value of a is greater than the value of b, then the -th priority queue corresponding to transaction data 1 is higher than the -th priority corresponding transaction data 2, so that the amount of electronic resource that can be obtained when the node uploads transaction data 1 to the blockchain network is a, and the transaction data is greater than the amount of electronic resource that provided when the transaction data is uploaded according to the electronic resource queue, and the transaction data queue 2-9-th priority queue, so that the transaction data provided by the transaction data queue may be provided according to the transaction data-9-th transaction data, and the transaction data provided by the transaction data queue 2 in embodiments, where the transaction data queue may be provided when the transaction data queue 2-9-th transaction data is obtained when the transaction data is uploaded transaction data, the transaction data is found, the transaction data is provided by the transaction data-9, and the transaction data is provided by the transaction data in the transaction data-9, so that the transaction data in the transaction.
In embodiments, if the uploading order of the authenticated transaction data in the transaction pool to the blockchain network is determined only according to the size of the electronic resource amount provided to the node, it may cause that the transaction data uploaded to the transaction pool cannot be uploaded to the blockchain network for a long time due to the fact that the electronic resource amount provided is too small, so that a second priority queue may be further included in the transaction pool, the transaction data in the second priority queue is sorted according to the electronic resource amount that can be acquired by the node when the corresponding transaction data is uploaded to the blockchain network, and the receiving time when the transaction pool receives the transaction data, so that the transaction data uploaded to the transaction pool can be uploaded to the blockchain network in time.
In embodiments, the transaction data in the second priority queue is sorted behind the transaction data 4 in the second priority queue according to the amount of the electronic resource provided by each transaction data and the receiving time of the transaction pool for receiving the transaction data, and the node may first obtain a second priority corresponding to each transaction data in the transaction pool according to the receiving time (electronic resource amount + 1), and may determine the second priority queue according to the second priority, and the sorting of each transaction data in the second priority queue, for example, if the transaction data 3 and the transaction data 4 in the transaction pool have passed the authentication, if the second priority corresponding to the transaction data 3 is determined according to the amount of the electronic resource provided by the transaction data 3 and the receiving time when the transaction pool receives the transaction data 3, and if the second priority corresponding to the transaction data 4 is determined according to the amount of the electronic resource provided by the transaction data 4 and the receiving time when the transaction pool receives the transaction data 4, and c is less than d.
In embodiments, the transaction pool may further include a third priority queue, where the third priority queue may be sorted according to the urgency of each authenticated transaction data in the transaction pool, and may select transaction data from the third priority queue as third transaction data according to a corresponding selection policy, and in the embodiments of the present invention, the number of priority queues included in the transaction pool is not limited, and the transaction pool may include two or more priority queues.
S104, generating a target block, wherein the target block comprises the target transaction data.
And S105, uploading the target block to the block chain network.
After the node acquires transaction data from th and second priority queues in steps S104 and S105, if the acquired transaction data includes th transaction data acquired from th priority queues and second transaction data acquired from second priority queues, step , the node may determine duplicate transaction data from th transaction data and the second transaction data, and generate a target block after deleting the duplicate transaction data, where the duplicate transaction data is the transaction data acquired from th priority queues and acquired from the second priority queues.
In an embodiment of the present invention, a transaction pool in a node device (or node) includes a priority queue for storing authenticated transaction data, and the transaction pool includes an th priority queue, so that the node may obtain transaction data to be authenticated from the transaction pool and authenticate the transaction data, so that the authenticated transaction data may be added to the priority queue after the authentication of the transaction data is passed, and when the authenticated transaction data is added to the priority queue, at least the authenticated transaction data is added to the th priority queue, so that when a trigger event for uploading transaction data to a blockchain network is detected, target transaction data may be determined according to the authenticated transaction data obtained from the th priority queue, so that after the target transaction data is determined by the node, a target block may be directly generated to store the target transaction data, and further , the target block may be uploaded to the blockchain network, so as to implement uplink of transaction data, so that starvation of transaction data obtained after the transaction data is obtained, the transaction data is obtained by the node, and the transaction data is not required to be verified after the transaction data is uploaded, thereby improving efficiency of transaction data obtained by the transaction queue.
Please refer to fig. 2, which is a flowchart illustrating a data processing method according to another embodiment of the present invention, the data processing method is also applicable to any node (or node device) in a blockchain network, the node includes a transaction pool, the transaction pool includes a priority queue, the priority queue includes a th priority queue, the th priority queue is used for storing authenticated transaction data, and the method includes steps S201 to S206.
S201, obtaining the transaction data to be authenticated from the transaction pool, and authenticating the transaction data.
S202, obtaining attribute information of the transaction data passing the authentication, and determining the th priority and the second priority of the transaction data passing the authentication according to the attribute information.
S203, adding the authenticated transaction data into the priority queue and the second priority queue according to the priority and the second priority of the authenticated transaction data.
In steps S201 to S203, for any transaction data authenticated in the transaction pool, where the attribute information includes priority information, and when determining the attribute information of the transaction data, the node may first determine an electronic resource amount obtained when uploading the authenticated transaction data to a blockchain network, and determine a receiving time when the transaction pool receives the authenticated transaction data, and further , after determining that the authenticated transaction data is uploaded to the blockchain network and corresponds to the electronic resource amount submitted to the node, and after the transaction pool receives the receiving time of the authenticated transaction data, the node may determine, according to the electronic resource amount, a priority of the authenticated transaction data in the priority queue, and may determine, according to the electronic resource amount and the receiving time, a second priority of the authenticated transaction data in the second priority queue.
In embodiments, the priority determined by the node is used for sorting the authenticated transaction data in the priority queue, and the second priority determined by the node is used for sorting the authenticated transaction data in the second priority queue, it is understood that when the authenticated transaction data is sorted in the priority queue according to the priority and when the authenticated transaction data is sorted in the second priority queue according to the second priority, the positions of the transaction data in the priority queue and the second priority queue are different, respectively, wherein the priority queue may be sorted based on { electronic resource amount X }, where X is any natural number greater than 0, and the second priority queue may be sorted based on { receive time (electronic resource amount +1 }.
In embodiments, the priority queue and the second priority queue in the transaction pool may directly store authenticated transaction data, or may store identification information of the authenticated transaction data, and correspondingly, when acquiring transaction data from the priority queue and the second priority queue, the node may directly extract authenticated transaction data stored in the priority queue as the transaction data and the second transaction data, respectively, or the node may also extract identification information corresponding to the authenticated transaction data from the priority queue, respectively, and further acquires authenticated transaction data from the transaction pool as the transaction data and the second transaction data according to the identification information.
In embodiments, the node may add the authenticated transaction data to a -th priority queue or to a second priority queue after determining attribute information of the authenticated transaction data, i.e. the authenticated transaction data may be added to the -th priority queue and the second priority queue simultaneously, specifically, the node may add the authenticated transaction data to the -th priority queue according to the -th priority, and the node may add the authenticated transaction data to the second priority queue according to the second priority, it may be understood that the authenticated transaction data of any in the transaction pool may be added to the second priority queue according to the -th priority and the second priority corresponding to the authenticated transaction data of any , the authenticated transaction data of any may be added to the second priority queue and the second priority queue according to the -th priority and the second priority corresponding to the authenticated transaction data of any , wherein the authenticated transaction data may be added to the second priority queue or the authentication data may be added to the second priority queue directly according to the authentication information of the authenticated transaction data.
For example, assuming that the number of authenticated transaction data in the transaction pool is N, the authenticated transaction data includes transaction data 1, transaction data 2, …, and transaction data N, where N is a positive integer greater than or equal to 1, if the amount of electronic resources provided to the node when uploading to the blockchain network according to the authenticated transaction data is based on the amount of electronic resources provided to the node, the node may determine priorities corresponding to the N transaction data according to the amounts of electronic resources provided by the N transaction data, so as to obtain a priority queue according to the priority, the priority queue may be { transaction data 1, transaction data 2, transaction data 3, …, transaction data N }, for example, the amount of electronic resources provided by the N transaction data, and the receiving time of each transaction data by the transaction pool, determine a second priority corresponding to the N transaction data, so as to obtain a second priority corresponding to the N transaction data according to the second priority, the second transaction data may be ranked according to the second priority, so as to obtain a second transaction data queue 853, the transaction data ….
In embodiments, the node, after determining attribute information of the authenticated transaction data, may add the authenticated transaction data to the th priority queue and the second priority queue simultaneously, based on the attribute information, and may also add of the th priority or the second priority based on the attribute information, wherein the node may further obtain a total amount of transaction data in the th priority queue and a total amount of transaction data in the second priority queue prior to adding the authenticated transaction data to the priority queue, such that a priority queue to which the authenticated transaction data is added may be determined based on the total amount of transaction data in the th priority queue and the total amount of transaction data in the second priority queue, and in particular, when the total amount of transaction data in the th priority queue is greater than the total amount of transaction data in the second priority queue, the authenticated transaction data may be stored in the second priority queue, or when the total amount of transaction data in the priority queue is less than the total amount of transaction data in the second priority queue, the authentication data may be added to the second priority queue, and/or the authentication data may be added to the priority queue after performing the step S204.
S204, in response to a trigger event for uploading the transaction data to the blockchain network, acquiring the transaction data from the th priority queue, and determining target transaction data according to the acquired transaction data.
In embodiments, the priority queue may include a first priority queue and a second priority queue, so the node may determine the target transaction data to include the transaction data obtained from a first priority queue and the transaction data obtained from the second priority queue, so the target transaction data may be determined based on the transaction data obtained from the first priority queue and the second priority queue, wherein the first priority queue is used to store authenticated transaction data at a first priority, the second priority queue is used to store authenticated transaction data at a second priority, the node may determine a selection policy for obtaining authenticated transaction data from the first priority queue and the second priority queue 632 when the transaction data is obtained from the first priority queue and the second priority queue, and the node may obtain transaction data from the first priority queue and obtain the second priority queue, and obtain the second transaction data from the second priority queue, the selection policy may obtain the second transaction data from the second priority queue as the transaction data queue 469, and obtain the transaction data from the second priority queue 469 as the transaction data queue 469, and obtain the transaction data from the transaction queue 469, wherein the transaction data obtained from the node may obtain the transaction data from the transaction queue and the transaction data queue 369 and obtain the transaction data from the transaction queue and the transaction data queue 469, wherein the transaction data obtained from the node may obtain the transaction data from the transaction data queue and obtain the transaction data from the transaction queue 369 may obtain the transaction data queue according to the transaction data queue 5828 and obtain the transaction data from the transaction data queue according to the transaction data queue when the transaction data obtained from the transaction data queue.
In embodiments, the transaction data stored in the priority queue is sorted in descending order from the highest priority to the lowest priority at 0, the transaction data stored in the second priority queue is sorted in descending order from the highest priority to the lowest priority at , the priority is the size of the electronic resource amount obtained when the transaction data is uploaded, the second priority is determined according to the receiving time of the transaction data by the node and the electronic resource amount obtained when the transaction data is uploaded to the blockchain network, the node may obtain th amount of transaction data from the priority queue as th transaction data and obtain second amount of transaction data from the second priority queue as second transaction data, the node may first obtain th amount of transaction data from the priority queue as second th transaction data in ascending order from the priority, and obtain second amount of transaction data from the second priority queue as second transaction data when the second amount of transaction data is obtained from the second priority queue as second transaction data.
In embodiments, if the th priority queue is { transaction data 1, transaction data 2, transaction data 3, …, transaction data N }, the second priority queue is { transaction data N, transaction data N-1, transaction data 3, …, transaction data 1}, the total amount of transaction data to be uploaded into the blockchain network obtained is assumed to be 100, the selection policy indicates that the selection ratio corresponding to the th priority queue is 80% and the second selection ratio corresponding to the second priority queue is 20%, the node may determine that the th amount of transaction data obtained from the th priority queue is 80 and the second amount of transaction data obtained from the second priority queue is 20. further , the node may obtain the transaction data ranked in the first 80 th priority queue from the { transaction data 1, transaction data 2, transaction data 3, …, transaction data N } as th transaction data and obtain the transaction data from the second priority queue { transaction data N, transaction data N-1, transaction data … } as second transaction data 3550.
In embodiments, the node may dynamically adjust the selection policy for the transaction data when detecting a change in the total amount of transaction data in th and second priority queues, thereby implementing an adjustment of th and second selection ratios, wherein when the node detects an increase in the total amount of transaction data in the th priority queue and a decrease in the total amount of transaction data in the second priority queue, the node may adjust the th and second selection ratios, specifically, when detecting a problem that the total amount of transaction data in the th priority queue is delayed for a long time and transaction data cannot be obtained in time, the node may adjust the selection policy to increase the th selection ratio and decrease the second selection ratio when the node selects transaction data according to the original selection policy, or when detecting a decrease in the transaction data in the th priority queue and the total amount of transaction data in the second priority queue is increased for a long time, the node may increase the selection policy and decrease the total amount of transaction data in the second priority queue, and when the node does not increase the total amount of transaction data in the second priority queue, the node may increase the selection policy to increase the selection policy for the network and decrease and increase the total amount of transaction data in the transaction queue .
In embodiments, the node may proceed to execute step S205 and step S206 after acquiring the transaction data (including the th transaction data and the second transaction data) as the target transaction data from the priority queue according to the pick policy.
S205, generating a target block, where the target block includes the target transaction data.
S206, upload the target block to the blockchain network.
In steps S205 and S206, the node may obtain a plurality of th transaction data and a plurality of second transaction data from the 35 th priority queue and the second priority queue, respectively, and before generating the target block, the node may determine duplicate transaction data from the th transaction data, which is obtained from the th priority queue and the second priority queue, respectively, and may delete the duplicate transaction data obtained from the th priority queue or delete the duplicate transaction data obtained from the second priority queue in order to avoid duplicate storage of transaction data by the target block and occupation of memory resources of the target block.
In embodiments, when the node stores the priority queue and the second priority queue in the transaction pool, if the priority queue is { transaction data 1, transaction data 2, transaction data 3, …, transaction data N }, and the second priority queue is { transaction data N, transaction data N-1, transaction data 3, …, transaction data 1}, wherein the priority queue may be as shown in fig. 3a, and the second priority queue may be as shown in fig. 3b, the node may determine the duplicate transaction data in the th transaction data and the second transaction data, which may be transaction data 3, after acquiring the transaction data from the priority queue as transaction data according to the selection policy and acquiring the transaction data from the second priority queue as the second transaction data, and the node may determine the duplicate transaction data in the th transaction data and the second transaction data, which may be transaction data 3, and may enter , delete the transaction data 3 acquired from the priority queue or delete the second transaction data acquired from the second priority queue for being uploaded to a target block of the network.
In the embodiment of the invention, a node can authenticate transaction data to be authenticated in a transaction pool and determine attribute information of the transaction data after authentication is passed, so that the transaction data can be added into a corresponding priority queue based on the attribute information, when the node receives a trigger event for uploading the transaction data to a block chain network, the node can acquire the transaction data from an th priority queue according to a selection strategy after determining the selection strategy of the transaction data, and can determine target transaction data according to the transaction data acquired from a th priority queue, and then , the node can generate a target block to store the target transaction data and upload the target block to the block chain network, and the transaction pool in the node is divided into the priority queue in advance, so that the node can quickly acquire the transaction data from the priority queue and realize uplink storage of the transaction data, and the problem of waiting for progress caused by waiting for acquiring the transaction data in the process of acquiring the transaction data can be effectively avoided.
Based on the description of the above data processing method embodiment, the embodiment of the present invention further provides data processing apparatuses, which may be computer programs (including program codes) running in the above node device, and which may execute the data processing method described in fig. 1 and fig. 2, please refer to fig. 4, where the data processing apparatus includes an obtaining unit 401, an authenticating unit 402, an adding unit 403, a generating unit 404, and an uploading unit 405.
An obtaining unit 401, configured to obtain transaction data to be authenticated from the transaction pool;
an authentication unit 402, configured to perform authentication processing on the transaction data;
an adding unit 403, configured to add authenticated transaction data to the priority queue, where the authenticated transaction data is added to the th priority queue, the th priority queue is sorted according to an amount of electronic resources related to the transaction data, and in the th priority queue, the transaction data with the larger amount of electronic resources is processed preferentially;
the obtaining unit 401 is further configured to, in response to a trigger event for uploading the transaction data to the blockchain network, obtain the transaction data from the th priority queue, and determine target transaction data according to the obtained transaction data;
a generating unit 404, configured to generate a target block, where the target block includes the target transaction data;
an upload unit 405, configured to upload the target block to the blockchain network.
In embodiments, the priority queue further comprises a second priority queue, wherein the priority queue is used to store authenticated transaction data with priority, the second priority queue is used to store authenticated transaction data with a second priority, the priority refers to the size of the electronic resource amount obtained when the transaction data is uploaded, the second priority is determined according to the receiving time of the transaction data received by the node and the electronic resource amount obtained when the transaction data is uploaded to the blockchain network,
the adding the authenticated transaction data into the priority queue further comprises: adding the authenticated transaction data to the second priority queue,
the obtaining unit 401 is specifically configured to:
determining a selection strategy for acquiring the authenticated transaction data from the th priority queue and the second priority queue, acquiring th transaction data from the th priority queue and acquiring second transaction data from the second priority queue according to the selection strategy, and determining the target transaction data according to the th transaction data and the second transaction data.
In embodiments, the selection policy includes a selection ratio corresponding to the priority queue and a second selection ratio corresponding to the second priority queue;
the obtaining unit 401 is specifically configured to:
acquiring the total amount of transaction data to be uploaded to the block chain network;
determining a number according to the total transaction data amount and the selection ratio, and determining a second number according to the total transaction data amount and the second selection ratio;
obtain the th amount of transaction data from the th priority queue as th transaction data and obtain the second amount of transaction data from the second priority queue as second transaction data.
In embodiments, the transaction data stored in the priority queue is sorted in descending order of the priority, and the transaction data stored in the second priority queue is sorted in descending order of the second priority;
the obtaining unit 401 is specifically configured to:
acquiring the th amount of transaction data from the th priority queue in the order of the th priority from high to low as th transaction data;
and acquiring the second amount of transaction data from the second priority queue as second transaction data according to the sequence of the second priority from high to low.
In embodiments, the apparatus further comprises an adjustment unit 406.
An adjusting unit 406, configured to adjust the selection ratio and the second selection ratio according to the total amount of the transaction data in the th priority queue and the total amount of the transaction data in the second priority queue.
In embodiments, the adjusting unit 406 is specifically configured to:
when detecting that the total amount of the transaction data in the th priority queue is increased and the total amount of the transaction data in the second priority queue is decreased, increasing the th selection ratio and decreasing the second selection ratio;
when detecting that the total amount of transaction data in the th priority queue is decreased and the total amount of transaction data in the second priority queue is increased, decreasing the th selection ratio and increasing the second selection ratio.
In embodiments, the authenticated transaction data is further added to the second priority queue, wherein the priority queue is for storing authenticated transaction data at a priority level, the second priority queue is for storing authenticated transaction data at a second priority level,
the adding unit 403 is specifically configured to:
acquiring attribute information of the authenticated transaction data, and determining th priority and the second priority of the authenticated transaction data according to the attribute information;
adding the authenticated transaction data to the priority queue and the second priority queue based on the priority level and the second priority level of the authenticated transaction data.
In embodiments, the adding unit 403 is specifically configured to:
determining the electronic resource amount obtained when the authenticated transaction data is uploaded to a block chain network, and determining the receiving time of the transaction pool for receiving the authenticated transaction data;
determining the priority of the authenticated transaction data in the priority queue according to the amount of electronic resources,
and determining the second priority of the authenticated transaction data in the second priority queue according to the electronic resource amount and the receiving time.
In embodiments, the adding unit 403 is specifically configured to:
adding the authenticated transaction data to the priority queue according to the priority, and,
and adding the transaction data passing the authentication into the second priority queue according to the second priority.
In embodiments, the obtaining unit 401 is further configured to obtain a total amount of transaction data in the th priority queue and a total amount of transaction data in the second priority queue;
the adding unit 403 is specifically configured to:
when the total amount of transaction data in the th priority queue is less than or equal to the total amount of transaction data in the second priority queue, adding authenticated transaction data to the th priority queue.
In embodiments, the adding unit 403 is further configured to store the authenticated transaction data in the second priority queue when the total amount of transaction data in the th priority queue is greater than the total amount of transaction data in the second priority queue.
In embodiments, the number of the th transaction data and the second transaction data is multiple, respectively, the device further comprises a determining unit 407 and a deleting unit 408.
A determining unit 407, configured to determine, from the th transaction data, repeated transaction data, where the repeated transaction data is obtained from the th priority queue and obtained from the second priority queue;
a deleting unit 408, configured to delete the repeat transaction data obtained from the th priority queue or delete the repeat transaction data obtained from the second priority queue.
In an embodiment of the present invention, the transaction pool includes a priority queue for storing authenticated transaction data, the transaction pool includes -th priority queue, the obtaining unit 401 may obtain transaction data to be authenticated from the transaction pool, so that the authenticating unit 402 may perform authentication processing on the transaction data, so that the adding unit 403 may add the transaction data to the priority queue after the authentication on the transaction data is passed, when the adding unit 403 adds the authenticated transaction data to the priority queue, at least the authenticated transaction data is added to the -th priority queue, so that when a trigger event for uploading the transaction data to the blockchain network is detected, the obtaining unit 401 may determine target transaction data according to the transaction data obtained from the -th priority queue and thus, after the target transaction data is determined, the generating unit 404 may directly generate a target block to store the target transaction data, and further steps are performed, and the uploading unit 405 may upload the target block to the blockchain network to obtain the transaction data, so that the transaction data can be uploaded to improve the transaction efficiency of the transaction data after the transaction data is uploaded to the block chain network, and thus the transaction data can be directly uploaded to improve the transaction efficiency of the transaction data.
Please refer to fig. 5, which is a schematic block diagram illustrating a structure of node devices according to an embodiment of the present invention, where the node devices may be server devices or terminal devices, and the node devices are the nodes described above, the node devices in the embodiment of the present invention shown in fig. 5 may include or more processors 501, or more input devices 502, or more output devices 503 and a memory 504, where the processors 501, the input devices 502, the output devices 503 and the memory 504 are connected through a bus 505, the memory 504 is used for storing computer programs, and the computer programs include program instructions, and the processors 501 are used for executing the program instructions stored in the memory 504.
The memory 504 may include volatile memory (volatile memory), such as random-access memory (RAM); the memory 504 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a solid-state drive (SSD), etc.; the memory 504 may also comprise a combination of the above-described types of memory.
The processor 501 may be a Central Processing Unit (CPU), the processor 501 may further include steps of hardware chips, the hardware chips may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), etc., the PLD may be a field-programmable logic array (FPGA), a General Array Logic (GAL), etc., and the processor 501 may also be a combination of the above structures.
In embodiments, the processor 501 is configured to call the program instructions for performing:
acquiring transaction data to be authenticated from the transaction pool, and authenticating the transaction data;
adding authenticated transaction data to the priority queue, wherein the authenticated transaction data is added to the th priority queue, wherein the th priority queue is ordered according to an amount of electronic resources associated with the transaction data, and wherein in the th priority queue, transaction data having a greater amount of electronic resources is processed preferentially;
responding to a trigger event for uploading the transaction data to the blockchain network, acquiring the transaction data from the priority queue, and determining target transaction data according to the acquired transaction data;
generating a target tile, the target tile comprising the target transaction data;
uploading the target tiles to the blockchain network.
In embodiments, the priority queue further comprises a second priority queue, wherein the priority queue is used to store authenticated transaction data with priority, the second priority queue is used to store authenticated transaction data with a second priority, the priority refers to the size of the electronic resource amount obtained when the transaction data is uploaded, the second priority is determined according to the receiving time of the transaction data received by the node and the electronic resource amount obtained when the transaction data is uploaded to the blockchain network,
the adding the authenticated transaction data into the priority queue further comprises: adding the authenticated transaction data into the second priority queue;
the processor 501 is configured to call the program instructions, and is further configured to perform:
determining a selection strategy for acquiring the authenticated transaction data from the th priority queue and the second priority queue, acquiring th transaction data from the th priority queue and acquiring second transaction data from the second priority queue according to the selection strategy, and determining the target transaction data according to the th transaction data and the second transaction data.
In embodiments, the selection policy includes a selection ratio corresponding to the priority queue and a second selection ratio corresponding to the second priority queue;
the processor 501 is configured to call the program instructions for performing:
acquiring the total amount of transaction data to be uploaded to the block chain network;
determining a number according to the total transaction data amount and the selection ratio, and determining a second number according to the total transaction data amount and the second selection ratio;
obtain the th amount of transaction data from the th priority queue as th transaction data and obtain the second amount of transaction data from the second priority queue as second transaction data.
In embodiments, the transaction data stored in the priority queue is sorted in descending order of the priority, and the transaction data stored in the second priority queue is sorted in descending order of the second priority;
the processor 501 is configured to call the program instructions for performing:
acquiring the th amount of transaction data from the th priority queue in the order of the th priority from high to low as th transaction data;
and acquiring the second amount of transaction data from the second priority queue as second transaction data according to the sequence of the second priority from high to low.
In embodiments, the processor 501 is configured to call the program instructions for performing:
adjusting the selection ratio and the second selection ratio according to the total amount of the transaction data in the priority queue and the total amount of the transaction data in the second priority queue.
In embodiments, the processor 501 is configured to call the program instructions for performing:
when detecting that the total amount of the transaction data in the th priority queue is increased and the total amount of the transaction data in the second priority queue is decreased, increasing the th selection ratio and decreasing the second selection ratio;
when detecting that the total amount of transaction data in the th priority queue is decreased and the total amount of transaction data in the second priority queue is increased, decreasing the th selection ratio and increasing the second selection ratio.
In embodiments, the authenticated transaction data is further added to the second priority queue, wherein the priority queue is configured to store authenticated transaction data at a priority level, the second priority queue is configured to store authenticated transaction data at a second priority level, and the processor 501 is configured to invoke the program instructions to perform:
acquiring attribute information of the authenticated transaction data, and determining th priority and the second priority of the authenticated transaction data according to the attribute information;
adding the authenticated transaction data to the priority queue and the second priority queue based on the priority level and the second priority level of the authenticated transaction data.
The processor 501 is configured to call the program instructions for performing:
determining the electronic resource amount obtained when the authenticated transaction data is uploaded to a block chain network, and determining the receiving time of the transaction pool for receiving the authenticated transaction data;
determining the priority of the authenticated transaction data in the priority queue according to the amount of electronic resources,
and determining the second priority of the authenticated transaction data in the second priority queue according to the electronic resource amount and the receiving time.
In embodiments, the processor 501 is configured to call the program instructions for performing:
adding the authenticated transaction data to the priority queue according to the priority, and,
and adding the transaction data passing the authentication into the second priority queue according to the second priority.
In embodiments, the priority queues further include a second priority queue, wherein the priority queue is configured to store authenticated transaction data at a priority level, the second priority queue is configured to store authenticated transaction data at a second priority level, and the processor 501 is configured to invoke the program instructions to perform:
acquiring total transaction data amount in the priority queue and the total transaction data amount in the second priority queue;
when the total amount of transaction data in the th priority queue is less than or equal to the total amount of transaction data in the second priority queue, adding authenticated transaction data to the th priority queue.
In embodiments, the processor 501 is configured to call the program instructions for performing:
and when the total amount of transaction data in the th priority queue is greater than that in the second priority queue, storing the authenticated transaction data in the second priority queue.
In embodiments, the number of the th transaction data and the second transaction data is plural respectively;
the processor 501 is configured to call the program instructions for performing:
determining repeat transaction data from the transaction data, the repeat transaction data being transaction data obtained from the priority queue and obtained from the second priority queue;
deleting the repeat transaction data obtained from the th priority queue or deleting the repeat transaction data obtained from the second priority queue.
It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments may be implemented by instructing the relevant hardware through a computer program, and the program may be stored in computer readable storage medium, and when executed, the program may include the processes of the above embodiments of the methods.
While the invention has been described with reference to a particular embodiment, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (15)

1, A data processing method, wherein the data processing method is used for any node in a blockchain network, the node comprises a transaction pool, the transaction pool comprises a priority queue, the priority queue comprises a priority queue, the priority queue is used for storing authenticated transaction data, the method comprises:
acquiring transaction data to be authenticated from the transaction pool, and authenticating the transaction data;
adding authenticated transaction data to the priority queue, wherein the authenticated transaction data is added to the th priority queue, wherein the th priority queue is ordered according to an amount of electronic resources associated with the transaction data, and wherein in the th priority queue, transaction data having a greater amount of electronic resources is processed preferentially;
in response to a trigger event for uploading the transaction data to the blockchain network, acquiring the transaction data from the th priority queue, and determining target transaction data according to the acquired transaction data;
generating a target tile, the target tile comprising the target transaction data;
uploading the target tiles to the blockchain network.
2. The method of claim 1, wherein the priority queues further comprise a second priority queue, wherein the st priority queue is used for storing authenticated transaction data with st priority, the second priority queue is used for storing authenticated transaction data with a second priority, the st priority refers to the size of the obtained electronic resource amount when uploading the transaction data, the second priority is determined according to the receiving time of the transaction data received by the node and the obtained electronic resource amount when uploading the transaction data to the blockchain network,
the adding the authenticated transaction data into the priority queue further comprises: adding the authenticated transaction data to the second priority queue,
the steps of obtaining the transaction data from the th priority queue and determining target transaction data according to the obtained transaction data comprise the steps of determining a selection strategy for obtaining the authenticated transaction data from the th priority queue and the second priority queue, obtaining the th transaction data from the th priority queue according to the selection strategy and obtaining the second transaction data from the second priority queue, and determining the target transaction data according to the th transaction data and the second transaction data.
3. The method of claim 2, wherein the selection policy includes a selection ratio corresponding to the th priority queue and a second selection ratio corresponding to the second priority queue;
the obtaining th transaction data from the th priority queue and the second transaction data from the second priority queue according to the selection policy comprises:
acquiring the total amount of transaction data to be uploaded to the block chain network;
determining a number according to the total transaction data amount and the selection ratio, and determining a second number according to the total transaction data amount and the second selection ratio;
obtain the th amount of transaction data from the th priority queue as th transaction data and obtain the second amount of transaction data from the second priority queue as second transaction data.
4. The method of claim 3, wherein the priority queue stores transaction data in descending order of the priority, and the second priority queue stores transaction data in descending order of the second priority;
the obtaining the th amount of transaction data from the th priority queue as th transaction data and the second amount of transaction data from the second priority queue as second transaction data comprises:
acquiring the th amount of transaction data from the th priority queue in the order of the th priority from high to low as th transaction data;
and acquiring the second amount of transaction data from the second priority queue as second transaction data according to the sequence of the second priority from high to low.
5. The method of claim 3, further comprising:
adjusting the selection ratio and the second selection ratio according to the total amount of the transaction data in the priority queue and the total amount of the transaction data in the second priority queue.
6. The method of claim 5, wherein adjusting the selected ratio and the selected ratio based on the total amount of transaction data in the th priority queue and the total amount of transaction data in the second priority queue comprises:
when detecting that the total amount of the transaction data in the th priority queue is increased and the total amount of the transaction data in the second priority queue is decreased, increasing the th selection ratio and decreasing the second selection ratio;
when detecting that the total amount of transaction data in the th priority queue is decreased and the total amount of transaction data in the second priority queue is increased, decreasing the th selection ratio and increasing the second selection ratio.
7. The method of claim 1, wherein the authenticated transaction data is further added to a second priority queue, wherein the th priority queue is configured to store authenticated transaction data at th priority level, wherein the second priority queue is configured to store authenticated transaction data at a second priority level, and wherein the adding authenticated transaction data to the priority queue comprises:
acquiring attribute information of the authenticated transaction data, and determining th priority and the second priority of the authenticated transaction data according to the attribute information;
adding the authenticated transaction data to the priority queue and the second priority queue based on the priority level and the second priority level of the authenticated transaction data.
8. The method as claimed in claim 7, wherein said determining priority and said second priority of said authenticated transaction data based on said attribute information comprises:
determining the electronic resource amount obtained when the authenticated transaction data is uploaded to a block chain network, and determining the receiving time of the transaction pool for receiving the authenticated transaction data;
determining the priority of the authenticated transaction data in the priority queue according to the amount of electronic resources,
and determining the second priority of the authenticated transaction data in the second priority queue according to the electronic resource amount and the receiving time.
9. The method of claim 8, wherein the adding the authenticated transaction data to the priority queue and the second priority queue according to the priority level and the second priority level of the authenticated transaction data comprises:
adding the authenticated transaction data to the priority queue according to the priority, and,
and adding the transaction data passing the authentication into the second priority queue according to the second priority.
10. The method of claim 2, wherein prior to adding authenticated transaction data to the priority queue, the method further comprises:
acquiring total transaction data amount in the priority queue and the total transaction data amount in the second priority queue;
adding authenticated transaction data into the priority queue, including:
when the total amount of transaction data in the th priority queue is less than or equal to the total amount of transaction data in the second priority queue, adding authenticated transaction data to the th priority queue.
11. The method of claim 10, further comprising:
and when the total amount of transaction data in the th priority queue is greater than that in the second priority queue, storing the authenticated transaction data in the second priority queue.
12. The method of claim 2, wherein the th transaction data and the second transaction data are respectively in a plurality of quantities, and wherein before the generating the target block, the method further comprises:
determining repeat transaction data from the transaction data, the repeat transaction data being transaction data obtained from the priority queue and obtained from the second priority queue;
deleting the repeat transaction data obtained from the th priority queue or deleting the repeat transaction data obtained from the second priority queue.
A data processing apparatus of the type 13, , the data processing apparatus being for use at any node in a blockchain network, the node comprising a transaction pool including a priority queue including a th priority queue, the th priority queue being for storing authenticated transaction data, the apparatus comprising:
the acquisition unit is used for acquiring the transaction data to be authenticated from the transaction pool;
the authentication unit is used for carrying out authentication processing on the transaction data;
an adding unit, configured to add authenticated transaction data to the priority queue, where the authenticated transaction data is added to the th priority queue, the th priority queue is sorted according to an amount of electronic resources related to the transaction data, and in the th priority queue, transaction data with a larger amount of electronic resources is preferentially processed;
the acquisition unit is further used for responding to a trigger event for uploading the transaction data to the blockchain network, acquiring the transaction data from the th priority queue, and determining target transaction data according to the acquired transaction data;
a generating unit for generating a target block, the target block including the target transaction data;
and the uploading unit is used for uploading the target block to the block chain network.
node device, comprising a processor, a memory and a communication interface, the processor, the memory and the communication interface being interconnected, wherein the memory is used for storing computer program instructions and the processor is configured for executing the program instructions to implement the method of any of claims 1-12 to .
15, computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to perform the method of any of claims 1-12 to .
CN201911313426.1A 2019-12-19 2019-12-19 Data processing method and device, node equipment and storage medium Active CN110738497B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911313426.1A CN110738497B (en) 2019-12-19 2019-12-19 Data processing method and device, node equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911313426.1A CN110738497B (en) 2019-12-19 2019-12-19 Data processing method and device, node equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110738497A true CN110738497A (en) 2020-01-31
CN110738497B CN110738497B (en) 2020-03-31

Family

ID=69274613

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911313426.1A Active CN110738497B (en) 2019-12-19 2019-12-19 Data processing method and device, node equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110738497B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111339086A (en) * 2020-02-18 2020-06-26 腾讯科技(深圳)有限公司 Block processing method, and data query method and device based on block chain
CN111400043A (en) * 2020-03-13 2020-07-10 杭州复杂美科技有限公司 Transaction pool management method, device and storage medium
CN111415259A (en) * 2020-03-26 2020-07-14 杭州复杂美科技有限公司 Transaction queuing method, device and storage medium
CN111600720A (en) * 2020-05-20 2020-08-28 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on block chain and readable storage medium
CN111638963A (en) * 2020-06-08 2020-09-08 杭州复杂美科技有限公司 Transaction pool dynamic control method, device and storage medium
CN112348516A (en) * 2020-11-30 2021-02-09 陈素华 Transaction management method based on cloud computing and financial cloud platform
CN113256877A (en) * 2020-12-31 2021-08-13 深圳怡化电脑股份有限公司 Paper money information management method, device, storage medium and computer equipment
CN113656510A (en) * 2021-08-26 2021-11-16 支付宝(杭州)信息技术有限公司 Method and device for executing transaction in blockchain system
CN115271746A (en) * 2022-09-27 2022-11-01 江苏荣泽信息科技股份有限公司 Block chain transaction sorting algorithm with priority
WO2023142605A1 (en) * 2022-01-25 2023-08-03 腾讯科技(深圳)有限公司 Blockchain-based data processing method and related apparatus

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886890A (en) * 2017-02-07 2017-06-23 杭州秘猿科技有限公司 A kind of timing transaction execution method based on block chain
CN108512775A (en) * 2018-04-16 2018-09-07 杭州秘猿科技有限公司 A kind of method and device of sequence transaction queue
CN109669789A (en) * 2018-12-10 2019-04-23 杭州复杂美科技有限公司 Transaction queuing strategy, trading pit storage method, equipment and storage medium
CN109710387A (en) * 2018-12-06 2019-05-03 成都佰纳瑞信息技术有限公司 A kind of policy engine and its application method for block chain affairs priority ranking
US20190287082A1 (en) * 2018-03-13 2019-09-19 WAY2BIT Co. Ltd. Method for processing transactions using blockchain networks, and transaction management server using the same
CN110278256A (en) * 2019-06-13 2019-09-24 思力科(深圳)电子科技有限公司 Block chain node accesses cochain method, relevant device and system
US10438275B2 (en) * 2016-09-28 2019-10-08 Paypal, Inc. Method, medium, and system for managing de-queueing operations of transaction queues
US20190332527A1 (en) * 2018-04-25 2019-10-31 Dell Products, Lp Information Handling System with Priority Based Cache Flushing of Flash Dual In-Line Memory Module Pool

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10438275B2 (en) * 2016-09-28 2019-10-08 Paypal, Inc. Method, medium, and system for managing de-queueing operations of transaction queues
CN106886890A (en) * 2017-02-07 2017-06-23 杭州秘猿科技有限公司 A kind of timing transaction execution method based on block chain
US20190287082A1 (en) * 2018-03-13 2019-09-19 WAY2BIT Co. Ltd. Method for processing transactions using blockchain networks, and transaction management server using the same
CN108512775A (en) * 2018-04-16 2018-09-07 杭州秘猿科技有限公司 A kind of method and device of sequence transaction queue
US20190332527A1 (en) * 2018-04-25 2019-10-31 Dell Products, Lp Information Handling System with Priority Based Cache Flushing of Flash Dual In-Line Memory Module Pool
CN109710387A (en) * 2018-12-06 2019-05-03 成都佰纳瑞信息技术有限公司 A kind of policy engine and its application method for block chain affairs priority ranking
CN109669789A (en) * 2018-12-10 2019-04-23 杭州复杂美科技有限公司 Transaction queuing strategy, trading pit storage method, equipment and storage medium
CN110278256A (en) * 2019-06-13 2019-09-24 思力科(深圳)电子科技有限公司 Block chain node accesses cochain method, relevant device and system

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111339086B (en) * 2020-02-18 2021-04-20 腾讯科技(深圳)有限公司 Block processing method, and data query method and device based on block chain
CN111339086A (en) * 2020-02-18 2020-06-26 腾讯科技(深圳)有限公司 Block processing method, and data query method and device based on block chain
CN111400043A (en) * 2020-03-13 2020-07-10 杭州复杂美科技有限公司 Transaction pool management method, device and storage medium
CN111415259A (en) * 2020-03-26 2020-07-14 杭州复杂美科技有限公司 Transaction queuing method, device and storage medium
CN111415259B (en) * 2020-03-26 2024-02-06 杭州复杂美科技有限公司 Transaction queuing method, device and storage medium
CN111600720B (en) * 2020-05-20 2021-09-28 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on block chain and readable storage medium
CN111600720A (en) * 2020-05-20 2020-08-28 腾讯科技(深圳)有限公司 Data processing method, device and equipment based on block chain and readable storage medium
WO2021233049A1 (en) * 2020-05-20 2021-11-25 腾讯科技(深圳)有限公司 Blockchain–based data processing method, apparatus, device, and readable storage medium
CN111638963A (en) * 2020-06-08 2020-09-08 杭州复杂美科技有限公司 Transaction pool dynamic control method, device and storage medium
CN112348516B (en) * 2020-11-30 2021-09-10 东方财富证券股份有限公司 Transaction management method based on cloud computing and financial cloud platform system
CN112348516A (en) * 2020-11-30 2021-02-09 陈素华 Transaction management method based on cloud computing and financial cloud platform
CN113256877A (en) * 2020-12-31 2021-08-13 深圳怡化电脑股份有限公司 Paper money information management method, device, storage medium and computer equipment
CN113256877B (en) * 2020-12-31 2024-02-02 深圳怡化电脑股份有限公司 Banknote information management method, banknote information management device, banknote information management storage medium, and computer device
CN113656510A (en) * 2021-08-26 2021-11-16 支付宝(杭州)信息技术有限公司 Method and device for executing transaction in blockchain system
WO2023142605A1 (en) * 2022-01-25 2023-08-03 腾讯科技(深圳)有限公司 Blockchain-based data processing method and related apparatus
CN115271746A (en) * 2022-09-27 2022-11-01 江苏荣泽信息科技股份有限公司 Block chain transaction sorting algorithm with priority

Also Published As

Publication number Publication date
CN110738497B (en) 2020-03-31

Similar Documents

Publication Publication Date Title
CN110738497B (en) Data processing method and device, node equipment and storage medium
Shah et al. The MDS queue: Analysing the latency performance of erasure codes
CN107800768B (en) Open platform control method and system
CN110248417B (en) Resource allocation method and system for communication service in power Internet of things
CN109617996B (en) File uploading and downloading method, server and computer readable storage medium
CN103188279A (en) Method and device for downloading file from neighbor nodes through peer-to-peer network
WO2022267715A1 (en) Oracle machine node screening method and apparatus, and storage medium and electronic apparatus
CN111222306A (en) Data processing method and device, electronic equipment and storage medium
CN104283643A (en) Message speed limiting method and device
CN111158892B (en) Task queue generating method, device and equipment
CN114153581A (en) Data processing method, data processing device, computer equipment and storage medium
CN110333916B (en) Request message processing method, device, computer system and readable storage medium
CN113254210A (en) OFD file signature verification method, system and equipment based on cloud service
CN110377430B (en) Data migration method, device, storage medium and device
CN112119608B (en) System and asynchronous protocol for verifiable secret sharing
CN116703601A (en) Data processing method, device, equipment and storage medium based on block chain network
CN114780228B (en) Hybrid cloud resource creation method and system
CN113127289B (en) Resource management method, computer equipment and storage medium based on YARN cluster
CN114911605A (en) Docker container scheduling algorithm based on multidimensional resource constraint backfill
CN114675845A (en) Information age optimization method and device, computer equipment and storage medium
CN113778685A (en) Unloading method for urban gas pipe network edge computing system
CN112181672B (en) Block chain data processing method, block chain system and computer storage medium
JP6953759B2 (en) Authentication device, authentication method and program
CN113132324B (en) Sample identification method and system
CN116401071B (en) Resource allocation method and system for edge calculation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant