CN112988751A - Timing task scheduling method and device based on block chain - Google Patents

Timing task scheduling method and device based on block chain Download PDF

Info

Publication number
CN112988751A
CN112988751A CN202110327969.XA CN202110327969A CN112988751A CN 112988751 A CN112988751 A CN 112988751A CN 202110327969 A CN202110327969 A CN 202110327969A CN 112988751 A CN112988751 A CN 112988751A
Authority
CN
China
Prior art keywords
task
main chain
timing
transaction
timing task
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.)
Pending
Application number
CN202110327969.XA
Other languages
Chinese (zh)
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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202110327969.XA priority Critical patent/CN112988751A/en
Publication of CN112988751A publication Critical patent/CN112988751A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries
    • 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
    • G06F16/275Synchronous replication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Software Systems (AREA)
  • Strategic Management (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Computing Systems (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computational Linguistics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The embodiment of the invention relates to the technical field of computers, in particular to a block chain-based timing task scheduling method and device, a storage medium and an electronic device. The method comprises the following steps: responding to a task scheduling instruction of a main chain to start service monitoring of the main chain; after monitoring that a timing task is linked on the main chain, carrying out original user state synchronization with the main chain, and executing the timing task after the timing task is synchronously finished with the main chain; synchronizing the user state after the timed task is executed to the main chain in response to a task stop instruction; and after the user state after the timing task is monitored to be synchronized to the main chain, ending the timing task. The method and the device can automatically transfer the timing task of the main chain to the designated side chain for execution, and effectively solve the problem of low execution efficiency of the timing task of the main chain.

Description

Timing task scheduling method and device based on block chain
The invention relates to a divisional application of patent applications with application dates of 04 and 22 in 2019, application number of 201910322758.X and invention name of 'block chain-based timing task scheduling method and device'.
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a block chain-based timing task scheduling method and device, a storage medium and an electronic device.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims and the description herein is not admitted to be prior art by inclusion in this section.
As an emerging distributed infrastructure, a blockchain should be a decentralized database in nature, and is now widely applied to many fields such as stock exchange, electronic commerce, social communication, and file storage.
Disclosure of Invention
However, in some technologies, on one hand, the existing block chain platform has relatively low transaction performance and relatively low transaction processing speed, and cannot meet the requirements of frequent transactions and transaction timeliness of users; on the other hand, different service contracts are used among the blockchain platforms, and a large amount of high-frequency transactions cannot be executed on one blockchain platform.
Therefore, in the prior art, how to shift the timing task of the main chain to the side chain execution still lacks a corresponding systematic and standard data processing method.
For this reason, an improved block chain-based timing task scheduling method and apparatus, a storage medium, and an electronic device are highly needed to implement efficient scheduling of timing tasks between a main chain and a side chain.
In this context, embodiments of the present invention are intended to provide a block chain-based timing task scheduling method and apparatus, a storage medium, and an electronic device.
According to an aspect of the present disclosure, there is provided a block chain-based timing task scheduling method, including:
responding to a task scheduling instruction of a main chain to start service monitoring of the main chain;
after monitoring that a timing task is linked on the main chain, carrying out original user state synchronization with the main chain, and executing the timing task after the timing task is synchronously finished with the main chain;
synchronizing the user state after the timed task is executed to the main chain in response to a task stop instruction;
and after the user state after the timing task is monitored to be synchronized to the main chain, ending the timing task.
In an exemplary embodiment of the present disclosure, the performing traffic monitoring on the main chain includes:
monitoring the transaction of the main chain designated address submitting the timing task through a transfer bridge to obtain transaction hash of the main chain designated address;
acquiring a block where the transaction submitting the timing task is located in the main chain according to the transaction hash, and inquiring a corresponding hash value according to a block head of the block;
and calculating a Mercker tree hash value according to the hash value, and comparing the Mercker tree hash value with an original Mercker tree hash value in the block head in the main chain to judge whether the transaction submitting the timing task is uplink in the main chain.
In an exemplary embodiment of the present disclosure, after monitoring that the timed task is uplink on the main chain, the synchronizing the original user status with the main chain includes:
after monitoring that the timing task is on the main chain, initiating a transaction for determining the state of the timing task on the main chain and carrying out chain connection;
after the state of the timing task in the main chain is determined, carrying out original user state synchronization with the main chain;
after the synchronous operation is completed, the transaction for completing the synchronization is initiated and linked up.
In an exemplary embodiment of the present disclosure, the synchronizing an original user state with the main chain after determining the state of the timed task at the main chain comprises:
and calling a main chain synchronous state interface through the transfer bridge to initiate a transaction of synchronizing the original user state with the main chain, and returning a synchronization result to the main chain.
In an exemplary embodiment of the present disclosure, the method further comprises:
and monitoring the transaction of the original user state synchronized with the main chain through the transit bridge to determine whether the operation of synchronizing the original user state is finished.
In an exemplary embodiment of the present disclosure, the performing the timing task includes:
and calling a contract to execute the timing task according to a timing rule in the timing task, and commonly identifying the uplink by the task result.
In an exemplary embodiment of the present disclosure, the invoking a contract according to a timing rule in the timing task to execute the timing task, and the cochaining the task result includes:
initiating a timing transaction by a timing contract executor of the block outlet node according to a timing contract, and sending a block to be confirmed containing the timing transaction to each voting node;
a timing contract executor of the voting node executes the timing transaction, generates a block voting result according to the execution result of the timing transaction and returns the block voting result to the block output node;
and the block output node judges whether to carry out block output uplink on the timing task result according to the block output voting result returned by each voting node.
In an exemplary embodiment of the present disclosure, the generating of the task stop instruction includes:
generating a task stop instruction according to a timing rule in the timing task; or
And when the transaction of the timing task stopping is monitored to be on the main chain, initiating the transaction of the timing task stopping to generate a task stopping instruction.
In an exemplary embodiment of the present disclosure, the synchronizing the user state after the timing task is executed to the main chain includes:
and calling a synchronous state interface of the main chain through a transfer bridge to initiate synchronous transaction for returning the execution result of the timing task to the main chain, so as to synchronize the user state after the timing task is executed to the main chain.
In an exemplary embodiment of the present disclosure, after it is monitored that the user status after the execution of the timing task is synchronized to the main chain, ending the timing task includes:
after monitoring that the main chain completes the synchronization of the user state after the timing task is executed, initiating the transaction of the main chain state synchronous completion and chaining;
initiating a transaction for an end timing task of the main chain to cause the main chain to perform the transaction to end the timing task.
In an exemplary embodiment of the disclosure, after monitoring that the main chain executes a transaction that ends a timing task, the method further comprises:
and initiating a transaction confirming the ending of the timed task to end the timed task.
According to an aspect of the present disclosure, there is provided a block chain-based timing task scheduling method, including:
configuring a side chain for a main chain based on a task scheduling instruction of the main chain so that the side chain starts service monitoring of the main chain;
after monitoring that a timing task is uplink on the main chain, the side chain is synchronous with the original user state executed by the main chain and executes the timing task on the side chain;
the side chain responds to a task stopping instruction and synchronizes the user state after the timed task is executed to the main chain so as to update the main chain;
and after the side chain monitors that the main chain synchronously completes the user state after the timing task is executed, finishing the timing task at the main chain and the side chain.
In an exemplary embodiment of the present disclosure, the side chain opening the traffic listening to the main chain includes:
the side chain monitors the transaction of the main chain appointed address submitting the timing task through a transfer bridge to obtain the transaction hash of the main chain appointed address;
acquiring a block where the transaction submitting the timing task is located in the main chain according to the transaction hash, and inquiring a corresponding hash value according to a block head of the block;
and calculating a Mercker tree hash value according to the hash value, and comparing the Mercker tree hash value with an original Mercker tree hash value in the block head in the main chain to judge whether the transaction submitting the timing task is uplink in the main chain.
In an exemplary embodiment of the disclosure, when the main chain submits the timing task, the method further includes:
and locking the management user at the main chain.
In an exemplary embodiment of the present disclosure, the sidechain monitoring to perform original user state synchronization with the main chain after the main chain submitted a timing task comprises:
after the side chain monitors that the timing task is uplink on the main chain, initiating a transaction for determining the state of the timing task on the main chain at the side chain and uplink;
after the timing task of the main chain is confirmed, the side chain initiates a transaction of synchronizing the original user state of the main chain so as to be used for synchronizing the original user state with the main chain;
and after the side chain confirms that the original user state synchronization is finished, initiating the transaction of synchronously finishing the side chain state on the side chain and uplink.
In an exemplary embodiment of the present disclosure, the sidechain initiating a transaction to synchronize a primary chain raw user state for synchronizing raw user states with the primary chain comprises:
the side chain calls the main chain synchronous state interface through the transfer bridge to initiate the transaction of the original user state of the synchronous main chain and return the synchronous result to the main chain.
In an exemplary embodiment of the present disclosure, the method for sidechain confirmation of completion of original user state synchronization includes:
the side chain monitors the transaction of the synchronous original user state of the main chain through the transit bridge to determine whether the operation of the synchronous original user state is finished.
In an exemplary embodiment of the present disclosure, the performing the timing task by the side chain includes:
and the side chain node calls a contract to execute the timing task according to a timing rule in the timing task, and identifies the uplink together with the task result.
In an exemplary embodiment of the present disclosure, the side-chain node invokes a contract according to a timing rule in the timing task to execute the timing task, and the cochaining task result includes:
a timing contract executor of a block outlet node of the side chain calls a timing contract to initiate timing transaction and sends a block to be confirmed containing the timing transaction to each voting node;
a timing contract executor of the voting node calls a timing contract to execute the timing transaction, generates a block voting result according to the execution result of the timing transaction, and returns the block voting result to the block output node;
and the block output node judges whether to carry out block output uplink on the timing task result according to a block output voting result returned by the voting node.
In an exemplary embodiment of the disclosure, the sidechain responding to a task stop instruction includes:
the side chain generates a task stop instruction according to a timing rule in the timing task; or
And when the side chain monitors the transaction of ending the timing task initiated at the main chain, initiating the transaction of ending the timing task at the side chain and uplink.
In an exemplary embodiment of the present disclosure, the synchronizing the user state with the backbone to update the backbone includes:
the side chain calls the main chain synchronous state interface through the transfer bridge to initiate synchronous transaction for returning the execution result of the timing task to the main chain, so that the execution result of the timing task of the side chain is returned to the main chain, and the user state of the main chain is updated.
In an exemplary embodiment of the present disclosure, after the side chain monitors that the user status after the main chain performs the timing task is synchronously completed, ending the timing task at the main chain and the side chain includes:
after monitoring that the synchronous operation of the main chain is completed, the side chain initiates a transaction for completing the synchronous state of the main chain and links the chain;
the side chain initiates a transaction aiming at the timing task ending of the main chain, so that the main chain executes the transaction of the timing task ending, and after the synchronous operation is confirmed to be completed, the transaction of the timing task ending is linked on the main chain to end the timing task.
In an exemplary embodiment of the disclosure, after the side chain monitors that the transaction of the end timing task of the main chain is uplink on the main chain, the method further includes:
the sidechain initiates a transaction for sidechain confirmation to end the timed task and uplink for ending the timed task at the sidechain.
In an exemplary embodiment of the present disclosure, the method further comprises:
the backbone unlocks the administrative user.
According to an aspect of the present disclosure, there is provided a block chain-based timing task scheduling apparatus, including:
the service monitoring module is used for responding to a task scheduling instruction of the main chain so as to start service monitoring on the main chain;
the first task execution module is used for carrying out original user state synchronization with the main chain after monitoring that a timing task is linked on the main chain, and executing the timing task after the timing task is synchronously finished with the main chain;
the first task stopping module is used for responding to a task stopping instruction and synchronizing the user state after the timing task is executed to the main chain;
and the task ending module is used for ending the timing task after monitoring that the user state after the timing task is executed and the main chain are synchronously finished.
In an exemplary embodiment of the present disclosure, the traffic monitoring module includes:
the transaction hash acquisition module is used for monitoring the transaction of the main chain designated address submitting the timing task through the transfer bridge to acquire the transaction hash;
the block head query module is used for acquiring the block where the transaction submitting the timing task is located in the main chain according to the transaction hash and querying a corresponding hash value according to the block head of the block;
and the hash value comparison module is used for calculating a Mercker tree hash value according to the hash value and comparing the Mercker tree hash value with an original Mercker tree hash value in the block head in the main chain so as to judge whether the transaction submitting the timing task is linked up in the main chain.
In an exemplary embodiment of the present disclosure, the first task execution module includes:
the timing task confirming module is used for initiating and uplink-transmitting the transaction for confirming the state of the timing task on the main chain after the timing task is monitored to be on the main chain;
the user state synchronization module is used for carrying out original user state synchronization with the main chain after the state of the timing task in the main chain is determined;
and the synchronous completion module is used for initiating and completing synchronous transaction and chaining after the synchronous operation is completed.
In an exemplary embodiment of the present disclosure, the user state synchronization module includes:
and the main chain synchronous state interface calling module is used for calling a main chain synchronous state interface through the transfer bridge so as to initiate a transaction of synchronizing the original user state with the main chain and returning a synchronous result to the main chain.
In an exemplary embodiment of the present disclosure, the apparatus further includes:
and the synchronization result confirmation module is used for monitoring the transaction of the original user state synchronized with the main chain through the transfer bridge so as to determine whether the operation of synchronizing the original user state is finished.
In an exemplary embodiment of the present disclosure, the first task execution module includes:
and the timing task execution module is used for calling a contract to execute the timing task according to a timing rule in the timing task and commonly identifying the uplink task result.
In an exemplary embodiment of the present disclosure, the timed task execution module includes:
the transaction initiating module is used for initiating a timing transaction by a timing contract executor of the block outlet node according to a timing contract and sending a block to be confirmed containing the timing transaction to each voting node;
a block voting result generation module, configured to execute the timing transaction by a timing contract executor of the voting node, generate a block voting result according to the execution result of the timing transaction, and return the block voting result to the block node;
and the timed task block output module is used for judging whether to uplink the timed task result block output by the block output node according to the block output voting result returned by each voting node.
In an exemplary embodiment of the present disclosure, the first task stop module includes:
the stop instruction generating module is used for generating a task stop instruction according to a timing rule in the timing task; and/or
And the stopping instruction monitoring module is used for initiating the transaction of the timing stopping task to generate a task stopping instruction when the fact that the transaction of the timing stopping task is on the main chain link is monitored.
In an exemplary embodiment of the present disclosure, the first task stop module further includes:
and the task result returning module is used for calling the synchronous state interface of the main chain through the transfer bridge to initiate synchronous transaction for returning the execution result of the timing task to the main chain so as to synchronize the user state after the timing task is executed to the main chain.
In an exemplary embodiment of the present disclosure, the task ending module includes:
the user state monitoring module is used for initiating and chaining the transaction of synchronously finished main chain states after monitoring that the main chain completes the synchronization of the user states after the timing task is executed;
and the main chain timing task ending module is used for initiating the transaction aiming at the main chain ending timing task so as to enable the main chain to execute the transaction of the ending timing task.
In an exemplary embodiment of the present disclosure, the apparatus further includes:
and the timing task ending module is used for initiating a transaction for confirming the ending of the timing task so as to end the timing task.
According to an aspect of the present disclosure, there is provided a block chain-based timing task scheduling apparatus, including:
the side chain allocation module is used for configuring a side chain for the main chain based on a task scheduling instruction of the main chain so as to enable the side chain to start service monitoring of the main chain;
a second task execution module, configured to synchronize, by the sidelink, with a user state executed by the main chain after the timed task is monitored to be uplink on the main chain, so as to execute the timed task on the sidelink;
the second task stopping module is used for the side chain responding to a task stopping instruction and synchronizing the user state after the timing task is executed to the main chain so as to update the main chain;
and the task ending module is used for ending the timing task at the main chain and the side chain after the side chain monitors that the main chain synchronously finishes the user state after the timing task is executed.
In an exemplary embodiment of the present disclosure, the apparatus further includes:
the transaction hash acquisition module is used for monitoring the transaction of the main chain designated address submitting the timing task through the transfer bridge by the side chain so as to acquire the transaction hash of the main chain designated address;
the block head query module is used for acquiring the block where the transaction submitting the timing task is located in the main chain according to the transaction hash and querying a corresponding hash value according to the block head of the block;
and the hash value comparison module is used for calculating a Mercker tree hash value according to the hash value and comparing the Mercker tree hash value with an original Mercker tree hash value in the block head in the main chain so as to judge whether the transaction submitting the timing task is linked up in the main chain.
In an exemplary embodiment of the present disclosure, the apparatus further includes:
and the user state locking module is used for locking and managing the user in the main chain when the main chain submits the timing task.
In an exemplary embodiment of the present disclosure, the second task execution module includes:
a timed task side chain determining module, configured to initiate a transaction for determining a state of the timed task in the main chain and perform chain-up at the side chain after the side chain monitors that the timed task is performed on the main chain;
the original user state synchronization module is used for initiating a transaction of synchronizing the original user state of the main chain after the timing task of the main chain is confirmed by the side chain so as to be used for synchronizing the original user state with the main chain;
and the original user state side chain confirmation module is used for initiating the transaction and uplink chain combining which are synchronously completed in the side chain state after the side chain confirms that the original user state synchronization is completed.
In an exemplary embodiment of the present disclosure, the original user state synchronization module includes:
and the main chain synchronous state interface calling module is used for calling the main chain synchronous state interface by the side chain through the transfer bridge so as to initiate the transaction of the original user state of the synchronous main chain and return the synchronous result to the main chain.
In an exemplary embodiment of the disclosure, the raw user state sidechain confirmation module includes:
and the main chain synchronous transaction monitoring module is used for monitoring the transaction of the synchronous original user state of the main chain by the side chain through a transfer bridge so as to determine whether the operation of the synchronous original user state is finished.
In an exemplary embodiment of the present disclosure, the second task execution module includes:
and the timing task side chain execution module is used for the side chain node to call a contract to execute the timing task according to a timing rule in the timing task and to identify the uplink together with the task result.
In an exemplary embodiment of the disclosure, the timed task sidechain execution module includes:
the exit block node execution module is used for calling a timing contract to initiate timing transaction by a timing contract executor of the exit block node of the side chain and sending a block to be confirmed containing the timing transaction to each voting node;
a voting node executing module, configured to invoke a timing contract to execute the timing transaction by a timing contract executor of the voting node, generate a block voting result according to an execution result of the timing transaction, and return the block voting result to the block node;
and the task result block output module is used for judging whether to uplink the timed task result block output by the block output node according to the block output voting result returned by the voting node.
In an exemplary embodiment of the present disclosure, the second task stopping module includes:
a stop instruction side chain generating module, configured to generate a task stop instruction according to a timing rule in the timing task by the side chain; and/or
And the stop instruction side chain monitoring module is used for initiating the transaction of the timing task ending at the side chain and uplink the transaction when the side chain monitors the transaction of the timing task ending initiated at the main chain.
In an exemplary embodiment of the present disclosure, the second task stopping module further includes:
and the task result returning module is used for calling the main chain synchronous state interface through the transfer bridge by the side chain to initiate synchronous transaction for returning the execution result of the timing task to the main chain, so that the execution result of the timing task of the side chain is returned to the main chain, and the user state of the main chain is updated.
In an exemplary embodiment of the present disclosure, the task completion module includes:
the main chain synchronous completion module is used for initiating and completing the transaction of main chain state synchronization and chaining after the side chain monitors that the synchronous operation of the main chain is completed;
and the timed task main chain ending module is used for initiating a transaction aiming at the main chain for ending the timed task by the side chain so as to enable the main chain to execute the transaction for ending the timed task, and after the completion of synchronous operation is confirmed, the transaction for ending the timed task is linked up on the main chain to end the timed task.
In an exemplary embodiment of the present disclosure, the task completion module further includes:
and the timed task side chain ending module is used for initiating the transaction of side chain confirmation ending the timed task and uplink by the side chain so as to end the timed task at the side chain.
In an exemplary embodiment of the present disclosure, the apparatus further includes:
and the user unlocking module is used for unlocking the management user by the main chain.
According to an aspect of the present disclosure, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the block chain based timing task scheduling method described in any of the above embodiments.
According to an aspect of the present disclosure, there is provided an electronic device including:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to execute any one of the above block chain based timing task scheduling methods via execution of the executable instructions.
According to the timing task scheduling method provided by the embodiment of the invention, the side chain can monitor the transaction submitted in the main chain in real time by allocating the corresponding side chain to the main chain in advance; and after the main chain is monitored to submit the timing task, the original user state of the main chain is synchronized to the side chain, so that the side chain can execute the corresponding timing task, the timing task of the main chain is automatically transferred to the specified side chain to be executed, and the problem of low execution efficiency of the timing task of the main chain is effectively solved. And after the timing task is finished by the side chain, the user state after the timing task is executed is synchronized to the main chain, so that the total transaction amount of the main chain is reduced, and the transaction overhead of the main chain is reduced.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
fig. 1 schematically shows a flowchart of a block chain based timing task scheduling method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for side-chain traffic snooping a main chain according to an embodiment of the present invention;
FIG. 3 schematically illustrates a flow diagram of a method for raw user state synchronization of a side chain with a main chain according to an embodiment of the present invention;
FIG. 4 is a flow chart of a method for the sidelink to co-identify uplink with timed task execution results according to an embodiment of the present invention;
FIG. 5 schematically illustrates a flow diagram of a method of ending a timed task according to an embodiment of the present invention;
FIG. 6 is a flow chart schematically illustrating another block chain based timing task scheduling method according to an embodiment of the present invention;
FIG. 7 is a block diagram schematically illustrating a block chain-based timed task scheduling apparatus according to an embodiment of the present invention;
FIG. 8 is a block diagram schematically illustrating another apparatus for block-chain-based scheduling of timed tasks according to an embodiment of the present invention;
FIG. 9 shows a schematic diagram of a storage medium according to an embodiment of the invention; and
fig. 10 schematically shows a block diagram of an electronic device according to an embodiment of the invention.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Accordingly, the present disclosure may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to the embodiment of the invention, a block chain-based timing task scheduling method, a block chain-based timing task scheduling device, a storage medium and an electronic device are provided.
In this document, any number of elements in the drawings is by way of example and not by way of limitation, and any nomenclature is used solely for differentiation and not by way of limitation.
The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the invention.
Summary of The Invention
The inventor finds that in the prior art, the existing block chain platform is subjected to the reasons of transaction single machine execution, single machine storage, single block chain consensus efficiency and the like, so that the transaction performance of the block chain platform is low, and the requirement of frequent transaction of a user cannot be met. In addition, in the prior art, different service contracts are used among the blockchain platforms, so that the timing transaction tasks in the blockchains can only be executed in the blockchain platform where the blockchain platforms are located, and the timing transaction tasks cannot be executed on one blockchain platform at a high frequency.
In view of the above, the basic idea of the present invention is: on one hand, the side chain can monitor the transaction submitted in the main chain and the uplink in real time by allocating the corresponding side chain to the main chain in advance; and after the main chain is monitored to submit the timing task, the original user state of the main chain is synchronized to the side chain, so that the side chain can execute the corresponding timing task, the timing task of the main chain is automatically transferred to the specified side chain to be executed, and the problem of low execution efficiency of the timing task of the main chain is effectively solved. In another aspect, the user state after the timing task is executed is synchronized to the main chain after the timing task is finished by the side chain, so that the transaction total amount of the main chain is further reduced, the transaction overhead of the main chain is reduced, and the transaction speed is increased.
Having described the general principles of the invention, various non-limiting embodiments of the invention are described in detail below.
Exemplary method
A block chain based timing task scheduling method according to an exemplary embodiment of the present invention is described below with reference to fig. 1.
Referring to fig. 1, the block chain-based timing task scheduling method may include the following steps:
s11, responding to a task scheduling instruction of the main chain to start the service monitoring of the main chain;
s12, after monitoring that the timing task is on the main chain, carrying out original user state synchronization with the main chain, and executing the timing task after the timing task is completed synchronously with the main chain;
s13, responding to a task stop instruction, and synchronizing the user state after the timing task is executed to the main chain;
and S14, after the user state after the timing task is monitored to be synchronized to the main chain, ending the timing task.
In the block chain-based timing task scheduling method, the side chain can monitor the transaction submitted in the main chain in real time by allocating the corresponding side chain to the main chain in advance; and after the main chain is monitored to submit the timing task, the original user state of the main chain is synchronized to the side chain, so that the side chain can execute the corresponding timing task, the timing task of the main chain is automatically transferred to the specified side chain to be executed, and the problem of low execution efficiency of the timing task of the main chain is effectively solved. And after the timing task is finished by the side chain, the user state after the timing task is executed is synchronized to the main chain, so that the total transaction amount of the main chain is reduced, and the transaction overhead of the main chain is reduced. .
In step S11, a task scheduling command is issued to the main chain to start traffic snooping the main chain.
In an exemplary embodiment of the present disclosure, for a side chain, a user may assign a corresponding side chain to a main chain, so that the side chain listens to transactions submitted and uplink on the main chain. The side chain may be a block chain mainly recognized by POS (Proof of Stake), BFT (Byzantine Fault Tolerance), and the like. In particular, the side chain may include a bridge, a side chain contract, and a side chain timing contract actuator. The transfer bridge is used as a part of the side chain, so that each node of the side chain can monitor the main chain block and the transaction through the transfer bridge. A side chain contract is a contract corresponding to a backbone business contract. The side-chain timing contract enforcer may be used to cycle through and execute the timing transactions according to the timing contract.
Among them, the transit bridge may have a query user status function (query status), an execute status function (execute status status), and an end timer function (execute finish timing). Specifically, the query user Status function described above is to call an export Status method (export Status Result) in the main chain contract. After the side chain calls the main chain export method, the user states of all associated user addresses (relative addresses) can be exported, and the initialization of the side chain contract user states is well done. The above-mentioned process of executing synchronous transaction function, that is, invoking a main chain synchronous state (sync Status) method in the main chain contract to initiate synchronous transaction, and returning the execution result of the side chain timer, that is, the user state result after the side chain executes the timing task, to the main chain. Meanwhile, the transfer bridge can also continuously monitor the synchronous transaction of the main chain to determine whether the synchronization is successful. The above-mentioned function of executing the finish timer can call a finish Timing task (finish Timing) method in the main chain contract, and after the states of all users of the side chain are completed synchronously, the side chain initiates a finish Timing task transaction to the main chain, thereby completely completing the Timing task of the main chain.
The side chain contract described above is a contract corresponding to a backbone business contract and may include a confirmation of submission Timing task (submit Timing). After the transit bridge monitors the transaction of the main chain for submitting the Timing task (submit Timing) and determines to uplink, the side chain starts to execute the transaction for determining to submit the Timing task from the node of the outgoing block, carries the parameter (time Params) of the Timing task of the main chain and submits the parameter to the side chain.
After the member of the blockchain allocates the corresponding side chain to the main chain, the side chain can also be configured with a main chain contract address to be monitored and a blockchain account number to be used. Furthermore, one main chain may correspond to one or more side chains, i.e. the timing tasks of the main chain may be assigned to at least one side chain for execution. Since multiple contracts may be included in the main chain, the main chain contract and the side chains may be in a many-to-many relationship, where one contract in the main chain may correspond to one side chain that performs its timing task. Then, the side chain can monitor the transaction (watch _ eth) and the block (watch _ block) of the main chain in a side chain/relay mode in real time through the transfer bridge.
Specifically, referring to fig. 2, the side chain performing traffic monitoring on the main chain may include the following steps:
step S111, monitoring the transaction of the main chain designated address submitting the timing task through a transfer bridge to obtain a transaction hash of the main chain designated address;
step S112, acquiring the block where the transaction submitting the timing task is located in the main chain according to the transaction hash, and inquiring a corresponding hash value according to the block head of the block;
step S113, calculating a mercker tree hash value according to the hash value, and comparing the mercker tree hash value with an original mercker tree hash value in the block header in the main chain to determine whether the transaction submitting the timing task is linked up in the main chain.
In an exemplary embodiment of the present disclosure, the sideline may determine the occurrence of a main chain timer transaction and whether to chain by monitoring a main chain transaction (watch _ eth) and a block (watch _ block). For example, the side chain may determine whether a timed task transaction occurs by monitoring all transactions under the business contract corresponding to the main chain. The side chain can also perform SPV certification (simple Payment certification) by listening to the headers of all blocks of the main chain that have been wound and adding these blocks to the side chain. Specifically, after monitoring the transaction of a timing task initiated by the main chain at a designated address, the side chain acquires the transaction hash of the transaction; and querying the main chain through the transaction hash to obtain the block where the transaction is located. The side chain inquires and acquires a hash value required for constructing a merkel tree (merkel tree) in the main chain block by monitoring the block head of the main chain, and calculates the merkel tree hash (merkel root hash) according to the hash value; and comparing the computed merkel hash with the original merkel hash in the head of the main chain block, and judging whether the computed merkel hash is equal to the original merkel hash. If the two are judged to be equal, the timed task transaction is proved to exist in the main chain and is linked up. If not, the transaction is proved to be absent in the main chain, or the data in the block header downloaded from the main chain by the side chain is proved to be wrong.
In step S12, after the timed task is monitored to be on the main chain, the original user status synchronization is performed with the main chain, and the timed task is executed after the synchronization with the main chain is completed.
In an exemplary embodiment of the present disclosure, after the sidelink monitors that the timing task is on the main chain, the original user status of the main chain may be synchronized to the sidelink, and then the corresponding timing task is executed on the sidelink after the synchronization is completed.
Specifically, referring to fig. 3, the aforementioned synchronizing the original user status with the main chain after the timed task is monitored to be uplink on the main chain may include:
step S1201, after the timed task is monitored to be on the main chain, initiating a transaction for determining the state of the timed task on the main chain and carrying out chain loading;
step S1202, after the state of the timing task in the main chain is determined, original user state synchronization is carried out between the timing task and the main chain;
in step S1203, after the synchronization operation is completed, a transaction for completing synchronization is initiated and linked.
In an exemplary embodiment of the present disclosure, after the side chain monitors a transaction of a submit Timing task (submit Timing) of the main chain through the transit bridge and determines that the transaction is on the main chain, the side chain initiates a transaction for determining a state of the Timing task on the main chain and the main chain is on. After the timing task of the main chain is determined, the side chain can execute the transaction of synchronizing the original user state of the main chain, and synchronize the states of all the associated user addresses of the main chain to the side chain. Specifically, the side chain invokes a export state (export Status) method of the main chain through the transit bridge, and initiates state synchronization of a management user Address (relative Address). The side-chain node makes each state synchronous uplink condition until all the original user state changes are successfully uplink.
After determining that all the User state synchronization is completed, the side chain can initiate a transaction for completing the side chain state synchronization (finish Sync User Status) and uplink. The side chain can also monitor the transaction of synchronizing the original user state with the main chain through the transit bridge to determine whether the operation of synchronizing the original user state is finished.
In addition, a specified Timing task execution method can be further included in the contract, and the Timing task (execute Timing) is handed to a Timing contract executor of each node of the side chain to manage the Timing task. The timing contract executor is a native module of a side chain, and polls to initiate a transaction to a contract-specified timing task execution method when a contract timing rule is satisfied. For example, the timed task execution method may include executing the timed task according to time and executing the transactions according to the block-out sequence, and executing the transactions each time.
After the original user state of the main chain is synchronized to the side chain, the side chain can continuously call a contract to execute the timing task by a timing contract executor according to the timing rule in the timing task in the main chain, and the task result is identified to the upper chain.
Specifically, as shown with reference to fig. 4, the following steps may be included:
step S1211, initiating a timing transaction by a timing contract executor of the block outlet node according to a timing contract, and sending a block to be confirmed containing the timing transaction to each voting node;
step S1212, the timing contract executor of the voting node executes the timing transaction, generates a block voting result according to the execution result of the timing transaction, and returns the block voting result to the block output node;
step S1213, the out-block node determines whether to perform out-block chaining on the timing task result according to the out-block voting result returned by each voting node.
In an exemplary embodiment of the disclosure, after a side chain takes turns to a certain node to be out of a block, a timing contract executor of the out-of-block node calls a corresponding timing task execution method on a contract according to a timing strategy to execute a timing transaction. And the block outlet node packages the timed transaction and sends the block to be confirmed to the voting node. The voting node also executes timed transactions by its own timing contract enforcer. The timing contract executor may first judge whether the timing trade meets the timing rule, and execute the timing trade based on the timing method in the contract when the judgment shows that the timing trade meets the rule. And after the timing contract executor of the voting node executes the timing task, adding the hash value corresponding to the execution result into the signature checking parameter, and returning the signature checking parameter to the voting node as a block voting result. And enabling the block exit node to collect the voting results of the voting nodes, and linking the block exit of the timing task after the voting nodes executing the timing task are larger than a certain proportion so as to complete a round of timing task. In the next round of timing task, other out-block nodes also sequentially poll to execute the timing task and uplink according to the mode.
In step S13, the user status after the timed task is executed is synchronized to the main chain in response to a task stop instruction.
In an exemplary embodiment of the present disclosure, the task stop instruction may be a task stop instruction generated according to a timing rule in the timed task; for example, the timed task is ended at a preset time point according to a timing rule, so that a task stop instruction is generated when the preset time point is reached; alternatively, the timed task is terminated after the timed task is executed a predetermined number of times, and a task stop instruction is generated. For example, if the preset number of times of executing the timing task is five hundred times, the task stop instruction is generated when the timing task is executed five hundred times. Or, when the transaction for stopping the timed task is monitored to be in the uplink, the transaction for stopping the timed task is initiated to generate a task stop instruction.
After the task stopping instruction is obtained, the synchronous state interface of the main chain can be called through the transfer bridge to initiate synchronous transaction for returning the execution result of the timing task to the main chain, so that the user state after the timing task is executed is synchronized to the main chain.
In step S14, after it is monitored that the user status after the execution of the timed task is synchronized to the main chain, the timed task is ended.
In an exemplary embodiment of the present disclosure, as shown with reference to fig. 5, the step S14 described above may include:
step S141, after monitoring that the main chain completes the synchronization of the user state after the timing task is executed, initiating the transaction of the main chain state synchronous completion and chaining;
step S142, initiating a transaction for the main chain to end the timing task, so that the main chain executes the transaction for ending the timing task.
Step S143, initiating a transaction confirming the end of the timing task to end the timing task.
In some exemplary embodiments of the present disclosure, after the side chain timing task is stopped, the side chain initiates a user state synchronization transaction to the main chain after the timing task is executed through the transit bridge, synchronizes the states of all management users, thereby changing all user states of the main chain, setting the number of tokens to be consistent with the number of side chains, and marking each user who completes synchronization. The side chain initiates the transaction of main chain state synchronous completion (finish Sync Status) by monitoring the main chain transaction and the block after determining that all user states of the main chain are changed, thereby leading the main chain to finish the timing task.
Further, after the side chain completes the transaction of synchronous completion of the main chain state, the side chain initiates the transaction aiming at the timing task ending of the main chain through the transfer bridge again, so that the main chain executes and completely ends the timing task. After the side chain monitors that the main chain finishes the Timing task, the side chain initiates a transaction for confirming that the Timing task (Finish fire Timing) is finished. And after the uplink is successful, the timing task is ended at the side chain, so that the timing task is completely ended. The uplink of the transaction in the main chain or the side chain means to save the transaction data into the corresponding blockchain and form a new block.
In other exemplary embodiments of the present disclosure, for the main chain and the side chain, as shown in fig. 6, the block chain based timing task scheduling method described above may include the following steps:
step S21, configuring a side chain for the main chain based on a task scheduling instruction for the main chain to enable the side chain to start the service monitoring for the main chain;
step S22, after the side chain monitors that the timing task is linked up on the main chain, the side chain synchronizes with the original user state executed by the main chain, and executes the timing task on the side chain;
step S23, the side chain synchronizing the user status after executing the timed task to the main chain to update the main chain in response to a task stop instruction;
step S24, when the side chain monitors that the main chain completes the synchronization of the user state after executing the timing task, the timing task is ended at the main chain and the side chain.
The interaction between the main chain and the side chain in the block chain based timing task scheduling method according to the exemplary embodiment of the present invention will be described in more detail with reference to the accompanying drawings and examples.
In step S21, based on a task scheduling command for the main chain, the main chain is configured with a side chain to enable the side chain to start traffic snooping for the main chain.
In an exemplary embodiment of the present disclosure, a user or a member of a blockchain may generate a task scheduling instruction according to actual needs in advance, where the instruction may include a specified side chain for allocating a migration and executing a timing task to a main chain (a main blockchain), and after the side chain is allocated, the side chain starts to perform transaction monitoring on the main chain. Also, the main chain may be assigned one or more side chains, i.e., the main chain and the side chains may be in a one-to-many relationship. The main chain may include a plurality of business contracts, i.e., the main chain contract and the side chains may be in a many-to-many relationship, wherein one contract in the main chain corresponds to one side chain that performs its corresponding timing task.
For example, the business contracts of the backbone described above may include methods to perform and synchronize timing tasks. For example, methods of submitting timed tasks, stopping timed tasks, deriving states, synchronizing states, and ending timed tasks may be included in a business contract. The method for submitting the timing task can comprise one or more of the following parameters:
1) a contract Address (send Address) for initiating the timed task, which must be a block chain Address specified by the contract, ensures that the timed task is initiated by this Address to prevent misuse by other account numbers.
2) A Method (execute Method) for executing the timing task, wherein the execution Method of the timing task must be a Method existing in a contract and used for calling the Method when the side chain executes the timing task. The timing method is determined by the user service; such as a value timing exchange method, a data timing trigger method, etc.
3) And (3) executing a parameter (method Param) of the timing method, wherein part of the timing method has a configuration parameter required for executing the timing task, and the configuration parameter is used for transmitting the configuration parameter into the side chain when the side chain executes the timing task, so that the side chain executes the timing task according to the configuration parameter.
4) The timing task is related to the Address (relative Address) of the user, and different addresses are necessarily related to the timing task because the timing task relates to the mutual value exchange among the addresses; there is therefore a need to specify the address of the associated user in order to lock the address of the specified associated user, i.e. not allow the specified address to be traded on the main chain. If the address of the associated user is not specified, all addresses of the contract may be locked, i.e., all addresses cannot be traded on the backbone. These addresses can be prevented from changing at both the side chain and the main chain by lock transactions, the locked addresses cannot be changed at the main chain, and changes are allowed at the side chain.
5) Timing task identification (time Id), Id that can be used to uniquely mark a timing task once. Other processes of subsequent timed tasks may also be identified by this ID.
6) The task type (type) is timed, for example, the timer type includes incremental polling by block, or polling blocks by time, etc.
7) The timing task policy (type Info), for example, if the execution is performed in increments of blocks, sets several blocks to perform timing transactions for a predetermined number of times, and the increments of the blocks are changed in increments of side chains, for example, ten transactions are initiated every time a block is added. If polling is performed in time, a predetermined time period is set and then timed transactions are performed for a predetermined number of times, for example, ten transactions are initiated every 10 seconds.
8) The timed task stop condition (stop requirement), i.e., the stop condition for the side chain to execute the timed task, may be set, for example, to stop the timed task after executing the tasks a predetermined number of times in total, or to stop the timed task after executing the tasks a predetermined total length of time, or the like. If no stop condition is set, the sidechain timer may be stopped by subsequently initiating a transaction to stop the timing task.
Specifically, the above-mentioned side chain performing traffic monitoring on the main chain may include:
step S211, the side chain monitors the transaction of the main chain designated address submitting timing task through a transfer bridge to obtain the transaction hash;
step S212, obtaining the block where the transaction submitting the timing task is located in the main chain according to the transaction hash, and inquiring a corresponding hash value according to the block head of the block;
step S213, calculating a mercker tree hash value according to the hash value, and comparing the mercker tree hash value with the original mercker tree hash value in the block header in the main chain to determine whether the transaction submitting the timing task is linked up in the main chain.
The side chain confirms whether the transaction of the main chain timing task occurs and is linked up through the transaction (watch eth) and block (watch block) monitoring results of the main chain. Specifically, the side chain monitors all transactions under a business contract corresponding to the main chain through the transfer bridge to judge whether related transactions of the timing task occur or not; the side chain performs SPV certification by listening to all block headers of the main chain that have been uplinked and adding to the side chain's own block chain (simple Payment Verification).
In step S22, after the side chain monitors that the timed task is uplink on the main chain, the side chain synchronizes with the original user status executed by the main chain and executes the timed task on the side chain.
In an exemplary embodiment of the present disclosure, a user may submit a timed task at the main chain, which may specify timing rules for the main chain contract. And when the main chain submits the timing task, the main chain can lock the management user, and data change in the main chain is prevented.
Specifically, the side chain monitoring that the original user state synchronization is executed with the main chain after the timing task submitted by the main chain may specifically include:
step S2211, after the side chain monitors that the timed task is uplink on the main chain, the side chain initiates a transaction and uplink on the side chain to determine the state of the timed task on the main chain;
step S2212, after the side chain confirms the timing task of the main chain, initiating a transaction of synchronizing an original user state of the main chain for synchronizing the original user state with the main chain;
step S2213, after the side chain confirms that the original user state synchronization is completed, initiating a side chain state synchronization completed transaction and uplink on the side chain.
After the side chain monitors the timed task uplink submitted by the main chain, the side chain can also initiate a transaction for determining the state of the timed task on the main chain and uplink the timed task, so that the timed transaction of the main chain is confirmed. After the timing task of the main chain is determined, the side chain can execute the transaction of the synchronous main chain original user state and chain up, thereby synchronizing the original user state of the main chain to the side chain.
Specifically, the side chain can call a main chain synchronous state interface through the transfer bridge to call a derived state method in a main chain contract to initiate a transaction of an original user state of the synchronous main chain, to derive an original user state of all associated user addresses of the main chain, and to perform initialization of the side chain.
Meanwhile, the synchronous result can be returned to the main chain, so that the main chain finishes the synchronous operation of the original user state. The side chain can also monitor the transaction of the synchronous original user state of the main chain through the transit bridge to determine whether the operation of the synchronous original user state is finished.
After the side chain completes the synchronization of the original user state, the side chain node can call a contract to execute the timing task according to the timing rule in the timing task, and the task result is identified to the uplink. Specifically, the method may include:
step S2221, a timing contract executor of a block outlet node of the side chain calls a timing contract to initiate timing transaction, and a block to be confirmed containing the timing transaction is sent to each voting node;
step S2222, the timing contract executor of the voting node calls a timing contract to execute the timing transaction, generates a block voting result according to the execution result of the timing transaction, and returns the block voting result to the block node;
step S2223, the block output node judges whether to output uplink to the block output of the timing task result according to the block output voting result returned by the voting node.
In an exemplary embodiment of the disclosure, a timing contract executor of a side chain node initiates a corresponding timing transaction according to a timing policy in a contract to execute a timing task. The status change in the contract must be the specified related user, and if the status change of a user outside the address range of the related user is involved in the contract execution process, the execution fails.
In step S23, the side chain synchronizes the user status after the timed task is executed to the main chain to update the main chain in response to a task stop instruction.
In an exemplary embodiment of the present disclosure, the task stop instruction described above may be a task stop instruction generated by the side chain according to a timing rule in the timed task, that is, a task stop instruction generated according to a method of completing the timed task in the main chain contract. Alternatively, when a method of stopping the timed task is not set in the contract, the timed task may be stopped by submitting a transaction for ending the timed task at the main chain. When the side chain monitors the transaction initiated at the main chain for ending the timed task, the side chain can initiate the transaction for ending the timed task and uplink, thereby ending the timed task.
Specifically, after the side chain stops the timing task, the side chain may call the main chain synchronous state interface through the transit bridge to initiate a synchronous transaction of returning an execution result of the timing task to the main chain, so as to return the execution result of the timing task of the side chain to the main chain, so as to update the user state of the main chain. The side chain calls a main chain synchronous state method through the transfer bridge to initiate synchronous transaction, returns the execution result of the side chain timing task, namely the user state result after the timing task is executed to the main chain, enables the main chain to change all user states, sets the number of tokens consistent with the side chain, and marks each synchronously completed user.
The caller of the main chain synchronous state interface needs to be the block chain account address managed by the side chain to prevent the timing task execution result of the side chain from migrating to other main chains or main chain accounts. The incoming parameters may also include an address, a number of tokens, and the like. For example, the user has 10 tokens originally in the main chain, and after the side chain executes the timing task, the user has 20 tokens, and the main chain sets the user to 20 tokens. Meanwhile, after the user token is successfully set, the successful setting can be marked. And the transfer bridge can also continuously monitor the synchronous transaction of the main chain to determine whether the synchronization is successful.
In step S24, after the side chain monitors that the main chain completes synchronization of the user state after the main chain executes the timing task, the timing task is ended at the main chain and the side chain.
In an exemplary embodiment of the present disclosure, the above step S24 may include:
step S241, after monitoring that the synchronous operation of the main chain is completed, the side chain initiates the transaction of completing the main chain state synchronization and links the chain;
in step S242, the side chain initiates a transaction for the main chain to end the timed task, so that the main chain executes the transaction for ending the timed task, and after confirming that the synchronization operation is completed, the side chain links the transaction for ending the timed task on the main chain to end the timed task.
In step S243, the side chain initiates a side chain to confirm the transaction and uplink for ending the timed task, so as to end the timed task at the side chain.
The side chain initiates and completes the transaction and chain linking of the main chain state synchronization after confirming that the user state after the timing task is executed and the main chain are completed synchronously by monitoring the transaction and the block of the main chain. Meanwhile, the locking state of each user in the main chain can be released.
The side chain can also call a main chain to finish the timing task method through the transfer bridge, initiate the transaction of finishing the timing task of the main chain, and completely finish the timing task of the main chain. And after the side chain monitors that the timing task is completely finished in the main chain, the side chain initiates a transaction for confirming the finishing of the timing task, and after the chain is successfully wound on the side chain, the timing task is completely finished in the side chain. Therefore, the process of submitting, synchronizing, executing, stopping and resynchronization of a timing task is completed at the main chain and the side chain.
In summary, by allocating one or more corresponding side chains to the main chain in advance, timing tasks of different contracts can be transferred to the specified side chains for execution when being submitted to the main chain. By utilizing the side chain cooperation to execute the timing task of the main chain, the problems of excessive timing transaction amount, and low efficiency and performance of a single block chain are solved; meanwhile, the total transaction amount of the main chain and the transaction overhead of the main chain are reduced; while the side chain may provide transactional queries for specific timed task tasks.
Exemplary devices
Having introduced the block chain based timing task scheduling method according to an exemplary embodiment of the present invention, a block chain based timing task scheduling apparatus according to an exemplary embodiment of the present invention will be described with reference to fig. 7.
Referring to fig. 7, a block chain-based timing task scheduler 10 according to an exemplary embodiment of the present invention may include: a service monitoring module 101, a first task execution module 102, a first task stop module 103, and a task end module 104. Wherein:
the traffic snooping module 101 may be configured to start traffic snooping the backbone in response to a task scheduling instruction to the backbone.
The first task execution module 102 may be configured to perform original user state synchronization with the main chain after monitoring that a timing task is on the main chain, and execute the timing task after completing the synchronization with the main chain.
The first task stop module 103 may be configured to synchronize the user status after the timed task is executed to the main chain in response to a task stop instruction.
The task ending module 104 may be configured to end the timing task after monitoring that the user state after the timing task is executed is completed synchronously with the main chain.
According to an exemplary embodiment of the present disclosure, the traffic monitoring module 101 may include: a transaction hash acquisition module, a block header query module, and a hash value comparison module (not shown). Wherein the content of the first and second substances,
the transaction hash acquisition module can be used for monitoring the transaction of the main chain designated address for submitting the timing task through the transit bridge to acquire the transaction hash of the main chain designated address.
The block head query module may be configured to obtain, according to the transaction hash, a block in which the transaction of the submitted timing task is located in the main chain, and query, according to the block head of the block, a corresponding hash value.
The hash value comparison module may be configured to calculate a tacher hash value according to the hash value, and compare the tacher hash value with an original tacher hash value in the block header in the main chain to determine whether the transaction submitting the timing task is linked up in the main chain.
According to an exemplary embodiment of the present disclosure, the first task execution module 102 may include: a timing task confirming module, a user state synchronizing module and a synchronization completing module (not shown in the figure). Wherein the content of the first and second substances,
the timed task confirmation module may be configured to initiate a transaction and uplink that determines a state of the timed task in the main chain after monitoring that the timed task is in the main chain uplink.
The user state synchronization module may be configured to perform original user state synchronization with the main chain after determining the state of the timing task in the main chain.
The synchronization completion module may be configured to initiate and chain a transaction that completes synchronization after the synchronization operation is completed.
According to an exemplary embodiment of the present disclosure, the user state synchronization module may include: the backbone synchronous state interface calls a module (not shown in the figure).
The main chain synchronous state interface calling module can be used for calling a main chain synchronous state interface through a transfer bridge so as to initiate a transaction of synchronizing an original user state with the main chain and return a synchronous result to the main chain.
According to an exemplary embodiment of the present disclosure, the apparatus further comprises: a synchronization result confirmation module (not shown in the figure).
The synchronization result confirmation module may be configured to monitor a transaction of synchronizing the original user state with the main chain through the transit bridge to determine whether an operation of synchronizing the original user state is completed.
According to an exemplary embodiment of the present disclosure, the first task execution module may include: a timed task execution module (not shown).
The timed task execution module may be configured to invoke a contract to execute the timed task according to a timed rule in the timed task, and identify uplink together with a task result.
According to an exemplary embodiment of the present disclosure, the timed task execution module may include: a transaction initiation module, an out-block voting result generation module and a timed task out-block module (not shown in the figure). Wherein the content of the first and second substances,
the transaction initiating module may be configured to initiate a timing transaction by a timing contract executor of the block output node according to a timing contract, and send a block to be confirmed containing the timing transaction to each voting node.
The block voting result generating module may be configured to execute the timing transaction by a timing contract executor of the voting node, generate a block voting result according to an execution result of the timing transaction, and return the block voting result to the block node.
The timed task block output module may be configured to determine, by the block output node, whether to uplink the timed task result block output according to the block output voting result returned by each voting node.
According to an exemplary embodiment of the present disclosure, the first task stop module 103 may include: the stop instruction generation module activates and/or stops the instruction listening module (not shown in the figure). Wherein the content of the first and second substances,
the stop instruction generating module may be configured to generate a task stop instruction according to a timing rule in the timing task.
The stop instruction monitoring module may be configured to initiate a transaction of a stop timed task to generate a task stop instruction when it is monitored that the transaction of the stop timed task is on the main uplink.
According to an exemplary embodiment of the disclosure, the first task stop module further comprises: and a task result returning module (not shown in the figure).
The task result returning module may be configured to invoke a synchronous state interface of the main chain through the transit bridge to initiate a synchronous transaction of returning an execution result of the timing task to the main chain, so as to synchronize a user state after the timing task is executed to the main chain.
According to an exemplary embodiment of the present disclosure, the task ending module includes: a user state monitoring module and a main chain timing task ending module (not shown in the figure). Wherein the content of the first and second substances,
the user state monitoring module may be configured to initiate a transaction of synchronous completion of the main chain state and uplink after monitoring that the main chain completes synchronization of the user state after the timing task is executed.
The main chain timed task ending module may be configured to initiate a transaction for an ending timed task of the main chain to cause the main chain to execute the transaction for the ending timed task.
According to an exemplary embodiment of the present disclosure, the apparatus further comprises: a timed task end module (not shown).
The timed task end module may be configured to initiate a transaction confirming an end of the timed task to end the timed task.
Referring to fig. 8, another block chain-based timing task scheduler 20 according to an exemplary embodiment of the present invention may include: a side chain assignment module 201, a second task execution module 202, a second task stop module 203, and a task end module 204. Wherein the content of the first and second substances,
the sidechain assignment module 201 may be configured to configure the sidechain for the main chain to enable the sidechain to turn on traffic snooping on the main chain based on a task scheduling instruction for the main chain.
The second task execution module 202 may be configured to synchronize with the main-chain execution user state after the side chain monitors that a timed task is uplink on the main-chain, so as to execute the timed task on the side chain.
The second task stopping module 203 may be configured to synchronize the user status after the timed task is executed to the main chain to update the main chain in response to a task stopping instruction by the side chain.
The task ending module 204 may be configured to end the timing task at the main chain and the side chain after the side chain monitors that the user status after the main chain performs the timing task is synchronously completed.
According to an exemplary embodiment of the present disclosure, the apparatus further comprises: a transaction hash acquisition module, a block header query module, and a hash value comparison module (not shown). Wherein the content of the first and second substances,
the transaction hash acquisition module can be used for the side chain to monitor the transaction of the submission timing task of the main chain specified address through the transit bridge so as to acquire the transaction hash of the main chain specified address.
The block head query module may be configured to obtain, according to the transaction hash, a block where the transaction of the timing task is submitted in the main chain, and query a corresponding hash value according to a block head of the block.
The hash value comparison module may be configured to calculate a tacher hash value according to the hash value, and compare the tacher hash value with an original tacher hash value in the block header in the main chain to determine whether the transaction submitting the timing task is linked up in the main chain.
According to an exemplary embodiment of the present disclosure, the apparatus further comprises: a user status locking module (not shown).
The user state lock module may be configured to manage a user at the backbone lock when the backbone submits timed tasks.
According to an exemplary embodiment of the present disclosure, the second task execution module includes: a timing task sidechain determining module, an original user state synchronization module and an original user state sidechain confirmation module (not shown in the figure). Wherein the content of the first and second substances,
the timed task sidelink determination module may be configured to, after the sidelink monitors that the timed task is on the main chain, initiate a trade parallel uplink at the sidelink that determines a state of the timed task on the main chain.
The primary user state synchronization module may be configured to initiate a transaction of synchronizing a primary user state of the primary chain after the side chain confirms the timing task of the primary chain, so as to synchronize the primary user state with the primary chain.
The raw user state sidechain confirmation module may be configured to initiate a sidechain state synchronization completed transaction uplink on the sidechain after the sidechain confirms that the raw user state synchronization is completed.
According to an exemplary embodiment of the present disclosure, the original user state synchronization module includes: the backbone synchronous state interface calls a module (not shown in the figure).
The main chain synchronous state interface calling module can be used for calling the main chain synchronous state interface by the side chain through the transfer bridge so as to initiate the transaction of the original user state of the synchronous main chain and return the synchronous result to the main chain.
According to an exemplary embodiment of the present disclosure, the raw user state sidechain confirmation module comprises: a backbone synchronous transaction listening module (not shown).
The main chain synchronous transaction monitoring module can be used for the side chain to monitor the transaction of the synchronous original user state of the main chain through the transit bridge so as to determine whether the operation of the synchronous original user state is completed.
According to an exemplary embodiment of the present disclosure, the second task execution module includes: a timed task side chain execution module (not shown).
The timing task side chain execution module may be configured to invoke a contract by the side chain node according to a timing rule in the timing task to execute the timing task, and identify uplink together with a task result.
According to an exemplary embodiment of the present disclosure, the timed task side-chain execution module may include: a block node execution module, a voting node execution module, and a task result block-out module (not shown). Wherein the content of the first and second substances,
the exit block node execution module may be configured to invoke a timing contract to initiate a timing transaction by a timing contract executor of an exit block node of the side chain, and send a block to be confirmed containing the timing transaction to each voting node.
The voting node execution module may be configured to invoke a timing contract to execute the timing transaction by a timing contract executor of the voting node, generate a block voting result according to an execution result of the timing transaction, and return the block voting result to the block output node.
The task result block output module may be configured to determine, by the block output node, whether to uplink the timed task result block output according to a block output voting result returned by the voting node.
According to an exemplary embodiment of the present disclosure, the second task stopping module includes: a stop command sidechain generation module and/or a stop command sidechain generation module (not shown). Wherein the content of the first and second substances,
the stop instruction side chain generating module may be configured to generate a task stop instruction by the side chain according to a timing rule in the timing task.
The stop instruction side chain monitoring module may be configured to, when the side chain monitors a transaction for ending the timing task initiated at the main chain, initiate a transaction for ending the timing task at the side chain and uplink the transaction.
According to an exemplary embodiment of the present disclosure, the second task stopping module further includes: and a task result returning module (not shown in the figure).
The task result returning module may be configured to invoke, by the side chain through the transit bridge, the main chain synchronous state interface to initiate a synchronous transaction of returning an execution result of the timing task to the main chain, so as to return the execution result of the timing task of the side chain to the main chain, so as to update the main chain user state.
According to an exemplary embodiment of the present disclosure, the task completion module includes: a backbone synchronous completion module and a timed task backbone end module (not shown). Wherein the content of the first and second substances,
the main chain synchronous completion module may be configured to initiate and complete a transaction of main chain state synchronization and uplink after the side chain monitors that the synchronous operation of the main chain is completed.
The timed task main chain ending module may be configured to initiate a transaction for ending the timed task with respect to the main chain by the side chain, so that the main chain executes the transaction for ending the timed task, and after confirming that the synchronization operation is completed, uplink the transaction for ending the timed task on the main chain to end the timed task.
According to an exemplary embodiment of the present disclosure, the task completion module further includes: a timed task sidechain ending module (not shown).
The timed task sidechain ending module may be configured to initiate a sidechain-initiated transaction for ending a timed task and uplink for ending the timed task at the sidechain.
According to an exemplary embodiment of the present disclosure, the apparatus further comprises: the user unlocks the module (not shown in the figure).
The user unlocking module can be used for unlocking the management user by the main chain.
Since each functional module of the block chain-based device for scheduling a timed task according to the embodiment of the present invention is the same as that of the block chain-based device for scheduling a timed task according to the embodiment of the present invention, further description is omitted here.
Exemplary storage Medium
Having described the audio playing method and apparatus, the audio sharing method and apparatus according to the exemplary embodiments of the present invention, a storage medium according to an exemplary embodiment of the present invention will be described with reference to fig. 9.
Referring to fig. 9, a program product 700 for implementing the above method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Exemplary electronic device
Having described the storage medium of an exemplary embodiment of the present invention, next, an electronic device of an exemplary embodiment of the present invention will be described with reference to fig. 10.
The electronic device 800 shown in fig. 10 is only an example and should not bring any limitation to the function and the scope of use of the embodiments of the present invention.
As shown in fig. 10, the electronic device 800 is embodied in the form of a general purpose computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 810, the at least one memory unit 820, a bus 830 connecting different system components (including the memory unit 820 and the processing unit 810), and a display unit 840.
Wherein the storage unit stores program code that is executable by the processing unit 810 to cause the processing unit 810 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 810 may perform steps S11 through S14 as shown in fig. 1, or the processing unit 810 may perform steps S21 through S24 as shown in fig. 6.
The memory unit 820 may include volatile memory units such as a random access memory unit (RAM)8201 and/or a cache memory unit 8202, and may further include a read only memory unit (ROM) 8203.
The storage unit 820 may also include a program/utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 830 may include a data bus, an address bus, and a control bus.
The electronic device 800 may also communicate with one or more external devices 900 (e.g., keyboard, pointing device, bluetooth device, etc.), which may be through an input/output (I/O) interface 850. The electronic device 800 further comprises a display unit 840 connected to the input/output (I/O) interface 850 for displaying. Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 860. As shown, the network adapter 860 communicates with the other modules of the electronic device 800 via the bus 830. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
It should be noted that although in the above detailed description several modules or sub-modules of the audio playback device and the audio sharing device are mentioned, such division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module according to embodiments of the invention. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Moreover, while the operations of the method of the invention are depicted in the drawings in a particular order, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions. While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, nor is the division of aspects, which is for convenience only as the features in such aspects may not be combined to benefit. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (24)

