CN112764897B - Task request processing method, device and system and computer readable storage medium - Google Patents

Task request processing method, device and system and computer readable storage medium Download PDF

Info

Publication number
CN112764897B
CN112764897B CN202011641801.8A CN202011641801A CN112764897B CN 112764897 B CN112764897 B CN 112764897B CN 202011641801 A CN202011641801 A CN 202011641801A CN 112764897 B CN112764897 B CN 112764897B
Authority
CN
China
Prior art keywords
task
task requests
contract
data dependency
requests
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.)
Active
Application number
CN202011641801.8A
Other languages
Chinese (zh)
Other versions
CN112764897A (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.)
Hangzhou Qulian Technology Co Ltd
Original Assignee
Hangzhou Qulian Technology 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 Hangzhou Qulian Technology Co Ltd filed Critical Hangzhou Qulian Technology Co Ltd
Priority to CN202011641801.8A priority Critical patent/CN112764897B/en
Publication of CN112764897A publication Critical patent/CN112764897A/en
Application granted granted Critical
Publication of CN112764897B publication Critical patent/CN112764897B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a task request processing method, device, system and computer readable storage medium, which are used for realizing more efficient parallel processing efficiency according to identified data dependency relationships among task requests and contract conflict relationships among intelligent contracts required to be called. The method comprises the following steps: acquiring a plurality of first task requests to be processed in a blockchain platform, wherein the first task requests are used for requesting the blockchain platform to process target tasks; identifying data dependency relationships among the plurality of first task requests and identifying contract conflict relationships among intelligent contracts required to be invoked by the plurality of first task requests respectively; dividing a plurality of first task requests according to the data dependency relationship and different intelligent contracts to obtain a plurality of task request sets, wherein the task request sets comprise a plurality of second task requests with execution sequences configured; the blockchain node device in the blockchain platform is instructed to execute task requests in the plurality of task request sets in parallel.

Description