1. A timing task scheduling method based on a block chain is characterized by comprising the following steps:
responding to a task scheduling instruction of a main chain to start service monitoring of the main chain;
after monitoring that a timing task is linked on the main chain, carrying out original user state synchronization with the main chain, and executing the timing task after the timing task is synchronously finished with the main chain;
synchronizing the user state after the timed task is executed to the main chain in response to a task stop instruction;
and after the user state after the timing task is monitored to be synchronized to the main chain, ending the timing task.
2. The method of claim 1, wherein the listening for traffic to the backbone comprises:
monitoring the transaction of the main chain designated address submitting the timing task through a transfer bridge to obtain transaction hash of the main chain designated address;
acquiring a block where the transaction submitting the timing task is located in the main chain according to the transaction hash, and inquiring a corresponding hash value according to a block head of the block;
and calculating a Mercker tree hash value according to the hash value, and comparing the Mercker tree hash value with an original Mercker tree hash value in the block head in the main chain to judge whether the transaction submitting the timing task is uplink in the main chain.
3. The method of claim 1, wherein the synchronizing with the primary chain for original user status after monitoring that the timed task is uplink on the primary chain comprises:
after monitoring that the timing task is on the main chain, initiating a transaction for determining the state of the timing task on the main chain and carrying out chain connection;
after the state of the timing task in the main chain is determined, carrying out original user state synchronization with the main chain;
after the synchronous operation is completed, the transaction for completing the synchronization is initiated and linked up.
4. The method of claim 3, wherein after determining the state of the timed task at the backbone, synchronizing an original user state with the backbone comprises:
and calling a main chain synchronous state interface through the transfer bridge to initiate a transaction of synchronizing the original user state with the main chain, and returning a synchronization result to the main chain.
5. The method of claim 4, further comprising:
and monitoring the transaction of the original user state synchronized with the main chain through the transit bridge to determine whether the operation of synchronizing the original user state is finished.
6. The method of claim 1, wherein the performing the timing task comprises:
and calling a contract to execute the timing task according to a timing rule in the timing task, and commonly identifying the uplink by the task result.
7. The method of claim 6, wherein invoking a contract according to a timing rule in the timing task to execute the timing task and co-uplink task results comprises:
initiating a timing transaction by a timing contract executor of the block outlet node according to a timing contract, and sending a block to be confirmed containing the timing transaction to each voting node;
a timing contract executor of the voting node executes the timing transaction, generates a block voting result according to the execution result of the timing transaction and returns the block voting result to the block output node;
and the block output node judges whether to carry out block output uplink on the timing task result according to the block output voting result returned by each voting node.
8. The method of claim 1, wherein the generating of the task stop instruction comprises:
generating a task stop instruction according to a timing rule in the timing task; or
And when the transaction of the timing task stopping is monitored to be on the main chain, initiating the transaction of the timing task stopping to generate a task stopping instruction.
9. The method of claim 1, wherein synchronizing the user state after the timed task is performed to the main chain comprises:
and calling a synchronous state interface of the main chain through a transfer bridge to initiate synchronous transaction for returning the execution result of the timing task to the main chain, so as to synchronize the user state after the timing task is executed to the main chain.
10. The method of claim 1, wherein the ending the timed task after monitoring that the user status after the execution of the timed task is synchronized to the main chain comprises:
after monitoring that the main chain completes the synchronization of the user state after the timing task is executed, initiating the transaction of the main chain state synchronous completion and chaining;
initiating a transaction for an end timing task of the main chain to cause the main chain to perform the transaction to end the timing task.
11. The method of claim 10, wherein after monitoring a transaction for the backbone to perform an end timing task, the method further comprises:
and initiating a transaction confirming the ending of the timed task to end the timed task.
12. A block chain based timed task scheduler, comprising:
the service monitoring module is used for responding to a task scheduling instruction of the main chain so as to start service monitoring on the main chain;
the first task execution module is used for carrying out original user state synchronization with the main chain after monitoring that a timing task is linked on the main chain, and executing the timing task after the timing task is synchronously finished with the main chain;
the first task stopping module is used for responding to a task stopping instruction and synchronizing the user state after the timing task is executed to the main chain;
and the task ending module is used for ending the timing task after monitoring that the user state after the timing task is executed and the main chain are synchronously finished.
13. The apparatus of claim 12, wherein the traffic listening module comprises:
the transaction hash acquisition module is used for monitoring the transaction of the main chain designated address submitting the timing task through the transfer bridge to acquire the transaction hash;
the block head query module is used for acquiring the block where the transaction submitting the timing task is located in the main chain according to the transaction hash and querying a corresponding hash value according to the block head of the block;
and the hash value comparison module is used for calculating a Mercker tree hash value according to the hash value and comparing the Mercker tree hash value with an original Mercker tree hash value in the block head in the main chain so as to judge whether the transaction submitting the timing task is linked up in the main chain.
14. The apparatus of claim 12, wherein the first task execution module comprises:
the timing task confirming module is used for initiating and uplink-transmitting the transaction for confirming the state of the timing task on the main chain after the timing task is monitored to be on the main chain;
the user state synchronization module is used for carrying out original user state synchronization with the main chain after the state of the timing task in the main chain is determined;
and the synchronous completion module is used for initiating and completing synchronous transaction and chaining after the synchronous operation is completed.
15. The apparatus of claim 14, wherein the user state synchronization module comprises:
and the main chain synchronous state interface calling module is used for calling a main chain synchronous state interface through the transfer bridge so as to initiate a transaction of synchronizing the original user state with the main chain and returning a synchronous result to the main chain.
16. The apparatus of claim 15, further comprising:
and the synchronization result confirmation module is used for monitoring the transaction of the original user state synchronized with the main chain through the transfer bridge so as to determine whether the operation of synchronizing the original user state is finished.
17. The apparatus of claim 12, wherein the first task execution module comprises:
and the timing task execution module is used for calling a contract to execute the timing task according to a timing rule in the timing task and commonly identifying the uplink task result.
18. The apparatus of claim 17, wherein the timed task execution module comprises:
the transaction initiating module is used for initiating a timing transaction by a timing contract executor of the block outlet node according to a timing contract and sending a block to be confirmed containing the timing transaction to each voting node;
a block voting result generation module, configured to execute the timing transaction by a timing contract executor of the voting node, generate a block voting result according to the execution result of the timing transaction, and return the block voting result to the block node;
and the timed task block output module is used for judging whether to uplink the timed task result block output by the block output node according to the block output voting result returned by each voting node.
19. The apparatus of claim 12, wherein the first task stop module comprises:
the stop instruction generating module is used for generating a task stop instruction according to a timing rule in the timing task; and/or
And the stopping instruction monitoring module is used for initiating the transaction of the timing stopping task to generate a task stopping instruction when the fact that the transaction of the timing stopping task is on the main chain link is monitored.
20. The apparatus of claim 12, wherein the first task stop module further comprises:
and the task result returning module is used for calling the synchronous state interface of the main chain through the transfer bridge to initiate synchronous transaction for returning the execution result of the timing task to the main chain so as to synchronize the user state after the timing task is executed to the main chain.
21. The apparatus of claim 12, wherein the task end module comprises:
the user state monitoring module is used for initiating and chaining the transaction of synchronously finished main chain states after monitoring that the main chain completes the synchronization of the user states after the timing task is executed;
and the main chain timing task ending module is used for initiating the transaction aiming at the main chain ending timing task so as to enable the main chain to execute the transaction of the ending timing task.
22. The apparatus of claim 21, further comprising:
and the timing task ending module is used for initiating a transaction for confirming the ending of the timing task so as to end the timing task.
23. A storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the method for block chain based timing task scheduling according to any of claims 1 to 11.
24. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to execute the block chain based timing task scheduling method of any one of claims 1 to 11 via execution of the executable instructions.
CN202110327969.XA 2019-04-22 2019-04-22 Timing task scheduling method and device based on block chain Pending CN112988751A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110327969.XA CN112988751A (en) 2019-04-22 2019-04-22 Timing task scheduling method and device based on block chain

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110327969.XA CN112988751A (en) 2019-04-22 2019-04-22 Timing task scheduling method and device based on block chain
CN201910322758.XA CN110046166B (en) 2019-04-22 2019-04-22 Timing task scheduling method and device based on block chain

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN201910322758.XA Division CN110046166B (en) 2019-04-22 2019-04-22 Timing task scheduling method and device based on block chain

Publications (1)

Publication Number Publication Date
CN112988751A true CN112988751A (en) 2021-06-18

Family

ID=67278277

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202110327969.XA Pending CN112988751A (en) 2019-04-22 2019-04-22 Timing task scheduling method and device based on block chain
CN201910322758.XA Active CN110046166B (en) 2019-04-22 2019-04-22 Timing task scheduling method and device based on block chain

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN201910322758.XA Active CN110046166B (en) 2019-04-22 2019-04-22 Timing task scheduling method and device based on block chain

Country Status (1)

Country Link
CN (2) CN112988751A (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143053A (en) * 2019-11-15 2020-05-12 杭州涂鸦信息技术有限公司 Scheduling method of timing task, server and storage device
CN111369144B (en) * 2020-03-04 2022-02-18 浙江大学 Intelligent energy scheduling system and method based on fog calculation and block chain
CN113672358A (en) * 2020-05-15 2021-11-19 北京沃东天骏信息技术有限公司 Timing task processing method, device and system, electronic equipment and storage medium
CN112801795B (en) * 2021-03-08 2024-04-02 中国工商银行股份有限公司 Block chain multi-chain management method, device, electronic equipment and readable storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101701131B1 (en) * 2016-04-28 2017-02-13 주식회사 라피 Data recording and validation methods and systems using the connecting of blockchain between different type
CN108074081A (en) * 2017-12-08 2018-05-25 上海策赢网络科技有限公司 The transfer method and device of a kind of virtual resource
KR20180113139A (en) * 2017-04-05 2018-10-15 삼성에스디에스 주식회사 Method for calculating confirmation reliability for blockchain based transaction and Blockchain network monitoring system for performing the method
CN109271245A (en) * 2018-09-13 2019-01-25 腾讯科技(深圳)有限公司 A kind of control method and device of block processes task
CN109361661A (en) * 2018-10-08 2019-02-19 莆田市烛火信息技术有限公司 A kind of common recognition device for depending on related chain and calculating the block chain of power
CN109513207A (en) * 2018-11-12 2019-03-26 网易(杭州)网络有限公司 Processing method, device, storage medium, processor and the server of game asset
CN109558411A (en) * 2017-09-26 2019-04-02 浙江华信区块链科技服务有限公司 A kind of lower chain synchronous method and device based on block chain data
US20200204346A1 (en) * 2017-06-09 2020-06-25 nChain Holdings Limited Blockchain for general computation
US20200327498A1 (en) * 2016-03-21 2020-10-15 National Ict Australia Limited Business Process Execution on a Blockchain Platform

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528775B (en) * 2016-10-28 2020-01-03 济南大学 Private block chain operation support system supporting logic multi-chain and working method thereof
CN106874087A (en) * 2017-01-25 2017-06-20 上海钜真金融信息服务有限公司 A kind of block chain intelligence contract timed task dispatching method
US10498541B2 (en) * 2017-02-06 2019-12-03 ShocCard, Inc. Electronic identification verification methods and systems
CN107886388B (en) * 2017-09-22 2020-11-03 杭州云象网络技术有限公司 Transportation credit and safety service platform for realizing polycentricity based on alliance chain and operation method thereof
US10958418B2 (en) * 2017-10-10 2021-03-23 Chromata Corporation System and method for a blockchain network with heterogeneous privacy
CN107767267B (en) * 2017-10-20 2021-04-02 上海策赢网络科技有限公司 Virtual resource transfer method and device
WO2019109274A1 (en) * 2017-12-06 2019-06-13 深圳达闼科技控股有限公司 Cloud service configuration method and apparatus, storage medium, and cloud service system
CN109189751B (en) * 2018-09-18 2023-05-26 平安科技(深圳)有限公司 Data synchronization method based on block chain and terminal equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200327498A1 (en) * 2016-03-21 2020-10-15 National Ict Australia Limited Business Process Execution on a Blockchain Platform
KR101701131B1 (en) * 2016-04-28 2017-02-13 주식회사 라피 Data recording and validation methods and systems using the connecting of blockchain between different type
KR20180113139A (en) * 2017-04-05 2018-10-15 삼성에스디에스 주식회사 Method for calculating confirmation reliability for blockchain based transaction and Blockchain network monitoring system for performing the method
US20200204346A1 (en) * 2017-06-09 2020-06-25 nChain Holdings Limited Blockchain for general computation
CN109558411A (en) * 2017-09-26 2019-04-02 浙江华信区块链科技服务有限公司 A kind of lower chain synchronous method and device based on block chain data
CN108074081A (en) * 2017-12-08 2018-05-25 上海策赢网络科技有限公司 The transfer method and device of a kind of virtual resource
CN109271245A (en) * 2018-09-13 2019-01-25 腾讯科技(深圳)有限公司 A kind of control method and device of block processes task
CN109361661A (en) * 2018-10-08 2019-02-19 莆田市烛火信息技术有限公司 A kind of common recognition device for depending on related chain and calculating the block chain of power
CN109513207A (en) * 2018-11-12 2019-03-26 网易(杭州)网络有限公司 Processing method, device, storage medium, processor and the server of game asset

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘雄文;: "多区块链交易分发和事件处理的系统方案", 计算机科学, no. 2, pages 590 - 593 *
白杰;李东云;吴先锋;: "发布区块链标准应用模型及应用部署技术研究", 信息技术与网络安全, no. 08, pages 17 - 22 *

Also Published As

Publication number Publication date
CN110046166B (en) 2021-06-18
CN110046166A (en) 2019-07-23

Similar Documents

Publication Publication Date Title
CN110046166B (en) Timing task scheduling method and device based on block chain
CN107301536B (en) Resource transfers method and device
US10489278B2 (en) Method and system for implementing an automation software testing and packaging framework with entitlements
CN105573828B (en) A kind of operation processing method and device
CN108304260B (en) Virtualization operation scheduling system based on high-performance cloud computing and implementation method thereof
CN105359147A (en) Online database migration
CN107547606B (en) Data processing method, cluster manager, resource manager and data processing system
CN110413304A (en) The hot upgrade method of intelligent contract and device based on block chain network
CN111291060A (en) Method, device and computer readable medium for managing block chain nodes
JP2016513305A (en) Instance host configuration
CN110210845B (en) Method, apparatus, medium, and computing device for blockchain data migration
CN103703464A (en) Method and apparatus for distributed configuration management
WO2023045617A1 (en) Transaction data processing method and apparatus, device and medium
CN113064744A (en) Task processing method and device, computer readable medium and electronic equipment
CN111858751A (en) Data storage method and device based on block chain
CN110673938A (en) Task processing method, system, server and storage medium
CN109885612A (en) The synchronization take-effective method and device of block chain intelligence contract
CN111208992A (en) System scheduling workflow generation method and system
KR101453671B1 (en) Integrated interface system for monitoring and controling electric power system
CN112132684A (en) Account settling method and system based on language prediction machine lock group
CN110839071A (en) Information storage method, device and storage medium based on block chain
CN109947844B (en) Medical data management system based on medical block chain
KR20210097560A (en) Block chain transaction processing method
CN116974874A (en) Database testing method and device, electronic equipment and readable storage medium
CN111327447B (en) Distributed system, arbitration method, node device and storage medium

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