Task request processing method, device and system and computer readable storage medium
Technical Field
The present invention relates to the field of task request processing, and in particular, to a task request processing method, device, system, and computer readable storage medium.
Background
Currently, in most blockchain platforms, serial execution of tasks is used. Because the tasks on the blockchain have a sequence, a certain task may need to rely on a previous execution result of a certain task to be executed correctly, and in order to ensure consistency of the execution result of the task on each node, the blockchain performs serial execution according to the sequence of blocks on the chain and the sequence of the tasks in the blocks: and acquiring a block with the number N of the block to be executed on the block chain, serially executing each task according to the execution sequence of the tasks in the block, persisting the execution record to storage after all the tasks of the block are executed, then acquiring the block with the number N+1 of the next block to be executed, serially executing each task according to the execution sequence of the tasks in the block, persisting the execution record to storage after all the tasks in the block are executed, and continuing to acquire the block … with the number N+2 of the next block to be executed.
Under the application requirement of fast executing tasks, in the blockchain technology, a parallel executing task executing mode can be introduced, and different task groups are obtained by analyzing the relevance between tasks or dividing the tasks according to the analyzed relevance, so that the task groups can be executed in parallel under the condition that the relevance is not considered to exist between the task groups, thereby achieving the purpose of improving the task executing efficiency.
In the research process of the prior related art, the inventor finds that the prior parallel execution mode still has a certain limit on the processing efficiency, and if the parallel execution efficiency can be continuously improved, the method is obviously beneficial to the application of the blockchain.
Disclosure of Invention
The application provides a task request processing method, device, system and computer readable storage medium, which are used for promoting a more accurate and effective task request grouping mode according to a recognized data dependency relationship between task requests and a contract conflict relationship between intelligent contracts required to be called, so that more efficient parallel processing efficiency can be realized for the tasks.
In a first aspect, the present application provides a method for processing a task request, where the method includes:
acquiring a plurality of first task requests to be processed in a blockchain platform, wherein the first task requests are used for requesting the blockchain platform to process target tasks;
identifying data dependency relationships among the plurality of first task requests and identifying contract conflict relationships among intelligent contracts required to be invoked by the plurality of first task requests respectively;
dividing a plurality of first task requests according to the data dependency relationship and different intelligent contracts to obtain a plurality of task request sets, wherein the task request sets comprise a plurality of second task requests with execution sequences configured;
The blockchain node device in the blockchain platform is instructed to execute task requests in the plurality of task request sets in parallel.
With reference to the first aspect of the present application, in a first possible implementation manner of the first aspect of the present application, identifying a contract conflict relationship existing between smart contracts that need to be invoked by a plurality of first task requests respectively includes:
identifying a first intelligent contract and a second intelligent contract which are respectively required to be called in a plurality of first task requests;
taking a contract address of a first intelligent contract and a user address of a task request needing to call the first intelligent contract as a first judging unit, and taking a contract address of a second intelligent contract and a user address of a task request needing to call the second intelligent contract as a second judging unit, and judging whether the first judging unit and the second judging unit have correlation on addresses or not;
if so, a first contract conflict relationship is determined, wherein the first contract conflict relationship is used for indicating that a conflict exists between the first intelligent contract and the second intelligent contract.
With reference to the first aspect of the present application, in a second possible implementation manner of the first aspect of the present application, identifying a contract conflict relationship existing between smart contracts that need to be invoked by a plurality of first task requests respectively includes:
Identifying identical third intelligent contracts respectively invoked in the plurality of first task requests;
analyzing whether intersection exists in the read-write data structure when the third intelligent contract is called to execute a plurality of third task requests;
if so, a second contract conflict relationship is determined, wherein the second contract conflict relationship is used to indicate that the third intelligent agent is in conflict when executing the plurality of third task requests.
With reference to the first aspect of the present application, in a third possible implementation manner of the first aspect of the present application, identifying a contract conflict relationship existing between smart contracts that need to be invoked by a plurality of first task requests respectively includes:
identifying identical third intelligent contracts respectively invoked in the plurality of first task requests;
analyzing different contract contents required to be called by the plurality of third task requests in the third intelligent contract respectively;
judging whether different contract contents are configured with parallel identifiers or not, wherein the parallel identifiers are used for identifying that no conflict exists between the different contract contents in advance;
if yes, determining a third contract conflict relation, wherein the third contract conflict relation is used for indicating that a plurality of third task requests have no conflict when a third intelligent contract is called.
With reference to the first aspect of the present application or any one of possible implementation manners of the first aspect, in a fourth possible implementation manner of the first aspect of the present application, identifying a data dependency relationship existing between a plurality of first task requests includes:
determining target data dependency relationship determination strategies adapted to the plurality of first task requests from a data dependency relationship determination strategy set according to application scenes corresponding to the plurality of first task requests, wherein the data dependency relationship determination strategy set contains different data dependency relationship determination strategies adapted to different application scenes;
and identifying data dependency relationships existing among the plurality of first task requests according to the target data dependency relationship determination strategy.
With reference to the fourth possible implementation manner of the first aspect of the present application, in a fifth possible implementation manner of the first aspect of the present application, the data dependency determination policy set includes a data dependency determination policy for transfer application scenario adaptation, where the data dependency determination policy for transfer application scenario adaptation includes: and judging whether the transfer processing involves the same account number transferred in or the same account number transferred out, if so, determining the data dependency relationship.
With reference to the first aspect of the present application or any one of the possible implementation manners of the first aspect, in a sixth possible implementation manner of the first aspect of the present application, the method is performed by a first process of a blockchain node device in a blockchain platform, parallel execution of task requests in a plurality of task request sets is performed by a second process of the blockchain node device in the blockchain platform, and storage of execution results of task requests in the plurality of task request sets is performed by a third process of the blockchain node device in the blockchain platform.
With reference to the first aspect of the present application or any one of possible implementation manners of the first aspect, in a seventh possible implementation manner of the first aspect of the present application, obtaining a plurality of first task requests to be processed in a blockchain platform includes:
a plurality of first task requests are obtained from a plurality of blocks to be processed in a blockchain platform.
With reference to the first aspect of the present application or any one of possible implementation manners of the first aspect, in an eighth possible implementation manner of the first aspect of the present application, identifying a data dependency relationship existing between a plurality of first task requests and identifying a contract conflict relationship existing between intelligent contracts that need to be invoked by the plurality of first task requests respectively, includes:
performing pre-execution processing on the plurality of first task requests;
during the pre-execution processing, the data dependency relationship existing among the plurality of first task requests and the contract conflict relationship existing among intelligent contracts required to be invoked by the plurality of first task requests are identified.
In a second aspect, the present application provides a processing apparatus for task requests, where the apparatus includes:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a plurality of first task requests to be processed in a blockchain platform, and the first task requests are used for requesting the blockchain platform to process target tasks;
The identification unit is used for identifying data dependency relations among the plurality of first task requests and identifying contract conflict relations among intelligent contracts which are required to be called by the plurality of first task requests respectively;
the system comprises a dividing unit, a processing unit and a processing unit, wherein the dividing unit is used for dividing a plurality of first task requests according to a data dependency relationship and different intelligent contracts to obtain a plurality of task request sets, and the task request sets comprise a plurality of second task requests with execution sequences configured;
and the indicating unit is used for indicating the blockchain node equipment in the blockchain platform to execute the task requests in the task request sets in parallel.
With reference to the second aspect of the present application, in a first possible implementation manner of the second aspect of the present application, the identifying unit is specifically configured to:
identifying a first intelligent contract and a second intelligent contract which are respectively required to be called in a plurality of first task requests;
taking a contract address of a first intelligent contract and a user address of a task request needing to call the first intelligent contract as a first judging unit, and taking a contract address of a second intelligent contract and a user address of a task request needing to call the second intelligent contract as a second judging unit, and judging whether the first judging unit and the second judging unit have correlation on addresses or not;
If so, a first contract conflict relationship is determined, wherein the first contract conflict relationship is used for indicating that a conflict exists between the first intelligent contract and the second intelligent contract.
With reference to the second aspect of the present application, in a second possible implementation manner of the second aspect of the present application, the identifying unit is specifically configured to:
identifying identical third intelligent contracts respectively invoked in the plurality of first task requests;
analyzing whether intersection exists in the read-write data structure when the third intelligent contract is called to execute a plurality of third task requests;
if so, a second contract conflict relationship is determined, wherein the second contract conflict relationship is used to indicate that the third intelligent agent is in conflict when executing the plurality of third task requests.
With reference to the second aspect of the present application, in a third possible implementation manner of the second aspect of the present application, the identifying unit is specifically configured to:
identifying identical third intelligent contracts respectively invoked in the plurality of first task requests;
analyzing different contract contents required to be called by the plurality of third task requests in the third intelligent contract respectively;
judging whether different contract contents are configured with parallel identifiers or not, wherein the parallel identifiers are used for identifying that no conflict exists between the different contract contents in advance;
If yes, determining a third contract conflict relation, wherein the third contract conflict relation is used for indicating that a plurality of third task requests have no conflict when a third intelligent contract is called.
With reference to the second aspect of the present application or any one of possible implementation manners of the second aspect, in a fourth possible implementation manner of the second aspect of the present application, the identifying unit is specifically configured to:
determining target data dependency relationship determination strategies adapted to the plurality of first task requests from a data dependency relationship determination strategy set according to application scenes corresponding to the plurality of first task requests, wherein the data dependency relationship determination strategy set contains different data dependency relationship determination strategies adapted to different application scenes;
and identifying data dependency relationships existing among the plurality of first task requests according to the target data dependency relationship determination strategy.
With reference to the fourth possible implementation manner of the second aspect of the present application, in a fifth possible implementation manner of the second aspect of the present application, the data dependency determination policy set includes a data dependency determination policy for transfer application scenario adaptation, where the data dependency determination policy for transfer application scenario adaptation includes: and judging whether the transfer processing involves the same account number transferred in or the same account number transferred out, if so, determining the data dependency relationship.
With reference to the second aspect of the present application or any one of possible implementation manners of the second aspect, in a sixth possible implementation manner of the second aspect of the present application, the apparatus is executed by a first process of a blockchain node device in a blockchain platform, parallel execution of task requests in a plurality of task request sets is executed by a second process of the blockchain node device in the blockchain platform, and storage of execution results of the task requests in the plurality of task request sets is executed by a third process of the blockchain node device in the blockchain platform.
With reference to the second aspect of the present application or any one of possible implementation manners of the second aspect, in a seventh possible implementation manner of the second aspect of the present application, the acquiring unit is specifically configured to:
a plurality of first task requests are obtained from a plurality of blocks to be processed in a blockchain platform.
With reference to the second aspect of the present application or any one of possible implementation manners of the second aspect, in an eighth possible implementation manner of the second aspect of the present application, the identifying unit is specifically configured to:
performing pre-execution processing on the plurality of first task requests;
during the pre-execution processing, the data dependency relationship existing among the plurality of first task requests and the contract conflict relationship existing among intelligent contracts required to be invoked by the plurality of first task requests are identified.
In a third aspect, the present application further provides a processing system for task requests, the system comprising a plurality of blockchain node devices, the blockchain node devices comprising a processor and a memory, the memory having stored therein a computer program, the plurality of processors executing a method as provided by executing the first aspect of the present application or any one of the possible implementations of the first aspect of the present application when invoking the computer program in the memory.
In a fourth aspect, the present application also provides a computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the method provided by the first aspect of the present application or any one of the possible implementations of the first aspect of the present application.
From the above, the present application has the following advantages:
for a parallel processing scene of task requests in a blockchain, after a plurality of first task requests to be processed in the blockchain platform are acquired, the data dependency relationship existing between the requests and the contract conflict relationship existing between intelligent contracts required to be called respectively are identified, and then the plurality of first task requests are divided according to the data dependency relationship and different intelligent contracts to obtain a plurality of task request sets, wherein the blockchain node equipment in the blockchain platform can be instructed to execute the task requests in the plurality of task request sets in parallel, and in the grouping process, due to the fact that the data dependency relationship identified between the task requests and the contract conflict relationship between the intelligent contracts required to be called are combined, a more accurate and effective task request grouping mode is promoted, the method is not only applicable to single contract scenes, but also applicable to multi-contract scenes, so that more efficient parallel processing efficiency can be achieved for the task requests, the processing capacity of the system is improved, and the application and popularization of the blockchain technology are facilitated.
Drawings
FIG. 1 is a schematic illustration of a scenario in which a task request of the present application is performed;
FIG. 2 is a schematic flow chart of a method for processing task requests according to the present application;
FIG. 3 is a schematic flow chart of identifying contract conflict relationships in the present application;
FIG. 4 is a schematic flow chart of another method for identifying contract conflict relationships according to the present application;
FIG. 5 is a schematic flow chart of yet another method for identifying contract conflict relationships according to the present application;
FIG. 6 is a schematic flow chart of the identification data dependency relationship of the present application;
FIG. 7 is a schematic diagram of a multi-process mechanism of the present application;
FIG. 8 is a schematic diagram of a device for processing task requests according to the present application;
FIG. 9 is a schematic diagram of a blockchain node device of the present application.
Detailed Description
First, before describing the present application, relevant contents of the present application related to application background will be described below.
The task request processing method, the task request processing device and the computer readable storage medium can be applied to a task request processing system and are used for promoting a more accurate and effective task request grouping mode according to the identified data dependency relationship between task requests and the contract conflict relationship between intelligent contracts required to be called, so that more efficient parallel processing efficiency can be realized for the tasks.
In the method for processing a task request, an execution body of the method may be a processing device of the task request or a processing system of the task request integrated with the device, it may be understood that the processing system is included in a blockchain platform or the blockchain platform itself, and the system is composed of different blockchain node devices, where the blockchain devices may be different types of devices such as a server device, a physical host, or a User Equipment (UE), and the blockchain platform is added after the application program related to the blockchain platform is configured and passes the audit.
The processing device of the task request can be implemented in a hardware or software manner, the UE can be specifically a terminal device such as a smart phone, a tablet computer, a notebook computer, a palm computer, a desktop computer or a personal digital assistant (Personal Digital Assistant, PDA), and the blockchain node device can also be configured in a device cluster manner.
Taking a schematic view of a scenario of execution of task requests in the application as shown in fig. 1 as an example, the task request set 100 and the task request set 200 are two task request sets which are obtained by dividing and are considered to be executable in parallel, in the task request set 100, the task request 101a and the task request 102a need to call an intelligent contract a, the task request 103b needs to call an intelligent contract b, and an identified contract conflict relation exists between the intelligent contract a and the intelligent contract b, so that the task request sets are placed in the same task request set, the task request 101a which calls the intelligent contract a and the task request 102a are determined to be executed after the task request 101a and the task request 102a are called, and the task request 102a is determined to execute the task request 101a before the task request 102a is executed by considering the data dependency relation between the two requests;
In the task request set 200, the task requests 201c and 202c are required to be invoked by the intelligent contracts c, and because there is no data dependency relationship between the task requests and the task requests in the task request set 100 and no contract conflict relationship between the task requests and the intelligent contracts required to be invoked by the requests, the task requests in the task request set 100 and the task request set 200 are in a parallel executable relationship, and thus, the task requests in the task request set and the task request set can be executed in parallel according to the execution sequence of the task requests in the task request set.
It should be understood that, for the scenario shown in fig. 1, the task request set, the task requests in the task request set, and the number of intelligent contracts that need to be executed by the task requests are merely exemplary, and should not be taken as limiting the application.
Fig. 2 is a schematic flow chart of a method for processing a task request according to the present application, and as shown in fig. 2, the method for processing a task request according to the present application may specifically include the following steps:
step S201, a plurality of first task requests to be processed in a blockchain platform are obtained, wherein the first task requests are used for requesting the blockchain platform to process target tasks;
Step S202, identifying data dependency relationships existing among a plurality of first task requests and identifying contract conflict relationships existing among intelligent contracts required to be invoked by the plurality of first task requests respectively;
step S203, dividing a plurality of first task requests according to the data dependency relationship and different intelligent contracts to obtain a plurality of task request sets, wherein the task request sets comprise a plurality of second task requests configured with an execution sequence;
step S204, instructs the blockchain node device in the blockchain platform to execute the task requests in the plurality of task request sets in parallel.
Based on the scenario shown in fig. 1, it can be seen from the embodiment shown in fig. 2 that, for the scenario of parallel processing of task requests in the blockchain, after obtaining a plurality of first task requests to be processed in the blockchain platform, the present application identifies a data dependency relationship existing between the requests and identifies a contract conflict relationship existing between intelligent contracts to be called respectively, and then divides the plurality of first task requests according to the data dependency relationship and different intelligent contracts to obtain a plurality of task request sets, so that the blockchain node device in the blockchain platform can be instructed to execute the task requests in the plurality of task request sets in parallel.
The following will further describe in detail the steps shown in fig. 2 and the specific embodiments that may be adopted in practical applications:
in this application, it may be understood that the processing method of the task request is illustrated from the system perspective of the processing system of the task request, and the system is applied to a blockchain platform, where when the processing method of the task request provided in this application is applied, a consensus mechanism exists based on the working mechanism of the blockchain platform itself, that is, for part or all of the data processing involved, voting is performed on each blockchain node device, and the voting passes through the data processing adopted in the back, where the adopted consensus protocol (the content of the protocol may be understood as describing how to perform voting and how to determine the voting passing result) may be adopted, and different types of consensus protocols, for example, poW, poS, BFT or RAFT and other consensus protocols may be specifically adapted according to actual needs, and are not limited herein.
The task request processing method aims at the task request which needs to be executed by the task request processing system, and takes a transaction system related in practical application as an example, the task request can be a transaction request related in the transaction system, and the transaction request is popular and can be understood as a transaction.
Of course, in practical application, the task request to be executed by the task request processing system may be adjusted according to the specific application scenario of the system and different application requirements in the system, which is not limited in detail.
For example, the processing system of the task request is included in or is directly a certification system of the electronic evidence, so the task request can be a uplink request (certification request), a query request or even a download request of the electronic evidence; for another example, the processing system of the task request is included in or is directly a backtracking system of live pig data, so the task request can be a uplink request, a query request or a download request initiated for different live pig data such as live pig raising data, live pig slaughter data, live pig transportation data, live pig quarantine data, live pig sales data and the like.
When any number or preset number of task requests to be executed are obtained, the contract conflict relation and the data dependency relation can be identified for the requests.
1. Contract conflict relationship
It will be appreciated that in the blockchain platform, the processing of task requests is performed under processing content corresponding to the specifications of intelligent contracts, or the task requests are executed by invoking intelligent contracts, and in this case, the application additionally considers the contract conflict relationship between intelligent contracts required to be invoked when executing different task requests, so as to divide task requests according to the contract conflict relationship.
Three suitable practical ways of identifying the contract conflict relationship are set forth below.
1.1 Address
Referring to fig. 3, which is a schematic flow chart of identifying a contract conflict relationship according to the present application, the identifying process of the contract conflict relationship with a contract address may include the following steps S301 to S303:
step S301, identifying a first intelligent contract and a second intelligent contract which are respectively required to be called in a plurality of first task requests;
for example, in the process of identifying the contract conflict relationship of the smart contract, the smart contract to be invoked is generally identified by the task requests in pairs.
And the two smart contracts currently determined are respectively marked as a first smart contract and a second smart contract.
Step S302, judging whether there is a correlation on the address between the first judging unit and the second judging unit by taking both the contract address of the first intelligent contract and the user address of the task request needing to call the first intelligent contract as a first judging unit and taking both the contract address of the second intelligent contract and the user address of the task request needing to call the second intelligent contract as a second judging unit, and if yes, triggering step S303;
As a specific implementation, the present application considers starting from an address to identify contract conflict relationships.
It will be appreciated that the task request may relate to a contract address of the smart contract itself or a user address of the task request itself when invoking the smart contract for task processing, and, for example, the transfer application scenario may generally relate to two types of user addresses, namely a transfer-in account and a transfer-out account.
The correlation between addresses does not necessarily belong to the same relationship, and there may be a relationship between equivalent addresses and similar addresses, and the determination manner of the correlation between addresses may be adjusted according to actual needs, which is not limited in this embodiment.
For example, the relevance may be determined directly from whether the characters of the address are identical; alternatively still, the correlation between addresses may be analyzed by means of euclidean distance calculations.
Of course, in practical application, different addresses may also be nested in the blockchain platform, for example, the user address of one task request may be deployed on the basis of the contract address of another intelligent contract, and therefore, when judging the contract conflict relationship between two intelligent contracts required to be invoked by two task requests, the present application corresponds to the contract address and the user address of the same task request, or the contract address and the user address of two task requests may also have the situation that the addresses are nested in each other, which also belongs to the correlation on an address.
In step S303, a first contract conflict relationship is determined, where the first contract conflict relationship is used to indicate that a conflict exists between the first smart contract and the second smart contract.
Thus, when it is determined that there is a correlation on the address, then it may be determined that there is a conflict between the two smart contracts.
It should be understood that a conflict exists between two smart contracts as referred to herein, which may refer to between the smart contracts themselves, between task requests invoking two smart contracts, and even between one smart contract and task requests invoking another smart contract, because of the correlation that exists in addresses.
If there is no conflict, i.e. there is no conflict caused by the above addresses, it is obvious that parallel processing may be adopted when two task requests are executed.
It can be found that the address-based determined contract conflict relationship is particularly suitable for multi-intelligent contract scenarios, such that a cross-contract parallel processing mechanism can be efficiently and simply achieved according to the determined contract conflict relationship.
1.2 data structure for reading and writing
Referring to another schematic flow chart of identifying contract conflict relationships in the present application shown in fig. 4, the identifying process of the contract conflict relationships by using a read-write data structure may include the following steps S401 to S403:
Step S401, identifying the same third intelligent contracts respectively called in a plurality of first task requests;
it will be appreciated that when there are two kinds of task requests that respectively require to call up smart contracts that are the same smart contract, it may be generally defaulted that there is a conflict between the two task requests when they are executed, but the present application considers that there are multiple contract contents in one smart contract, in which case it may also be determined by further refinement identification mechanism whether there is a conflict between the two kinds of contract contents that respectively call up when they are executed.
Step S402, analyzing whether an intersection exists in the read-write data structure when the third intelligent contract is called to execute a plurality of third task requests, if yes, triggering step S403;
as a practical implementation, the present application may invoke a smart contract to determine whether there is a conflict between invoked smart contracts if there is an intersection of data structures read and written when executing a task request.
The read-write data structure refers to a specific presentation mode of contract content in the intelligent contract.
In step S403, a second contract conflict relationship is determined, where the second contract conflict relationship is used to indicate that the third intelligent agent is in conflict when executing the plurality of third task requests.
If there is an intersection on the data structure, it may be determined that there is a conflict between two task requests when the same smart contract is invoked.
In practical applications, it should be understood that the data structure includes a multi-layer data structure, and when the first layer data structure is the same, the second layer data structure in the first layer data structure is different, and if the data structures read and written in units of the second layer data structure are analyzed to determine whether there is an intersection, it is obvious that the intersection is not present. For example, the add and delete methods of map may be performed in parallel with different parameters.
Therefore, when the data structure through reading and writing has intersection, the hierarchy of the data structure can be adjusted according to actual needs so as to adapt to the intersection judgment mode of fine granularity.
It can be found that the contract conflict relation determined based on the intersection of the data structures is particularly suitable for a single intelligent contract scenario, so that according to the determined contract conflict relation, a parallel processing mechanism can be realized even if the same intelligent contract is called.
1.3 parallel identification
Referring to fig. 5, a further flowchart of identifying a contract conflict relationship according to the present application, performing the identifying process of the contract conflict relationship by parallel identification may include the following steps S501 to S504:
Step S501, identifying the same third intelligent contracts respectively called in a plurality of first task requests;
it will be appreciated that when there are two kinds of task requests that respectively require to call up smart contracts that are the same smart contract, it may be generally defaulted that there is a conflict between the two task requests when they are executed, but the present application considers that there are multiple contract contents in one smart contract, in which case it may also be determined by further refinement identification mechanism whether there is a conflict between the two kinds of contract contents that respectively call up when they are executed.
Step S502, analyzing different contract contents required to be called by a plurality of third task requests in a third intelligent contract respectively;
correspondingly, when the same intelligent contract is called, contract contents required to be called in the intelligent contract by the task requests can be judged.
Step S503, judging whether different contract contents are configured with parallel identifiers, wherein the parallel identifiers are used for identifying that no conflict exists between the different contract contents, and if yes, triggering step S504;
the application can configure parallel identification in different contract contents of the intelligent contract in advance to identify whether a parallel processing mechanism can be executed between different contract contents.
It will be appreciated that the configuration at the parallel identification may be generally configured manually by a worker or in combination with historical parallel processing experience.
For example, if it is determined by the read-write data structures that there is no contract conflict relationship, parallel identifiers may be configured for contract contents corresponding to the two data structures.
At this time, it may be found that the configuration of the parallel identifier may be performed on the basis of the above identification process of the contract conflict relationship by the read-write data structure, and the above identification process of the contract conflict relationship by the read-write data structure may not only determine the contract conflict relationship for real-time judgment of the intersection of the data structures, but also determine the intersection relationship of the predetermined data structures by using the parallel identifier, and obviously, the judgment mechanism of whether the two types of parallel processing can be performed or not may also have a mixed use in practical application.
In step S504, a third contract conflict relationship is determined, where the third contract conflict relationship is used to indicate that the plurality of third task requests are not in conflict when invoking the third smart contract.
Therefore, through the preconfigured parallel identification, the judgment of whether parallel processing can be realized more quickly, and the more rapid parallel processing efficiency is promoted.
It can be found that the contract conflict relation determined based on the parallel identification is particularly suitable for a single intelligent contract scene, so that a parallel processing mechanism can be realized according to the determined contract conflict relation even if the same intelligent contract is called.
In addition, the determination of the contract conflict relationship in the case of the single contract shown in the two above is also applicable to the cross-contract case, that is, the determination of the contract conflict relationship existing in different intelligent contracts is also applicable, and of course, the two are more applicable to the single contract case.
2. Data dependency relationship
It will be appreciated that the execution of one task request may depend on the execution result of another task request, which may constitute a data dependency between two task requests, and the recognition processing of the data dependency may be a recognition manner adopted by a serial execution mechanism of task requests in the prior art, or may be other types of recognition manners, which are not limited in particular herein.
As a practical implementation manner suitable for improving accuracy of data dependency identification provided in the present application, referring to a schematic flow chart of identifying data dependencies in the present application shown in fig. 6, the identifying process of data dependencies between task requests may include:
Step S601, determining target data dependency relationship determination policies adapted to a plurality of first task requests from a data dependency relationship determination policy set according to application scenarios corresponding to the plurality of first task requests, wherein the data dependency relationship determination policies set contains different data dependency relationship determination policies adapted to different application scenarios;
it can be understood that, compared with the prior art that a fixed data dependency relationship determination policy is adopted to identify the data dependency relationship between the current task requests, different application scenarios in actual application are considered, and different data dependency relationship determination policies are respectively configured, so that under the condition that a plurality of task requests exist, the adapted data dependency relationship determination policy can be selected according to the application scenarios corresponding to the task requests to identify the data dependency relationship between every two task requests.
Therefore, accurate identification of data dependency relations between task requests adapting to mixed application scenes is achieved, and particularly, after the identification results of the contract conflict relations are combined, a more accurate and effective task request grouping mode can be achieved, and therefore more accurate and efficient parallel processing can be achieved.
Step S602, identifying data dependency relationships among the plurality of first task requests according to the target data dependency relationship determination policy.
After the determination policy of the currently adapted target data dependency relationship is determined, the data dependency relationship between the task requests can be identified according to the determination policy.
It can be understood that the different application scenes mentioned in the application can be obtained by refining and subdividing the actual application scenes according to actual needs, or can also be obtained by dividing and clustering the historical application scenes, and the dividing mode of the application scenes is not limited in particular because of the flexible dividing characteristics.
Taking the account of the application scenario of transfer as an example, the adaptive data dependency relationship determining strategy may include:
when judging the data dependency relationship between two task requests related to the transfer application scene, judging whether the transfer processing of the two task requests related to the transfer application scene involves the same transfer account number or the same transfer account number, and if so, determining the data dependency relationship.
Thus, if two task requests have the same account in the transfer application scene, the same task request set can be marked, wherein the task request set can be established and searched, and even can be used as a new transaction block.
After the contract conflict relation and the data dependency relation are determined, task requests with contract conflict or data dependency can be placed in different task request sets, task requests without contract conflict or data dependency are placed in the same task request set, division of the task requests is completed, different task request sets are obtained, and task processing can be completed in a parallel processing mode among the task request sets.
In the task request set, the execution order may be ordered, for example, based on the identified data dependencies.
After the task request set is determined, tasks can be distributed to instruct the blockchain node devices in the blockchain platform to execute the task requests in the task request sets in parallel.
In addition, for corresponding processing links such as confirmation, division and execution of task requests, in the prior art, the blockchain node is processed in a single-process manner.
In the application, a multi-process mode is further introduced to process different processing links respectively, so that the processing efficiency of the processing links is further improved.
For example, the above-described validation, partitioning, and publishing of task requests may be performed by a first process of a blockchain node device in a blockchain platform, while the parallel execution of task requests in the plurality of task request sets is performed by a second process of the blockchain node device in the blockchain platform, and then, the storing of the execution results of task requests in the plurality of task request sets is performed by a third process of the blockchain node device in the blockchain platform.
In connection with one architectural diagram of the multi-process mechanism of the present application shown in fig. 7, in the present application, a single process is split into multiple processes, i.e., including a blockchain master process (first process), an execution process (second process), and a storage process (third process).
The following is an example of a task request as a transaction in a transaction system.
From the whole, the processing flow mainly comprises:
1. the blockchain master process runs a consensus protocol to generate consensus blocks, and then the master process analyzes the transactions in one block, splits the transaction into a plurality of uncorrelated parallel transaction blocks and issues the transaction blocks in the form of tasks.
2. And the executing processes acquire executing tasks through subscription or similar schemes, send reading requests to the storage process, complete transaction execution, and return executing results to the main process, wherein the executing results exist in a read-write set form.
3. The main process analyzes the execution result, namely the read-write sets, judges whether the transaction blocks in the same block collide, if not, carries out the combination of all the read-write sets, notifies the storage process and completes the writing; if the conflict exists, the transaction block with the conflict is released again in the task form, the execution process is re-executed, and the execution result is waited.
In each process, the blockchain master process mainly comprises the following processing contents:
1. confirming a transaction list and a transaction sequence contained in the block N through a consensus protocol;
the consensus protocol herein may use any protocol, including PoW, poS, BFT, RAFT and the like.
2. Analyzing the transaction list in the block N, and splitting the transaction in the block into a plurality of irrelevant transaction blocks;
for analysis of transactions that may be processed in parallel, reference may be made to the descriptions above, and reference may be continued to other references referred to below, and detailed descriptions thereof will not be provided herein.
3. The main process issues tasks with the numbers of N1, N2 and N3 … … Nk;
the publishing task may be implemented by message middleware or any form.
After the task of the N number block is issued, the main process can pre-analyze the N+1 number block in a pipeline without waiting for the complete execution of the N number.
4. The master process gathers execution results numbered N1, N2, N3 … … Nk.
If collision is found, adding available collision information into a pre-analysis judgment basis, and executing again from the step 2, wherein the task number starts from Nk+1, so that the influence of old version information on the system is avoided; if no conflict is found, the number N and the merged write set are updated to the storage process.
The execution process, its data processing, mainly include:
1. subscribing to obtain a task Ni through channels such as message middleware and the like, and sequentially executing transactions in the task Ni;
assume that there are s transactions in Ni.
2. Executing the j transaction;
when the data needs to be read, if the local data is cached, the local data is directly used. Otherwise, sending a reading request to a storage process, wherein the reading request comprises a number N and a data key value to be read.
If a legal return result is obtained, the correct data value can be obtained by analysis and used for executing the transaction j; if the returned result is illegal, the execution of the task Ni is directly abandoned.
In the execution process of the transaction j, all the modifications to the data are not updated to the storage process and are temporarily stored locally for the execution of the subsequent transaction.
After the execution of the transaction j is completed, all read-write sets generated in the execution process of the transaction j are recorded.
3. After the j transaction is completed, j+1 transactions are executed, and the step 2 is repeated;
4. after all transactions are executed, all read-write sets of s transactions are obtained, and after packaging, the execution result is returned to the main process by the number Ni.
The storage process, its data processing, mainly include:
1. maintaining a current storage state version number v;
2. receiving a read request, and if the number N carried in the read request is equal to the version number, inquiring and returning an inquiry result; if the result is unequal, directly returning an illegal result;
3. receiving a write request, if the number N carried in the write request is equal to the version number v+1 of the current storage state, receiving the write request, writing data, and updating the version number to v+1; otherwise, returning illegal results.
It will be appreciated that the processes may be completely decoupled from one another with little to no maintenance of any complex interaction protocols, so that the executing process may achieve near unlimited increases.
According to the above description of the present application, it may be found that, compared with the parallel processing mechanism in the prior art, the parallel processing mechanism provided by the present application has the characteristics of better flexibility and accuracy, and is particularly suitable for a cross-contract scenario, and for task requests that need to invoke different intelligent contracts during execution, the parallel processing mechanism may also be implemented.
When the task request is transplanted into the existing blockchain platform, the task request to be processed can be determined in the original blockchain platform, for example, in the original blockchain platform, the task request in a certain time range is generally initially divided according to an intelligent contract to obtain a plurality of blocks, the blocks comprise a plurality of task requests, a parallel processing mechanism in the prior art uses blocks as units, the task requests in each block are sequentially processed in parallel, and after the task requests in the previous block are processed, the task requests in the next block are executed.
When the method and the device are applied, due to the cross-contract parallel processing mechanism, not only can the parallel processing be executed for the task requests in a single block, but also the parallel processing can be executed for the task requests in a plurality of blocks.
Thus, under the framework of the working mechanism of the original blockchain platform, the task request initially determined by the application can be obtained from a plurality of blocks processed in the blockchain platform.
In addition, in order to better realize the application value of the processing method of the task request, the application can also adopt a pre-analysis or pre-execution processing mechanism, when the task request in the next block does not enter a processing stage yet, the recognition of the data dependency relationship and the contract conflict relationship is carried out in advance, and the arrangement of parallel processing is carried out in advance, so that when the execution of the previous block is finished, the task request in the block can be directly processed in parallel according to the parallel processing scheme which is already in advance, the parallel processing efficiency is further improved, and the smooth pipeline operation is achieved.
Correspondingly, for the data dependency relationship and the contract conflict relationship between task requests, the method may include:
performing pre-execution processing on the plurality of first task requests;
during the pre-execution processing, the data dependency relationship existing among the plurality of first task requests and the contract conflict relationship existing among intelligent contracts required to be invoked by the plurality of first task requests are identified.
It can be understood that the pre-analysis is performed based on the task request sets obtained by the initial division of blocks, time periods and the like as units between task requests, and when executing the first task request set, the pre-analysis of parallel processing can be performed on the task request set in the next execution sequence in advance.
Of course, corresponding to the application, the blockchain platform can also avoid the original setting of the blocks, and the scattered task requests in a certain time are directly divided and processed in parallel by the processing method of the task requests.
The above is an explanation of the task request processing method, and in order to facilitate better implementation of the task request processing method provided by the application, the application further provides a task request processing device.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a task request processing device according to the present application, where the task request processing device 800 may specifically include the following structure:
an obtaining unit 801, configured to obtain a plurality of first task requests to be processed in the blockchain platform, where the first task requests are used to request the blockchain platform to process a target task;
an identifying unit 802, configured to identify data dependencies existing between the plurality of first task requests and identify contract conflict relationships existing between intelligent contracts that need to be invoked by the plurality of first task requests respectively;
a dividing unit 803, configured to divide the plurality of first task requests according to the data dependency relationship and different intelligent contracts, to obtain a plurality of task request sets, where the task request sets include a plurality of second task requests configured with an execution sequence;
an instructing unit 804, configured to instruct a blockchain node device in the blockchain platform to execute task requests in the plurality of task request sets in parallel.
With reference to the second aspect of the present application, in a first possible implementation manner of the second aspect of the present application, the identifying unit 802 is specifically configured to:
identifying a first intelligent contract and a second intelligent contract which are respectively required to be called in a plurality of first task requests;
Taking a contract address of a first intelligent contract and a user address of a task request needing to call the first intelligent contract as a first judging unit, and taking a contract address of a second intelligent contract and a user address of a task request needing to call the second intelligent contract as a second judging unit, and judging whether the first judging unit and the second judging unit have correlation on addresses or not;
if so, a first contract conflict relationship is determined, wherein the first contract conflict relationship is used for indicating that a conflict exists between the first intelligent contract and the second intelligent contract.
With reference to the second aspect of the present application, in a second possible implementation manner of the second aspect of the present application, the identifying unit 802 is specifically configured to:
identifying identical third intelligent contracts respectively invoked in the plurality of first task requests;
analyzing whether intersection exists in the read-write data structure when the third intelligent contract is called to execute a plurality of third task requests;
if so, a second contract conflict relationship is determined, wherein the second contract conflict relationship is used to indicate that the third intelligent agent is in conflict when executing the plurality of third task requests.
With reference to the second aspect of the present application, in a third possible implementation manner of the second aspect of the present application, the identifying unit 802 is specifically configured to:
Identifying identical third intelligent contracts respectively invoked in the plurality of first task requests;
analyzing different contract contents required to be called by the plurality of third task requests in the third intelligent contract respectively;
judging whether different contract contents are configured with parallel identifiers or not, wherein the parallel identifiers are used for identifying that no conflict exists between the different contract contents in advance;
if yes, determining a third contract conflict relation, wherein the third contract conflict relation is used for indicating that a plurality of third task requests have no conflict when a third intelligent contract is called.
With reference to the second aspect of the present application or any one of possible implementation manners of the second aspect, in a fourth possible implementation manner of the second aspect of the present application, the identifying unit 802 is specifically configured to:
determining target data dependency relationship determination strategies adapted to the plurality of first task requests from a data dependency relationship determination strategy set according to application scenes corresponding to the plurality of first task requests, wherein the data dependency relationship determination strategy set contains different data dependency relationship determination strategies adapted to different application scenes;
and identifying data dependency relationships existing among the plurality of first task requests according to the target data dependency relationship determination strategy.
With reference to the fourth possible implementation manner of the second aspect of the present application, in a fifth possible implementation manner of the second aspect of the present application, the data dependency determination policy set includes a data dependency determination policy for transfer application scenario adaptation, where the data dependency determination policy for transfer application scenario adaptation includes: and judging whether the transfer processing involves the same account number transferred in or the same account number transferred out, if so, determining the data dependency relationship.
With reference to the second aspect of the present application or any one of possible implementation manners of the second aspect, in a sixth possible implementation manner of the second aspect of the present application, the apparatus is executed by a first process of a blockchain node device in a blockchain platform, parallel execution of task requests in a plurality of task request sets is executed by a second process of the blockchain node device in the blockchain platform, and storage of execution results of the task requests in the plurality of task request sets is executed by a third process of the blockchain node device in the blockchain platform.
With reference to the second aspect of the present application or any one of possible implementation manners of the second aspect, in a seventh possible implementation manner of the second aspect of the present application, the obtaining unit 801 is specifically configured to:
A plurality of first task requests are obtained from a plurality of blocks to be processed in a blockchain platform.
With reference to the second aspect of the present application or any one of the possible implementation manners of the second aspect, in a second possible implementation manner of the second aspect of the present application, the identifying unit 802 is specifically configured to:
performing pre-execution processing on the plurality of first task requests;
during the pre-execution processing, the data dependency relationship existing among the plurality of first task requests and the contract conflict relationship existing among intelligent contracts required to be invoked by the plurality of first task requests are identified.
The present application also provides a processing system for task requests, the system comprising a plurality of blockchain node devices, the blockchain node devices comprising a processor and a memory, the memory having stored therein a computer program, the plurality of processors executing a method as provided by executing the first aspect of the present application or any one of the possible implementations of the first aspect of the present application when invoking the computer program in the memory.
Referring to fig. 9, fig. 9 shows a schematic structural diagram of a blockchain node device of the present application, specifically, the blockchain node device of the present application includes a processor 901, a memory 902, and an input/output device 903, where the processor 901 is configured to implement steps of a method for processing task requests in any embodiment corresponding to fig. 2 to fig. 6 when executing a computer program stored in the memory 902; alternatively, the processor 901 is configured to implement functions of each unit in the corresponding embodiment as shown in fig. 8 when executing a computer program stored in the memory 902, and the memory 902 is configured to store a computer program required for the processor 901 to execute the method for processing a task request in any embodiment corresponding to fig. 2 to 6.
By way of example, a computer program may be partitioned into one or more modules/units, which are stored in the memory 902 and executed by the processor 901 to complete the present application. One or more of the modules/units may be a series of computer program instruction segments capable of performing particular functions to describe the execution of the computer program in a computer device.
Block link point devices may include, but are not limited to, a processor 901, memory 902, input output devices 903. Those skilled in the art will appreciate that the illustrations are merely examples of blockchain node devices and are not limiting of blockchain node devices, and that more or fewer components than shown may be included, or certain components may be combined, or different components, such as blockchain node devices may also include network access devices, buses, etc., through which the processor 901, memory 902, input output devices 903, and network access devices, etc., are connected.
The processor 901 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor being the control center of the block link point device, with various interfaces and lines connecting the various parts of the overall device.
The memory 902 may be used to store computer programs and/or modules, and the processor 901 implements various functions of the computer device by running or executing the computer programs and/or modules stored in the memory 902 and invoking data stored in the memory 902. The memory 902 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, application programs required for at least one function, and the like; the storage data area may store data created according to the use of the block link point device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 901 is configured to execute a computer program stored in the memory 902, and may specifically implement the following functions:
acquiring a plurality of first task requests to be processed in a blockchain platform, wherein the first task requests are used for requesting the blockchain platform to process target tasks;
Identifying data dependency relationships among the plurality of first task requests and identifying contract conflict relationships among intelligent contracts required to be invoked by the plurality of first task requests respectively;
dividing a plurality of first task requests according to the data dependency relationship and different intelligent contracts to obtain a plurality of task request sets, wherein the task request sets comprise a plurality of second task requests with execution sequences configured;
the blockchain node device in the blockchain platform is instructed to execute task requests in the plurality of task request sets in parallel.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the task request processing device, equipment and corresponding units described above may refer to the description of the task request processing method in any embodiment corresponding to fig. 2 to 6, and will not be described in detail herein.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
For this reason, the present application provides a computer readable storage medium, in which a plurality of instructions capable of being loaded by a processor to execute steps in a method for processing a task request in any embodiment of the present application, such as fig. 2 to 6, and specific operations may refer to descriptions of the method for processing a task request in any embodiment of the present application, such as fig. 2 to 6, which are not repeated herein.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
Since the instructions stored in the computer readable storage medium may execute the steps in the method for processing a task request in any embodiment of the present application, such as fig. 2 to 6, the beneficial effects that can be achieved by the method for processing a task request in any embodiment of the present application, such as fig. 2 to 6, are described in detail in the foregoing description, and are not repeated herein.
The foregoing has outlined the detailed description of the method, apparatus, system and computer readable storage medium of task request provided herein, and the detailed description of the principles and embodiments of the present application that have been provided herein by way of example only to assist in the understanding of the method and core concepts of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (9)

1. A method for processing a task request, the method comprising:
acquiring a plurality of first task requests to be processed in a blockchain platform, wherein the first task requests are used for requesting the blockchain platform to process target tasks;
identifying data dependency relationships existing among the plurality of first task requests and identifying contract conflict relationships existing among intelligent contracts required to be invoked by the plurality of first task requests respectively;
dividing the plurality of first task requests according to the data dependency relationship and the different intelligent contracts to obtain a plurality of task request sets, wherein the task request sets comprise a plurality of second task requests configured with an execution sequence;
instructing blockchain node devices in the blockchain platform to execute task requests in the plurality of task request sets in parallel;
wherein the identifying data dependencies existing between the plurality of first task requests includes: determining target data dependency relationship determination strategies adapted to the plurality of first task requests from a data dependency relationship determination strategy set according to application scenes corresponding to the plurality of first task requests, wherein the data dependency relationship determination strategy set comprises different data dependency relationship determination strategies adapted to different application scenes; identifying the data dependency relationship existing among the plurality of first task requests according to the target data dependency relationship determining strategy;
The dividing the plurality of first task requests according to the data dependency relationship and the different intelligent contracts, and obtaining a plurality of task request sets includes: after the contract conflict relation and the data dependency relation are determined, task requests with contract conflict or data dependency are placed in different task request sets, task requests without contract conflict or data dependency are placed in the same task request set, division of the task requests is completed, different task request sets are obtained, and task processing can be completed in a parallel processing mode among the task request sets;
the method is executed by a first process of a blockchain node device in the blockchain platform, parallel execution of task requests in the plurality of task request sets is executed by a second process row of the blockchain node device in the blockchain platform, and storage of execution results of the task requests in the plurality of task request sets is executed by a third process of the blockchain node device in the blockchain platform.
2. The method of claim 1, wherein the identifying a contract conflict relationship that exists between smart contracts that are respectively required to be invoked by the plurality of first task requests comprises:
Identifying a first intelligent contract and a second intelligent contract which are respectively required to be called in the plurality of first task requests;
taking a contract address of the first intelligent contract and a user address of a task request needing to call the first intelligent contract as a first judging unit, and taking a contract address of the second intelligent contract and a user address of a task request needing to call the second intelligent contract as a second judging unit, and judging whether the first judging unit and the second judging unit have address correlation or not;
if so, a first contract conflict relationship is determined, wherein the first contract conflict relationship is used for indicating that a conflict exists between the first intelligent contract and the second intelligent contract.
3. The method of claim 1, wherein the identifying a contract conflict relationship that exists between smart contracts that are respectively required to be invoked by the plurality of first task requests comprises:
identifying identical third intelligent contracts respectively invoked in the plurality of first task requests;
analyzing whether intersection exists in the read-write data structure when the third intelligent contract is called to execute a plurality of third task requests;
If so, a second contract conflict relationship is determined, wherein the second contract conflict relationship is used for indicating that the third intelligent agent conflicts approximately when executing the plurality of third task requests.
4. The method of claim 1, wherein the identifying a contract conflict relationship that exists between smart contracts that are respectively required to be invoked by the plurality of first task requests comprises:
identifying identical third intelligent contracts respectively invoked in the plurality of first task requests;
analyzing different contract contents which are respectively required to be called by a plurality of third task requests in the third intelligent contract;
judging whether the different contract contents are configured with parallel identifiers or not, wherein the parallel identifiers are used for identifying that no conflict exists between the different contract contents in advance;
if yes, determining a third contract conflict relation, wherein the third contract conflict relation is used for indicating that the plurality of third task requests have no conflict when the third intelligent contract is called.
5. The method of claim 1, wherein the set of data dependency determination policies includes a transfer application scenario-adapted data dependency determination policy, the transfer application scenario-adapted data dependency determination policy comprising: and judging whether the transfer processing involves the same account number transferred in or the same account number transferred out, if so, determining the data dependency relationship.
6. The method of any of claims 1 to 4, wherein the identifying data dependencies existing between the plurality of first task requests and identifying contract conflict relationships existing between smart contracts that the plurality of first task requests respectively require invocation, comprises:
performing pre-execution processing on the plurality of first task requests;
during the pre-execution processing, the data dependency relationship existing among the plurality of first task requests and the contract conflict relationship existing among intelligent contracts respectively required to be invoked by the plurality of first task requests are identified.
7. A device for processing a task request, the device comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a plurality of first task requests to be processed in a blockchain platform, and the first task requests are used for requesting the blockchain platform to process target tasks;
the identifying unit is used for identifying data dependency relations among the plurality of first task requests and identifying contract conflict relations among intelligent contracts which are required to be called by the plurality of first task requests respectively;
the dividing unit is used for dividing the plurality of first task requests according to the data dependency relationship and the different intelligent contracts to obtain a plurality of task request sets, wherein the task request sets comprise a plurality of second task requests with execution sequences configured;
An indication unit, configured to instruct a blockchain node device in the blockchain platform to execute task requests in the plurality of task request sets in parallel;
when the identification unit identifies the data dependency relationship existing between the plurality of first task requests, the identification unit is specifically configured to determine, according to application scenarios corresponding to the plurality of first task requests, a target data dependency relationship determination policy adapted to the plurality of first task requests from a data dependency relationship determination policy set, where the data dependency relationship determination policy set includes different data dependency relationship determination policies adapted to different application scenarios; identifying the data dependency relationship existing among the plurality of first task requests according to the target data dependency relationship determining strategy;
the dividing unit is specifically configured to divide the plurality of first task requests according to the data dependency relationship and the different intelligent contracts, and the obtaining a plurality of task request sets includes: after the contract conflict relation and the data dependency relation are determined, task requests with contract conflict or data dependency are placed in different task request sets, task requests without contract conflict or data dependency are placed in the same task request set, division of the task requests is completed, different task request sets are obtained, and task processing can be completed in a parallel processing mode among the task request sets;
The apparatus is executed by a first process of a blockchain node device in the blockchain platform, parallel execution of task requests in the plurality of task request sets is executed by a second process row of the blockchain node device in the blockchain platform, and storage of execution results of the task requests in the plurality of task request sets is executed by a third process of the blockchain node device in the blockchain platform.
8. A processing system for task requests, characterized in that the system comprises a plurality of blockchain node devices, the blockchain node devices comprising a processor and a memory, the memory having stored therein a computer program, the plurality of processors executing the method according to any of claims 1 to 6 when invoking the computer program in the memory.
9. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the method of any one of claims 1 to 6.
CN202011641801.8A 2020-12-31 2020-12-31 Task request processing method, device and system and computer readable storage medium Active CN112764897B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011641801.8A CN112764897B (en) 2020-12-31 2020-12-31 Task request processing method, device and system and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011641801.8A CN112764897B (en) 2020-12-31 2020-12-31 Task request processing method, device and system and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112764897A CN112764897A (en) 2021-05-07
CN112764897B true CN112764897B (en) 2024-03-22

Family

ID=75698549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011641801.8A Active CN112764897B (en) 2020-12-31 2020-12-31 Task request processing method, device and system and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112764897B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113867903B (en) * 2021-12-06 2022-04-01 深圳前海微众银行股份有限公司 Method and device for determining parallel conflict domain of intelligent contract in block chain

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019072305A2 (en) * 2018-12-28 2019-04-18 Alibaba Group Holding Limited Parallel execution of transactions in a blockchain network based on smart contract whitelists
CN109951547A (en) * 2019-03-15 2019-06-28 百度在线网络技术(北京)有限公司 Transactions requests method for parallel processing, device, equipment and medium
CN110321219A (en) * 2019-05-06 2019-10-11 百度在线网络技术(北京)有限公司 A kind of parallel execution method, apparatus, equipment and the medium of transactions requests
WO2019203735A1 (en) * 2018-04-19 2019-10-24 Vechain Foundation Limited Transaction processing
CN110806923A (en) * 2019-10-29 2020-02-18 百度在线网络技术(北京)有限公司 Parallel processing method and device for block chain tasks, electronic equipment and medium
WO2020182134A1 (en) * 2019-03-11 2020-09-17 京东方科技集团股份有限公司 Coordination method for blockchain consensus tasks, coordination device for blockchain consensus tasks, method for processing blockchain consensus tasks, blockchain node device, blockchain system, and storage medium
CN111683043A (en) * 2020-04-26 2020-09-18 华东师范大学 Intelligent contract concurrent execution method facing alliance chain and based on trusted execution environment
CN112150163A (en) * 2020-11-26 2020-12-29 北京微芯区块链与边缘计算研究院 Block chain contract transaction parallel execution method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190087793A1 (en) * 2017-08-31 2019-03-21 Brown University Adding concurrency to smart contracts
US11070360B2 (en) * 2018-08-13 2021-07-20 International Business Machines Corporation Parallel transaction validation and block generation in a blockchain
US11138600B2 (en) * 2019-02-05 2021-10-05 Capital One Services, Llc Smart contract regulation

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019203735A1 (en) * 2018-04-19 2019-10-24 Vechain Foundation Limited Transaction processing
WO2019072305A2 (en) * 2018-12-28 2019-04-18 Alibaba Group Holding Limited Parallel execution of transactions in a blockchain network based on smart contract whitelists
WO2020182134A1 (en) * 2019-03-11 2020-09-17 京东方科技集团股份有限公司 Coordination method for blockchain consensus tasks, coordination device for blockchain consensus tasks, method for processing blockchain consensus tasks, blockchain node device, blockchain system, and storage medium
CN109951547A (en) * 2019-03-15 2019-06-28 百度在线网络技术(北京)有限公司 Transactions requests method for parallel processing, device, equipment and medium
CN110321219A (en) * 2019-05-06 2019-10-11 百度在线网络技术(北京)有限公司 A kind of parallel execution method, apparatus, equipment and the medium of transactions requests
CN110806923A (en) * 2019-10-29 2020-02-18 百度在线网络技术(北京)有限公司 Parallel processing method and device for block chain tasks, electronic equipment and medium
CN111683043A (en) * 2020-04-26 2020-09-18 华东师范大学 Intelligent contract concurrent execution method facing alliance chain and based on trusted execution environment
CN112150163A (en) * 2020-11-26 2020-12-29 北京微芯区块链与边缘计算研究院 Block chain contract transaction parallel execution method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于区块链的制造服务可信交易方法;王强;刘长春;周保茹;;计算机集成制造系统(第12期);全文 *
基于区块链的智能合约技术与应用综述;贺海武;延安;陈泽华;;计算机研究与发展(第11期);全文 *

Also Published As

Publication number Publication date
CN112764897A (en) 2021-05-07

Similar Documents

Publication Publication Date Title
CN109951547B (en) Transaction request parallel processing method, device, equipment and medium
CN110427386B (en) Data processing method, device and computer storage medium
CN110753084A (en) Uplink data reading method, cache server and computer readable storage medium
WO2022134797A1 (en) Data fragmentation storage method and apparatus, a computer device, and a storage medium
CN111309805B (en) Data reading and writing method and device for database
CN116028455A (en) Data processing method and device, storage medium and electronic equipment
CN111694639A (en) Method and device for updating address of process container and electronic equipment
CN112764897B (en) Task request processing method, device and system and computer readable storage medium
CN108228842B (en) Docker mirror image library file storage method, terminal, device and storage medium
CN112015595B (en) Master-slave database switching method, computing device and storage medium
CN112328325A (en) Execution method and device of model file, terminal equipment and storage medium
CN115114042A (en) Storage data access method and device, electronic equipment and storage medium
US10567549B2 (en) Distributed database transaction processing method, device based on GPS atomic clock server
CN110609707B (en) Online data processing system generation method, device and equipment
CN111046004A (en) Data file storage method, device, equipment and storage medium
CN116225314A (en) Data writing method, device, computer equipment and storage medium
US20130198138A1 (en) Model for capturing audit trail data with reduced probability of loss of critical data
CN110474954B (en) Block chain-based file sharing method and device, computer equipment and readable storage medium
CN109783717B (en) Query task processing method, system, server cluster, device and computer readable storage medium
CN113535338A (en) Interaction method, system, storage medium and electronic device for data access
CN113282347A (en) Plug-in operation method, device, equipment and storage medium
CN112100208A (en) Operation request forwarding method and device
CN112104735A (en) File transmission method, system and device and electronic equipment
CN111008220A (en) Dynamic identification method and device of data source, storage medium and electronic device
CN115103020B (en) Data migration processing method and device

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