WO2020082917A1 - Methods and systems for publishing programming problem, publishing solution code, and checking solution code - Google Patents

Methods and systems for publishing programming problem, publishing solution code, and checking solution code Download PDF

Info

Publication number
WO2020082917A1
WO2020082917A1 PCT/CN2019/104897 CN2019104897W WO2020082917A1 WO 2020082917 A1 WO2020082917 A1 WO 2020082917A1 CN 2019104897 W CN2019104897 W CN 2019104897W WO 2020082917 A1 WO2020082917 A1 WO 2020082917A1
Authority
WO
WIPO (PCT)
Prior art keywords
node
transaction
topic
answer
programming
Prior art date
Application number
PCT/CN2019/104897
Other languages
French (fr)
Chinese (zh)
Inventor
杨达一
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2020082917A1 publication Critical patent/WO2020082917A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/20Education
    • G06Q50/205Education administration or guidance

Definitions

  • the embodiments of the present specification relate to the field of information technology, and in particular, to a method and system for issuing programming questions, issuing answer codes, and verifying answer codes.
  • IT institutions at home and abroad such as colleges and universities, computer schools, IT companies, etc.
  • users such as school students, on-the-job employees, interviewers Etc.
  • the embodiments of this specification provide a method and system for publishing programming problems.
  • the embodiments of the present specification also provide a method and system for issuing answer codes and checking answer codes.
  • a blockchain-based programming topic publishing method including:
  • the target node creates a programming topic to be released; the target node is any node in the blockchain network;
  • the target node constructs a topic publishing transaction based on topic related data, and broadcasts the topic publishing transaction to the blockchain network;
  • the topic related data includes the programming topic;
  • the node For each node that obtains the topic release transaction, the node writes the topic release transaction into the blockchain based on the consensus mechanism between the nodes.
  • a blockchain-based solution code issuing method including:
  • the target node obtains the programming topic;
  • the target node is any node in the blockchain network, and the programming topic is issued through the method of the first aspect above;
  • the target node provides the programming problem to the tested user for answering, and receives the answer code uploaded by the tested user;
  • the target node constructs an answer release transaction based on the answer-related data, and broadcasts the answer release transaction to the blockchain network;
  • the answer-related data includes the title identification of the programming topic, the answer code, and the The user ID of the tested user;
  • the node For each node that obtains the answer release transaction, the node writes the answer release transaction into the blockchain based on the consensus mechanism between the nodes.
  • a method for verifying a solution code based on a blockchain including:
  • the obtaining module obtains the answer code corresponding to the programming question and the user ID of the user under test uploading the answer code;
  • the programming question is issued through the method of the first aspect above, and the answer code is through the second aspect above Issued by the method,
  • the verification node is a node in the blockchain network that stores the solution verification data corresponding to the programming problem;
  • the verification node uses the stored solution verification data corresponding to the programming problem to verify the solution code
  • the verification node constructs a result publishing transaction based on the result-related data, and broadcasts the result publishing transaction to the blockchain network;
  • the node For each node that obtains the result publishing transaction, the node writes the result publishing transaction into the blockchain based on the consensus mechanism between the nodes.
  • a blockchain-based programming topic publishing system including a blockchain network composed of multiple nodes;
  • Any node creates a programming topic to be released; based on the data related to the topic, constructs a topic release transaction, and broadcasts the topic release transaction to the blockchain network, and the topic related data includes the programming topic;
  • Each node that obtains the topic release transaction writes the topic release transaction into the blockchain based on the consensus mechanism between the nodes.
  • a blockchain-based solution code issuing system including a blockchain network composed of multiple nodes;
  • the target node is any node in the blockchain network, and the programming question is issued through the method of the first aspect above; provide the programming question to the tested user for answering , And receive the answer code uploaded by the tested user; based on the answer-related data, construct an answer release transaction, and broadcast the answer release transaction to the blockchain network; wherein, the answer-related data includes the programming topic Title identification, the answer code and the user identification of the tested user;
  • Each node that obtains the answer release transaction writes the answer release transaction into the blockchain based on the consensus mechanism between the nodes.
  • a blockchain-based solution code verification system including a blockchain network composed of multiple nodes;
  • the verification node is a node in the blockchain network that stores the solution verification data corresponding to the programming problem; use the stored solution verification data corresponding to the programming problem to verify the solution code; if If the test passes, the result release transaction is constructed based on the result-related data, and the result release transaction is broadcast to the blockchain network; wherein, the result-related data includes the title identification of the programming topic and the user identification;
  • Each node that obtains the result publishing transaction writes the result publishing transaction into the blockchain based on the consensus mechanism between the nodes.
  • the equipment of any IT organization can be connected to the blockchain network and called a node.
  • any node can publish a programming topic created by itself based on the blockchain protocol, that is, any node can build a topic publishing transaction based on the programming topic created by itself, and then broadcast the topic publishing transaction to Other nodes.
  • Each node that obtains the topic release transaction will write the topic release transaction into the blockchain based on the consensus mechanism among the nodes.
  • any IT organization can share the programming problems created by itself to other IT organizations; on the other hand, the process for any node to issue programming problems is restricted by the blockchain protocol, and the programming problems are created from being created to being During the entire process of writing to the blockchain, it is difficult to be tampered with. After the programming problem is written to the blockchain, it is also difficult to be tampered with.
  • any node may extract programming questions from the programming questions shared among the nodes and provide the tested user with answers to test the programming level of the tested user.
  • the answer code uploaded by the tested user will also be encapsulated into the answer release transaction and written to the blockchain for publicity.
  • the node can also perform the answer code given by the user under test for the programming problem. Check to determine whether the user under test passes the test. In addition, if the tested user passes the test, the node will also construct the result release transaction and broadcast it, so that the message of the tested user passing the test will be written into the blockchain for publicity.
  • the present invention actually provides a blockchain-based programming proficiency testing solution, which includes the stages of programming problem release, code answering release, and code answering verification.
  • the answer records and the results of the tested users passing the test are written on the blockchain for publicity, making the entire programming level test process open and transparent.
  • any one of the embodiments of this specification does not need to achieve all the above-mentioned effects.
  • FIG. 1 is a schematic flowchart of a method for publishing a programming topic based on a blockchain provided by an embodiment of this specification;
  • FIG. 2 is a schematic flowchart of a method for issuing a solution code based on a blockchain provided by an embodiment of this specification;
  • FIG. 3 is a schematic flowchart of a method for verifying a solution code based on a blockchain provided by an embodiment of this specification;
  • FIG. 4 is a schematic flowchart of a parallel method for executing a blockchain transaction provided by an embodiment of this specification
  • FIG. 5 is a schematic diagram of a serialized transaction execution method in the prior art
  • FIG. 6 is a schematic diagram of a parallel transaction execution method provided by an embodiment of this specification.
  • FIG. 7 also provides a block diagram of a block-based programming issue issuing device according to an embodiment of this specification.
  • FIG. 8 also provides a block diagram of a block-based solution code issuing device corresponding to the embodiment of this specification.
  • FIG. 9 also provides a structural schematic diagram of an answer code verification device based on a blockchain corresponding to an embodiment of this specification.
  • FIG. 10 is a schematic flowchart of a programming level test system based on blockchain provided by an embodiment of this specification
  • FIG. 11 is a schematic structural diagram of a computer device for configuring the method of the embodiment of the present specification.
  • company A wants to understand the programming level of a certain user (eg, employee, interviewer), then company A can extract any programming topic from its programming question bank and provide it to the user.
  • the user answers according to the programming question, gives an answer code to answer the programming question, and uploads the answer code to company A's online judgment system.
  • Company A's online judgment system stores the answer test data (specifically, standard input data and standard output data) corresponding to each programming question in the above programming question bank, which is used to verify the correctness of the answer code.
  • the online question judgment system of Company A will input the standard input data corresponding to the programming question into the answer code and run the answer code, and then determine whether the answer code can output the standard output data corresponding to the programming question. The user passed the test, otherwise, the user is deemed to have failed the test.
  • the IT organization In practice, many IT organizations have a need to share each other's programming question banks. For this reason, in the prior art, for any IT organization, the IT organization generally uses a crawler program to crawl programming questions from the programming question bank of other IT institutions, and provides the crawled programming questions to the tested user for answers. Then, the IT institution also needs to send the answer code given by the tested user to the online question-finding system of the IT institution that created the programming question for verification.
  • any IT organization can use the blockchain protocol to publish the programming problems created by itself to the blockchain, which is equivalent to sharing the programming problems created by itself to other IT organizations. There is no need to worry that other IT organizations will modify the programming topic.
  • FIG. 1 is a schematic flowchart of a blockchain-based programming topic publishing method provided by an embodiment of this specification, including the following steps:
  • S100 The target node creates a programming problem to be released.
  • the equipment of each IT organization can be connected to the blockchain network and become a node in the blockchain network. That is to say, each node in the blockchain network corresponds to each IT organization that wants to share programming issues with each other.
  • the target node may be any node in the blockchain network. That is to say, the equipment of any IT organization can create and publish programming problems through the method shown in FIG. 1.
  • the target node creates a programming problem, which may specifically be that the target node receives a programming problem uploaded by an IT institution that controls the target node, or the target node may automatically create a programming problem according to a preset programming model.
  • S102 The target node constructs a topic release transaction based on topic related data.
  • the transaction described in this article refers to the data structure specified in the blockchain protocol.
  • a transaction refers to a node that is created by the installed blockchain client and needs to finally write a piece of data on the blockchain.
  • all data that needs to be written into the blockchain for publicity needs to be encapsulated into a transaction data structure.
  • the topic-related data includes at least the programming topic created by the target node in step S100.
  • the target node constructs a topic release transaction based on the topic-related data, and actually encapsulates the topic-related data into a transaction, a data structure specified by the blockchain protocol.
  • S104 The target node broadcasts the topic release transaction to the blockchain network.
  • step S104 the target node broadcasts the topic publishing transaction to the blockchain network, in fact, broadcasting the topic publishing transaction to other nodes, which is equivalent to sharing the programming topic to other nodes.
  • the node For each node that obtains the topic publishing transaction, the node can verify the legality of the topic publishing transaction before writing the topic publishing transaction into the blockchain.
  • the items for verifying the legality of the issue publishing transaction can be specified according to business needs. For example, assuming that not every node has the authority to publish programming topics, it is possible to publish the node identifier in the title issue transaction to determine whether the node corresponding to the node identifier (ie, the target node) has the authority to issue programming topics If there is no authority, it refuses to write the issue publishing transaction into the blockchain.
  • step S106 the consensus mechanism between each node ensures the consistency of the data written by each node to the blockchain each time. Therefore, even if a node modifies the programming topic encapsulated in the topic publishing transaction without authorization, thereby changing the content of the topic publishing transaction, the modified topic publishing transaction will not be written into the blockchain by most nodes.
  • the programming problems created by the target node can always be written into the blockchain without modification, so as to complete the sharing of programming problems.
  • the distributed storage feature of the blockchain is difficult to be tampered with.
  • any IT organization's equipment can access the blockchain network called a node.
  • any node can publish a programming topic created by itself based on the blockchain protocol, that is, any node can build a topic publishing transaction based on the programming topic created by itself, and then broadcast the topic publishing transaction to Other nodes.
  • Each node that obtains the topic release transaction will write the topic release transaction into the blockchain based on the consensus mechanism among the nodes.
  • any IT organization can share the programming problems created by itself to other IT organizations; on the other hand, the process for any node to issue programming problems is restricted by the blockchain protocol, and the programming problems are created from being created to being During the entire process of writing to the blockchain, it is difficult to be tampered with. After the programming problem is written to the blockchain, it is also difficult to be tampered with.
  • the topic-related data may further include the node identifier of the target node.
  • the target node will also encapsulate its own node ID into the topic release transaction, and then write it into the blockchain for publicity. In this way, it is possible to clearly share the creator of each programming topic of each IT organization, and protect the rights and interests of the IT organization that created the programming topic.
  • the node may create a topic storage address and store the topic-related data in the topic storage address. This is equivalent to storing programming topics in a simple storage manner. It should be noted that if a transaction is issued for any topic, the transaction can be issued based on the topic written in the blockchain to verify whether the programming topic stored in the topic storage address has been tampered with. In the above way, the node can be more convenient when it wants to call up a programming topic.
  • the node may specifically store the title smart contract encapsulated with the title-related data in the title storage address.
  • the title storage address is actually the contract identifier of the title smart contract.
  • Smart contracts are data structures that are naturally supported by many blockchain protocols (such as Ethereum), and many blockchain protocols also naturally support the rapid invocation of smart contracts. Therefore, it is possible to store programming topics in the form of a data structure such as a smart contract, which is convenient for subsequent retrieval of programming topics for programming level testing by calling a smart contract.
  • the embodiment of this specification further provides a method for issuing answer codes based on blockchain. As shown in FIG. 2, it includes the following steps:
  • the target node is any node in the blockchain network.
  • any IT organization wants to test the programming level of the user under test, it can trigger a target node controlled by itself to obtain programming problems.
  • the programming topic acquired by the target node is issued based on the programming topic release method shown in FIG. 1.
  • the target node can read the programming topic from any topic publishing transaction in the blockchain.
  • the target node may also obtain the programming topic from the topic storage address.
  • this method it is faster.
  • the target node can call the topic smart contract to obtain the programming topic.
  • S202 The target node provides the programming problem to the tested user for answering, and receives the answer code uploaded by the tested user.
  • S204 The target node constructs an answer release transaction based on the answer-related data.
  • the solution-related data includes at least the title identification of the programming topic, the solution code, and the user identification of the user under test.
  • the topic identification of the programming topic is the transaction hash of the topic publishing transaction; if the target node If a program storage address is used to obtain a programming problem, the problem of the programming problem is identified as the storage address.
  • the target node may check whether there is a compilation or running problem in the answer code. If the check passes, the answer release transaction will be constructed. If the check fails, the answer release transaction will be rejected.
  • S206 The target node broadcasts the solution release transaction to the blockchain network.
  • the node may verify the validity of the answer release transaction before writing the answer release transaction into the blockchain.
  • the matters for verifying the legality of the answering issue transaction can be specified according to business needs. For example, assuming that the format of the answer code is specified in advance, the format of the answer code in the answer publishing transaction can be verified, and if the format does not meet the requirements, the answer publishing transaction is refused to be written into the blockchain.
  • step S208 it is equivalent to publicize to each node the identity information of the tested user, the identification information of the programming question answered by the tested user, and the answer code given by the tested user.
  • each node may also create a solution storage address, and store the solution-related data in the solution storage address.
  • each node may store a solution smart contract encapsulated with the solution-related data in the solution storage address.
  • the embodiment of this specification further provides a method for verifying the answer codes based on blockchain.
  • the verification node obtains the answer code corresponding to the programming problem and the user identification of the user under test who uploaded the answer code.
  • the verification node stores a node that answers verification data corresponding to the programming problem.
  • the answer verification data is data for verifying the correctness of the answer code given to answer the programming problem.
  • the solution verification data generally includes standard input data and standard output data.
  • the verification node is generally a node that creates the programming problem.
  • the node that created the programming problem may also distribute the solution verification data corresponding to the programming problem to at least one other node.
  • the verification node may be another node that stores the solution verification data in addition to the node that created the programming problem.
  • the verification node may determine the question identification corresponding to the answer test data based on any stored answer test data. Then, from the query in the blockchain, a solution publishing transaction containing the title identification is found, and the solution code and the user identification are read from the solution publishing transaction.
  • the verification node may also query the solution storage address where the question identification is stored, and obtain the solution code and the user identification from the solution storage address.
  • the verification node may query a topic smart contract encapsulated with the topic identification, and call the topic smart contract to obtain the corresponding answer code and user identification.
  • the verification node verifies the solution code using the stored solution verification data corresponding to the programming problem.
  • the verification node if it passes the answer code verification, it can publish the message of the verification to the blockchain.
  • the result-related data actually includes the title ID of the programming topic and the user ID.
  • the meaning of the result release transaction is, for example, "user Zhang San answered the correct topic 1".
  • the verification node may also publish the message that the verification failed on the blockchain.
  • the result release transaction may mean that the test passed or failed.
  • the result-related data also needs to include a test passed result or a test failed result.
  • the node may verify the validity of the result publishing transaction before writing the topic publishing transaction into the blockchain.
  • the matters for verifying the legality of the transaction for issuing the result can be specified according to business needs. For example, assuming that only the node that created the programming topic has the authority to verify the answer code corresponding to the programming topic, it can be determined whether the verification node that broadcasts the result release transaction has the verification authority. The results are published and the transaction is written to the blockchain.
  • step S308 it is equivalent to publicize to each node the identity information of the tested user, the identification information of the programming question answered by the tested user, and the result of whether the tested user passed the test.
  • each node may also create a result storage address and store the result-related data in the result storage address.
  • each node may store the result smart contract encapsulated with the result related data in the result storage address.
  • the user under test may answer more than one programming question and upload more than one answer code.
  • the node can store the results of the tested user in solving multiple programming problems into the same result storage address, which is convenient for statistics and reference.
  • the node for each node that obtains the result publishing transaction, if the node obtains other result publishing transactions associated with the result publishing transaction, it is based on the consensus mechanism between the nodes, The other result publishing transaction is written into the blockchain, wherein the other result publishing transaction is constructed based on the user identification and other topic identifications. Then, the node issues a transaction based on the other results, and stores the other topic identifiers in the result storage address.
  • the result publishing transaction can be regarded as generated by the first programming question answered by the tested user, and the other result publishing transaction can be regarded as generated by other programming questions subsequently answered by the tested user .
  • the result publishing transaction can be regarded as generated by the first programming question answered by the tested user, and the other result publishing transaction can be regarded as generated by other programming questions subsequently answered by the tested user .
  • each user under test has a unique storage address corresponding to his own, which is used to record his / her answers.
  • the verification node obtains the answer code corresponding to the programming question and the user ID of the user under test uploading the answer code; then uses the stored answer verification data corresponding to the programming question, Verify the answer code; if the answer code is verified, construct a result release transaction based on the result-related data, and broadcast the result release transaction to the blockchain network.
  • the node when the node determines that the number of obtained result publishing transactions is the specified number, it will write any obtained result publishing transactions into the blockchain based on the consensus mechanism between the nodes.
  • the specified number is not greater than the number of inspection nodes.
  • a topic issue transaction there are three types of transactions, namely, a topic issue transaction, an answer issue transaction, and a result issue transaction.
  • a topic issue transaction creating a storage address and storing relevant data encapsulated by that type of exchange can be regarded as an execution operation for that type of transaction.
  • each node when consensus among nodes is required, each node will elect a node that has the authority to package several pending transactions into blocks based on the consensus algorithm, that is, an accounting node. After consensus, the accounting node takes a number of transactions to be executed from the cache and packages them into blocks, and broadcasts the blocks to other nodes. Then, for each node, on the one hand, the node will execute each transaction in turn from the first to the last in accordance with the order in which the transactions in the block were initiated, and on the other hand, the block will be written to the blockchain .
  • an accounting node takes a number of transactions to be executed from the cache and packages them into blocks, and broadcasts the blocks to other nodes. Then, for each node, on the one hand, the node will execute each transaction in turn from the first to the last in accordance with the order in which the transactions in the block were initiated, and on the other hand, the block will be written to the blockchain .
  • serialized transaction execution method the method of executing each transaction in the block one by one from first to second is called a serialized transaction execution method.
  • the reason why this serialized transaction execution method is adopted is that in common blockchain application scenarios, the execution of a transaction sometimes updates the information stored on more than one storage address. If serialization is not used In the form of transaction execution, it is easy for some transactions to fail.
  • the external account is used to store the user's Ether balance, and the external account is essentially a storage address where the balance information is stored.
  • the contract account is used to store the smart contract created by the user.
  • the contract account is essentially a storage address where the smart contract code is stored.
  • the execution of transfer transactions generally updates information stored on more than one storage address. Specifically, the execution of a transfer transaction usually changes the balance of the two accounts (that is, the balance information stored on the two account addresses), that is, the transfer amount is deducted from the balance of the transfer account and added to the balance of the collection account Increase the transfer amount.
  • the premise of a transfer transaction is that the balance of the transfer account is not less than the transfer amount.
  • the transfer account in a certain transfer transaction may be the collecting user in another previous transfer transaction (denoted as transfer transaction B). If the transaction is not executed in the order in which the transaction was initiated, then the following situation may occur, that is, the transfer transaction B has not been executed, resulting in the transfer account in the transfer transaction A not having sufficient balance for the transfer. Because of this, all blockchain application scenarios involving transfer transactions have to adopt serialized transaction execution methods to ensure that transactions can be executed smoothly.
  • the execution of the contract creation transaction is actually creating a contract account, that is, creating a storage address, and storing the smart contract code in the created storage address. Obviously, the execution of the contract creation transaction will only affect one storage address.
  • blockchain application scenarios are diverse. In some blockchain application scenarios, it can be expanded based on Ethereum to develop new types of transactions. The execution of such transactions may only affect one storage address. .
  • the execution of a deposit transaction is essentially to create a storage address and store the content to be deposited into the created storage address.
  • this paper proposes a method for parallel execution of blockchain transactions, specifically for a certain type of blockchain application scenarios.
  • the execution result of each transaction will only affect one storage address. .
  • FIG. 4 is a schematic flowchart of a method for executing a blockchain transaction in parallel provided by an embodiment of the present specification, including the following steps:
  • the blocks to be written are actually agreed by all nodes, the blocks packed by the accounting node.
  • the accounting node broadcasts the block to be written to other nodes.
  • each node needs to execute each transaction in the block to be written, on the other hand, it needs to write the block to be written into the blockchain for publicity.
  • Once the block to be written is written into the blockchain it is equivalent to publicizing each transaction in the block to be written.
  • the transaction published on the blockchain can be used to check whether the corresponding transaction execution result is correct to prevent any node from doing evil.
  • step S400 for each node, if the node is an accounting node, then the way for the node to obtain the block to be written may specifically be to grab several transactions from its own cache and package it into the area to be written Block; if the node is not an accounting node, then the way for the node to obtain the block to be written may specifically be to receive the block to be written broadcast by the accounting node.
  • the execution result of the transaction is to create a storage address and store the information, or update the information stored on a storage address Enter information or modify the information stored on a storage address). In other words, the execution result of each transaction in the block to be written will only affect one storage address.
  • a contract creation transaction that creates a contract account is a transaction whose execution result is to create a storage address and deposit information.
  • the issue publishing transaction and answer publishing transaction mentioned above are also the transactions whose execution results are creating a storage address and storing information.
  • each user's shopping record needs to be documented. Then, it is necessary to create a record storage address corresponding to each user in the database.
  • a shopping record will be generated, and any node in the blockchain network will build a record and record the transaction based on the shopping record and broadcast it. Then, for each node, the node will execute the record storage transaction at the appropriate time (that is, when the record storage transaction is packaged into the module to be written and broadcast to each node), that is, store the shopping record into the target user Corresponding record storage address.
  • the above record-storage transaction is the transaction whose execution result is updating the information stored on a storage address.
  • the results mentioned above issue the transaction, and the execution result is the transaction that updates the information stored on a storage address.
  • S402 Read each transaction from the block to be written, and organize each transaction into N transaction queues.
  • each node usually adopts a serialized transaction execution method to execute each transaction in the block to be written.
  • the so-called serialized transaction execution method refers to that each node executes each transaction in the to-be-written block one by one according to a certain first order.
  • each transaction in the block to be written is divided into N groups, where N is a natural number greater than 1. Then, for each group, arrange the transactions in this group into a transaction queue. This specification does not specifically limit the order of transactions in each transaction queue.
  • step S404 the parallel execution of transaction execution for each transaction queue is actually started at the same time. And specific to each transaction queue, actually execute each transaction in the transaction queue serially. As shown in Figure 6.
  • the so-called “simultaneously” means that the nodes start executing transactions in each transaction queue at the same time. It is equivalent to the node creating N transaction execution processes at the same time, and each transaction process is responsible for executing transactions in a transaction queue.
  • step S406 may be performed after step S404; or step S406 may not be performed after step S404 is performed.
  • each transaction to be written in the block is not a transaction that updates information stored in more than one storage address, then, in the blockchain network
  • Each node of can organize each transaction to be written into the block into at least two transaction queues, and then, at the same time, start executing the transactions in each transaction queue. In this way, each node can execute a larger number of transactions per unit time, which improves the efficiency of transaction execution.
  • the number of transactions corresponding to each transaction queue may be relatively close. In this way, when the transaction execution is executed for each transaction queue while being parallelized, the number of transactions executed by each execution process is relatively close, and some processes are not idle and some processes are overloaded. This also means that nodes can execute as many transactions as possible in a unit of time.
  • the variance calculated based on the number of transactions corresponding to each transaction queue is not greater than a specified threshold. The smaller the variance calculated based on the number of transactions corresponding to each transaction queue, the closer the number of transactions corresponding to each transaction queue.
  • the Ethereum protocol can be used to construct a blockchain network.
  • a virtual machine program is installed on each node to provide a running environment for the implementation of the Ethereum protocol.
  • a virtual machine program is used to execute a blockchain process.
  • more than one transaction queue needs to be simultaneously executed and more than one blockchain process needs to be executed in parallel, it is necessary to deploy more than one virtual machine program in advance on each node.
  • N virtual machine programs need to be deployed on each node in advance.
  • step S404 a one-to-one correspondence between N virtual machine programs and N transaction queues that are pre-deployed can be established; at the same time, for each transaction queue, the virtual machine program corresponding to that transaction queue Then execute each transaction in the transaction queue in turn.
  • the transactions to be written in the block include both the first type transaction and the second type transaction.
  • the first type of transaction refers to the transaction whose execution result is to update the information stored on a storage address
  • the second type of transaction refers to the transaction whose execution result is to create a storage address and store the information.
  • a transaction whose execution result is to update the information stored on a storage address may be selected from each transaction as a first-type transaction, and other transactions except the first-type transaction in each transaction As a second type of transaction; in each first type of transaction, the corresponding first type of transaction with the same storage address is organized into a transaction sub-queue; each transaction sub-queue is a processing unit, and each second type of transaction The transaction is regarded as one processing unit; each processing unit is organized into N transaction queues.
  • each processing unit is organized into N transaction queues, which can be as follows:
  • the processing units are sorted from large to small; and, the number of transactions corresponding to each transaction queue is initialized to 0; according to the sorting result, the first processing unit is selected; the currently selected The processing unit is added to the tail of the minimum transaction queue, and the number of transactions corresponding to the minimum transaction queue is updated; the minimum transaction queue is the transaction queue with the smallest corresponding number of transactions; continue to select the next processing unit until all processing units are Add to the transaction queue.
  • the number of transactions corresponding to each transaction queue can be made substantially the same.
  • the workload on each execution process is also roughly the same, and no execution process will be idle, so that the most transactions can be executed in a unit time, significantly Improve the transaction execution efficiency of nodes.
  • the embodiment of this specification also correspondingly provides a blockchain-based programming issue issuing device.
  • the device is any node in the blockchain network.
  • the device includes:
  • Construct a broadcast module 702 construct a topic release transaction based on the topic-related data, and broadcast the topic release transaction to the blockchain network; the topic-related data includes the programming topic, so that the topic release transaction is obtained
  • Each node writes the issue publishing transaction into the blockchain based on the consensus mechanism between the nodes.
  • the embodiment of this specification also correspondingly provides a blockchain-based solution code issuing device.
  • the device is any node in the blockchain network.
  • the device includes:
  • the obtaining module 801 obtains programming topics; the programming topics are issued by the method according to any one of claims 1 to 4;
  • the answering module 802 provides the programming question to the tested user for answering, and receives the answer code uploaded by the tested user;
  • the solution-related data includes a problem identification of the programming problem, the solution code, and a user identification of the user under test.
  • the embodiment of the present specification also correspondingly provides a blockchain-based solution code verification device.
  • the device is in a blockchain network and stores corresponding programming problems.
  • the device includes:
  • the obtaining module 901 obtains the answer code corresponding to the programming question and the user ID of the user who is tested by uploading the answer code; the programming question is issued by the method shown in FIG. Published by the method shown;
  • the verification module 902 uses the stored verification data corresponding to the programming problem to verify the solution code
  • the result-related data includes the title identification of the programming topic and the user identification.
  • the embodiments of the present specification also correspondingly provide a blockchain-based programming topic publishing system, including a blockchain network composed of multiple nodes;
  • Any node creates a programming topic to be released; based on the data related to the topic, constructs a topic release transaction, and broadcasts the topic release transaction to the blockchain network, and the topic related data includes the programming topic;
  • Each node that obtains the topic release transaction writes the topic release transaction into the blockchain based on the consensus mechanism between the nodes.
  • the embodiment of this specification also correspondingly provides a blockchain-based solution code issuing system, including a blockchain network composed of multiple nodes;
  • the target node is any node in the blockchain network, and the programming question is published according to the method shown in Figure 1; provide the programming question to the tested user for answering , And receive the answer code uploaded by the tested user; based on the answer-related data, construct an answer release transaction, and broadcast the answer release transaction to the blockchain network; wherein, the answer-related data includes the programming topic Title identification, the answer code and the user identification of the tested user;
  • Each node that obtains the answer release transaction writes the answer release transaction into the blockchain based on the consensus mechanism between the nodes.
  • the embodiment of this specification also correspondingly provides a blockchain-based solution code verification system, including a blockchain network composed of multiple nodes;
  • the verification node is a node in the blockchain network that stores the solution verification data corresponding to the programming problem; use the stored solution verification data corresponding to the programming problem to verify the solution code; if If the test passes, the result release transaction is constructed based on the result-related data, and the result release transaction is broadcast to the blockchain network; wherein, the result-related data includes the title identification of the programming topic and the user identification;
  • Each node that obtains the result publishing transaction writes the result publishing transaction into the blockchain based on the consensus mechanism between the nodes.
  • FIG. 10 is a schematic structural diagram of a blockchain-based programming level testing system provided by an embodiment of the present specification.
  • the system shown in FIG. 10 can be specifically used to implement a block chain-based programming question issuing system, answer code issuing system, and answer code checking system.
  • An embodiment of the present specification also provides a computer device, which includes at least a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the program to implement FIG. 1 or FIG. 2 or The function of the method shown in Figure 3.
  • FIG. 11 shows a schematic diagram of a more specific hardware structure of a computing device provided by an embodiment of the present specification.
  • the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050.
  • the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 realize the communication connection between the devices within the device through the bus 1050.
  • the processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit, central processing unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. Programs to implement the technical solutions provided by the embodiments of the present specification.
  • the memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory, random access memory), static storage devices, and dynamic storage devices.
  • the memory 1020 may store an operating system and other application programs. When the technical solutions provided by the embodiments of the present specification are implemented by software or firmware, related program codes are stored in the memory 1020 and are called and executed by the processor 1010.
  • the input / output interface 1030 is used to connect input / output modules to realize information input and output.
  • the input / output / module can be configured as a component in the device (not shown in the figure), or can be externally connected to the device to provide corresponding functions.
  • the input device may include a keyboard, mouse, touch screen, microphone, various sensors, etc.
  • the output device may include a display, a speaker, a vibrator, an indicator light, and the like.
  • the communication interface 1040 is used to connect a communication module (not shown in the figure) to implement communication interaction between the device and other devices.
  • the communication module can realize communication through a wired method (such as USB, network cable, etc.), and can also implement communication through a wireless method (such as mobile network, WIFI, Bluetooth, etc.).
  • the bus 1050 includes a path for transferring information between various components of the device (for example, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
  • the device may also include the necessary to achieve normal operation Other components.
  • the above-mentioned device may also include only the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figures.
  • Embodiments of the present specification also provide a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the functions of the method shown in FIG. 1 and / or FIG. 4.
  • Computer readable media including permanent and non-permanent, removable and non-removable media, can store information by any method or technology.
  • the information may be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices.
  • computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
  • the system, method, module or unit explained in the above embodiments may be implemented by a computer chip or entity, or by a product with a certain function.
  • a typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or any combination of these devices.

Abstract

Methods and systems for publishing a programming problem, publishing solution code, and checking solution code. A device from any IT organization may access a blockchain network as a node. In the blockchain network, any node may, on the basis of a blockchain protocol, publish a programming problem created by said node, which is to say, any node may establish a problem publishing transaction on the basis of a programming problem created by said node, and then broadcast the problem publishing transaction to other nodes. Every node receiving the problem publishing transaction will, on the basis of a consensus mechanism between the nodes, write the problem publishing transaction into the blockchain.

Description

编程题目发布、解答代码发布、解答代码检验方法及系统Programming problem release, answer code release, answer code verification method and system 技术领域Technical field
本说明书实施例涉及信息技术领域,尤其涉及一种编程题目发布、解答代码发布、解答代码检验方法及系统。The embodiments of the present specification relate to the field of information technology, and in particular, to a method and system for issuing programming questions, issuing answer codes, and verifying answer codes.
背景技术Background technique
目前,国内外的诸多信息技术(Information Technology,IT)机构(如高等院校计算机学院、IT公司等)一般都会搭建自己的编程题库,用于测试用户(如在校学生、在职员工、面试者等)的编程水平。At present, many information technology (IT) institutions at home and abroad (such as colleges and universities, computer schools, IT companies, etc.) generally build their own programming question bank for testing users (such as school students, on-the-job employees, interviewers Etc.) programming level.
在实践中,很多IT机构有共享彼此的编程题库的需求。然而,对于任一IT机构而言,如何防止其他IT机构擅自修改该IT机构创建的编程题目,是丞待解决的技术问题。In practice, many IT organizations have a need to share each other's programming question banks. However, for any IT organization, how to prevent other IT organizations from modifying the programming problems created by the IT organization without authorization is a technical problem to be solved.
发明内容Summary of the invention
为了解决任一IT机构共享给其他IT机构的编程题目容易被其他IT机构擅自修改的问题,本说明书实施例提供一种编程题目发布方法及系统。此外,本说明书实施例还提用了一种解答代码发布、解答代码检验方法及系统。In order to solve the problem that programming problems shared by any IT organization to other IT organizations are easily modified by other IT organizations, the embodiments of this specification provide a method and system for publishing programming problems. In addition, the embodiments of the present specification also provide a method and system for issuing answer codes and checking answer codes.
上述技术方案如下:The above technical solutions are as follows:
根据本说明书实施例的第1方面,提供一种基于区块链的编程题目发布方法,包括:According to the first aspect of the embodiments of the present specification, there is provided a blockchain-based programming topic publishing method, including:
目标节点创设待发布的编程题目;所述目标节点为区块链网络中的任一节点;The target node creates a programming topic to be released; the target node is any node in the blockchain network;
所述目标节点基于题目相关数据,构建题目发布交易,并向所述区块链网络广播所述题目发布交易;所述题目相关数据包括所述编程题目;The target node constructs a topic publishing transaction based on topic related data, and broadcasts the topic publishing transaction to the blockchain network; the topic related data includes the programming topic;
针对获得所述题目发布交易的每个节点,该节点基于各节点之间的共识机制,将所述题目发布交易写入区块链。For each node that obtains the topic release transaction, the node writes the topic release transaction into the blockchain based on the consensus mechanism between the nodes.
根据本说明书实施例的第2方面,提供一种基于区块链的解答代码发布方法,包括:According to the second aspect of the embodiments of the present specification, a blockchain-based solution code issuing method is provided, including:
目标节点获取编程题目;所述目标节点为区块链网络中的任一节点,所述编程题目是通过上述第1方面的方法发布的;The target node obtains the programming topic; the target node is any node in the blockchain network, and the programming topic is issued through the method of the first aspect above;
所述目标节点将所述编程题目提供给被测试用户进行解答,并接收所述被测试用户上传的解答代码;The target node provides the programming problem to the tested user for answering, and receives the answer code uploaded by the tested user;
所述目标节点基于解答相关数据,构建解答发布交易,并向所述区块链网络广播所述解答发布交易;所述解答相关数据包括所述编程题目的题目标识、所述解答代码与所述被测试用户的用户标识;The target node constructs an answer release transaction based on the answer-related data, and broadcasts the answer release transaction to the blockchain network; the answer-related data includes the title identification of the programming topic, the answer code, and the The user ID of the tested user;
针对获得所述解答发布交易的每个节点,该节点基于各节点之间的共识机制,将所述解答发布交易写入区块链。For each node that obtains the answer release transaction, the node writes the answer release transaction into the blockchain based on the consensus mechanism between the nodes.
根据本说明书实施例的第3方面,提供一种基于区块链的解答代码检验方法,包括:According to a third aspect of the embodiments of this specification, a method for verifying a solution code based on a blockchain is provided, including:
获取模块,获取编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识;所述编程题目是通过上述第1方面的方法发布的,所述解答代码是通过上述第2方面的方法发布的,所述检验节点是区块链网络中,存储有所述编程题目对应的解答检验数据的节点;The obtaining module obtains the answer code corresponding to the programming question and the user ID of the user under test uploading the answer code; the programming question is issued through the method of the first aspect above, and the answer code is through the second aspect above Issued by the method, the verification node is a node in the blockchain network that stores the solution verification data corresponding to the programming problem;
所述检验节点使用存储的对应于所述编程题目的解答检验数据,检验所述解答代码;The verification node uses the stored solution verification data corresponding to the programming problem to verify the solution code;
若检验通过,则所述检验节点基于结果相关数据,构建结果发布交易,并向所述区块链网络广播所述结果发布交易;所述结果相关数据包括所述编程题目的题目标识与所述用户标识;If the verification passes, the verification node constructs a result publishing transaction based on the result-related data, and broadcasts the result publishing transaction to the blockchain network; User identification
针对获得所述结果发布交易的每个节点,该节点基于各节点之间的共识机制,将所述结果发布交易写入区块链。For each node that obtains the result publishing transaction, the node writes the result publishing transaction into the blockchain based on the consensus mechanism between the nodes.
根据本说明书实施例的第4方面,提供一种基于区块链的编程题目发布系统,包括由多个节点组成的区块链网络;According to a fourth aspect of the embodiments of the present specification, there is provided a blockchain-based programming topic publishing system, including a blockchain network composed of multiple nodes;
任一节点,创设待发布的编程题目;基于题目相关数据,构建题目发布交易,并向所述区块链网络广播所述题目发布交易,所述题目相关数据包括所述编程题目;Any node creates a programming topic to be released; based on the data related to the topic, constructs a topic release transaction, and broadcasts the topic release transaction to the blockchain network, and the topic related data includes the programming topic;
获得所述题目发布交易的每个节点,基于各节点之间的共识机制,将所述题目发布交易写入区块链。Each node that obtains the topic release transaction writes the topic release transaction into the blockchain based on the consensus mechanism between the nodes.
根据本说明书实施例的第5方面,提供一种基于区块链的解答代码发布系统,包括由多个节点组成的区块链网络;According to a fifth aspect of the embodiments of the present specification, there is provided a blockchain-based solution code issuing system, including a blockchain network composed of multiple nodes;
任一节点,获取编程题目;所述目标节点为区块链网络中的任一节点,所述编程题目是通过上述第1方面的方法发布的;将所述编程题目提供给被测试用户进行解答,并 接收所述被测试用户上传的解答代码;基于解答相关数据,构建解答发布交易,并向所述区块链网络广播所述解答发布交易;其中,所述解答相关数据包括所述编程题目的题目标识、所述解答代码与所述被测试用户的用户标识;Get a programming question at any node; the target node is any node in the blockchain network, and the programming question is issued through the method of the first aspect above; provide the programming question to the tested user for answering , And receive the answer code uploaded by the tested user; based on the answer-related data, construct an answer release transaction, and broadcast the answer release transaction to the blockchain network; wherein, the answer-related data includes the programming topic Title identification, the answer code and the user identification of the tested user;
获得所述解答发布交易的每个节点,基于各节点之间的共识机制,将所述解答发布交易写入区块链。Each node that obtains the answer release transaction writes the answer release transaction into the blockchain based on the consensus mechanism between the nodes.
根据本说明书实施例的第6方面,提供一种基于区块链的解答代码检验系统,包括由多个节点组成的区块链网络;According to a sixth aspect of the embodiments of the present specification, there is provided a blockchain-based solution code verification system, including a blockchain network composed of multiple nodes;
检验节点,获取编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识,所述编程题目是通过上述第1方面的方法发布的,所述解答代码是通过上述第2方面的方法发布的,所述检验节点是区块链网络中,存储有所述编程题目对应的解答检验数据的节点;使用存储的对应于所述编程题目的解答检验数据,检验所述解答代码;若检验通过,则基于结果相关数据,构建结果发布交易,并向所述区块链网络广播所述结果发布交易;其中,所述结果相关数据包括所述编程题目的题目标识与所述用户标识;Check the node to obtain the answer code corresponding to the programming question and the user ID of the user under test who uploaded the answer code. The programming question was issued through the method of the first aspect above, and the answer code was passed through the second aspect above Issued by the method, the verification node is a node in the blockchain network that stores the solution verification data corresponding to the programming problem; use the stored solution verification data corresponding to the programming problem to verify the solution code; if If the test passes, the result release transaction is constructed based on the result-related data, and the result release transaction is broadcast to the blockchain network; wherein, the result-related data includes the title identification of the programming topic and the user identification;
获得所述结果发布交易的每个节点,基于各节点之间的共识机制,将所述结果发布交易写入区块链。Each node that obtains the result publishing transaction writes the result publishing transaction into the blockchain based on the consensus mechanism between the nodes.
本说明书实施例所提供的技术方案,任一IT机构的设备可以接入区块链网络称为节点。在区块链网络中,任一节点可以基于区块链协议,发布自身创设的编程题目,也就是说,任一节点可以基于自身创设的编程题目构建题目发布交易,然后把题目发布交易广播给其他节点。获得题目发布交易每个节点会基于各节点间的共识机制,将题目发布交易写入区块链。如此,一方面,任一IT机构都可以将自身创设的编程题目共享给其他IT机构;另一方面,任一节点发布编程题目的流程受到区块链协议的制约,编程题目从被创设到被写入区块链的整个过程中,难以被篡改,编程题目被写入区块链之后,也是难以被篡改的。In the technical solution provided by the embodiments of this specification, the equipment of any IT organization can be connected to the blockchain network and called a node. In a blockchain network, any node can publish a programming topic created by itself based on the blockchain protocol, that is, any node can build a topic publishing transaction based on the programming topic created by itself, and then broadcast the topic publishing transaction to Other nodes. Each node that obtains the topic release transaction will write the topic release transaction into the blockchain based on the consensus mechanism among the nodes. In this way, on the one hand, any IT organization can share the programming problems created by itself to other IT organizations; on the other hand, the process for any node to issue programming problems is restricted by the blockchain protocol, and the programming problems are created from being created to being During the entire process of writing to the blockchain, it is difficult to be tampered with. After the programming problem is written to the blockchain, it is also difficult to be tampered with.
此外,在本说明书实施例中,任一节点可以从各节点间共享的编程题目中抽取编程题目提供给被测试用户解答,以对所述被测试用户的编程水平进行测试。并且,被测试用户上传的解答代码也会被封装进解答发布交易写入到区块链进行公示。In addition, in the embodiment of the present specification, any node may extract programming questions from the programming questions shared among the nodes and provide the tested user with answers to test the programming level of the tested user. In addition, the answer code uploaded by the tested user will also be encapsulated into the answer release transaction and written to the blockchain for publicity.
还有,在本说明书实施例中,针对任一节点,如果该节点存储有某个编程题目对应的解答检验数据,那么,该节点还可以对被测试用户针对该编程题目给出的解答代码进行检验,以判断被测试用户是否通过测试。并且,如果被测试用户通过测试,则该节点 也会构建结果发布交易并广播,以便将被测试用户通过测试的消息写入区块链进行公示。In addition, in the embodiment of this specification, for any node, if the node stores the answer verification data corresponding to a programming problem, then the node can also perform the answer code given by the user under test for the programming problem. Check to determine whether the user under test passes the test. In addition, if the tested user passes the test, the node will also construct the result release transaction and broadcast it, so that the message of the tested user passing the test will be written into the blockchain for publicity.
可见,本发明实际上提供了一种基于区块链的编程水平测试方案,囊括了编程题目发布、解答代码发布以及解答代码检验等阶段,将IT机构创设的编程题目、被测试用户针对编程题目的解答记录以及被测试用户通过测试的结果都写入区块链进行公示,使得整个编程水平测试过程公开透明。It can be seen that the present invention actually provides a blockchain-based programming proficiency testing solution, which includes the stages of programming problem release, code answering release, and code answering verification. The answer records and the results of the tested users passing the test are written on the blockchain for publicity, making the entire programming level test process open and transparent.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本说明书实施例。It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and do not limit the embodiments of this specification.
此外,本说明书实施例中的任一实施例并不需要达到上述的全部效果。In addition, any one of the embodiments of this specification does not need to achieve all the above-mentioned effects.
附图说明BRIEF DESCRIPTION
为了更清楚地说明本说明书实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据这些附图获得其他的附图。In order to more clearly explain the embodiments of the present specification or the technical solutions in the prior art, the following will briefly introduce the drawings required in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only These are some of the embodiments described in the embodiments of this specification, and those of ordinary skill in the art can also obtain other drawings based on these drawings.
图1是本说明书实施例提供的一种基于区块链的编程题目发布方法的流程示意图;FIG. 1 is a schematic flowchart of a method for publishing a programming topic based on a blockchain provided by an embodiment of this specification;
图2是本说明书实施例提供的一种基于区块链的解答代码发布方法的流程示意图;2 is a schematic flowchart of a method for issuing a solution code based on a blockchain provided by an embodiment of this specification;
图3是本说明书实施例提供的一种基于区块链的解答代码检验方法的流程示意图;FIG. 3 is a schematic flowchart of a method for verifying a solution code based on a blockchain provided by an embodiment of this specification;
图4是本说明书实施例提供的一种并行化的执行区块链交易的方法的流程示意图;4 is a schematic flowchart of a parallel method for executing a blockchain transaction provided by an embodiment of this specification;
图5是现有技术中串行化的交易执行方式示意图;5 is a schematic diagram of a serialized transaction execution method in the prior art;
图6是本说明书实施例提供的并行化的交易执行方式示意图;6 is a schematic diagram of a parallel transaction execution method provided by an embodiment of this specification;
图7本说明书实施例还对应提供了一种基于区块链的编程题目发布装置的结构示意图;FIG. 7 also provides a block diagram of a block-based programming issue issuing device according to an embodiment of this specification;
图8本说明书实施例还对应提供了一种基于区块链的解答代码发布装置的结构示意图;FIG. 8 also provides a block diagram of a block-based solution code issuing device corresponding to the embodiment of this specification;
图9本说明书实施例还对应提供了一种基于区块链的解答代码检验装置的结构示意图;FIG. 9 also provides a structural schematic diagram of an answer code verification device based on a blockchain corresponding to an embodiment of this specification;
图10是本说明书实施例提供的一种基于区块链的编程水平测试系统的流程示意图;10 is a schematic flowchart of a programming level test system based on blockchain provided by an embodiment of this specification;
图11是用于配置本说明书实施例方法的一种计算机设备的结构示意图。FIG. 11 is a schematic structural diagram of a computer device for configuring the method of the embodiment of the present specification.
具体实施方式detailed description
此处先对本发明所应用的业务场景(即编程水平测试)进行更为详细的说明。以信息技术公司A为例,倘若公司A想要了解某个用户(如员工、面试者)的编程水平,那么,公司A可以从自己的编程题库中抽取任一编程题目提供给该用户。该用户根据该编程题目进行作答,给出解答该编程题目的解答代码,并将解答代码上传给公司A的在线判题系统。公司A的在线判题系统存储有上述编程题库中每个编程题目对应的解答检验数据(具体是标准输入数据与标准输出数据),用于验证解答代码的正确性。具体地,公司A的在线判题系统会将该编程题目对应的标准输入数据输入到解答代码并运行解答代码,然后,判断解答代码是否能够输出该编程题目对应的标准输出数据,若是,则认定该用户通过测试,否则,认定该用户未通过测试。Here, the business scenario (ie, programming level test) applied by the present invention will be described in more detail first. Taking information technology company A as an example, if company A wants to understand the programming level of a certain user (eg, employee, interviewer), then company A can extract any programming topic from its programming question bank and provide it to the user. The user answers according to the programming question, gives an answer code to answer the programming question, and uploads the answer code to company A's online judgment system. Company A's online judgment system stores the answer test data (specifically, standard input data and standard output data) corresponding to each programming question in the above programming question bank, which is used to verify the correctness of the answer code. Specifically, the online question judgment system of Company A will input the standard input data corresponding to the programming question into the answer code and run the answer code, and then determine whether the answer code can output the standard output data corresponding to the programming question. The user passed the test, otherwise, the user is deemed to have failed the test.
实践中,很多IT机构有共享彼此的编程题库的需求。为此,现有技术中,针对任一IT机构,该IT机构一般会采用爬虫程序从其他IT机构的编程题库爬取编程题目,将爬取的编程题目提供给被测试用户进行解答。然后,该IT机构还需要将被测试用户给出的解答代码发送给创设该编程题目的IT机构的在线判题系统进行检验。In practice, many IT organizations have a need to share each other's programming question banks. For this reason, in the prior art, for any IT organization, the IT organization generally uses a crawler program to crawl programming questions from the programming question bank of other IT institutions, and provides the crawled programming questions to the tested user for answers. Then, the IT institution also needs to send the answer code given by the tested user to the online question-finding system of the IT institution that created the programming question for verification.
然而,这种方式存在如下弊端:However, this approach has the following disadvantages:
1、IT机构通过爬虫程序爬取其他IT机构的编程题目后,有时会擅自对编程题目进行一些不恰当的修改,这一方面不能很好的保护创设编程题目的IT机构的权益,另一方面,被测试用户针对修改后的编程题目给出的解答代码往往与修改前的编程题目并不匹配,而在线判题系统是使用适配于修改前的编程题目的解答检验数据来测试代码是否正确的,如此,导致测试结果不能准确反映被测试用户的编程水平。1. After the IT organization crawls the programming problems of other IT organizations through the crawler program, sometimes it will make some inappropriate modifications to the programming problem without authorization. This aspect cannot protect the rights and interests of the IT organization that created the programming problem. On the other hand , The answer code given by the tested user for the modified programming problem often does not match the modified programming problem, and the online judgment system uses the answer test data adapted to the modified programming problem to test whether the code is correct As such, the test results cannot accurately reflect the programming level of the user under test.
2、一旦其他IT机构的数据库不可访问,该IT机构就无法通过爬虫程序爬取其他结构的编程题目。也就是说,这种共享编程题目的方式并不总是有效的。2. Once the databases of other IT organizations are inaccessible, the IT organization cannot crawl other programming topics through the crawler program. In other words, this way of sharing programming topics is not always effective.
为此,在本说明书实施例中,任一IT机构可以借助于区块链协议,将自己创设的编程题目发布到区块链中,相当于既将自己创设的编程题目共享给其他IT机构,又无需担心其他IT机构会对该编程题目进行修改。For this reason, in the embodiment of this specification, any IT organization can use the blockchain protocol to publish the programming problems created by itself to the blockchain, which is equivalent to sharing the programming problems created by itself to other IT organizations. There is no need to worry that other IT organizations will modify the programming topic.
为了使本领域技术人员更好地理解本说明书实施例中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行详细地描述,显然,所描述 的实施例仅仅是本说明书的一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于保护的范围。In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present specification, the technical solutions in the embodiments of the present specification will be described in detail in conjunction with the drawings in the embodiments of the present specification. Obviously, the described implementation Examples are only a part of the embodiments of this specification, but not all the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art should fall within the scope of protection.
以下结合附图,详细说明本说明书各实施例提供的技术方案。The technical solutions provided by the embodiments of this specification will be described in detail below in conjunction with the drawings.
图1是本说明书实施例提供的一种基于区块链的编程题目发布方法的流程示意图,包括以下步骤:FIG. 1 is a schematic flowchart of a blockchain-based programming topic publishing method provided by an embodiment of this specification, including the following steps:
S100:目标节点创设待发布的编程题目。S100: The target node creates a programming problem to be released.
在本说明书实施例中,各IT机构的设备可以接入区块链网络,成为区块链网络中的节点。也就是说,区块链网络中的各节点与想要彼此共享编程题目的各IT机构一一对应。In the embodiment of this specification, the equipment of each IT organization can be connected to the blockchain network and become a node in the blockchain network. That is to say, each node in the blockchain network corresponds to each IT organization that wants to share programming issues with each other.
在步骤S100中,所述目标节点可以是区块链网络中的任一节点。也就是说,任一IT机构的设备都可以通过图1所示的方法,创设编程题目并发布。In step S100, the target node may be any node in the blockchain network. That is to say, the equipment of any IT organization can create and publish programming problems through the method shown in FIG. 1.
需要说明的是,目标节点创设编程题目,具体可以是目标节点接收控制所述目标节点的IT机构上传的编程题目,也可以是目标节点根据预设的编程题目创设模型,自动创设编程题目。It should be noted that the target node creates a programming problem, which may specifically be that the target node receives a programming problem uploaded by an IT institution that controls the target node, or the target node may automatically create a programming problem according to a preset programming model.
S102:所述目标节点基于题目相关数据,构建题目发布交易。S102: The target node constructs a topic release transaction based on topic related data.
需要说明的是,本文中所述的交易(transaction),是指区块链协议中指定的数据结构。在区块链协议中,交易是指节点通过安装的区块链客户端创建,并需要最终写入区块链的一笔数据。也就是说,根据区块链协议,凡是需要写入区块链进行公示的数据,都需要被封装成交易这种数据结构。It should be noted that the transaction described in this article refers to the data structure specified in the blockchain protocol. In the blockchain protocol, a transaction refers to a node that is created by the installed blockchain client and needs to finally write a piece of data on the blockchain. In other words, according to the blockchain protocol, all data that needs to be written into the blockchain for publicity needs to be encapsulated into a transaction data structure.
在步骤S102中,所述题目相关数据至少包括目标节点在步骤S100中创设的编程题目。所述目标节点基于所述题目相关数据构建题目发布交易,实际上是将所述题目相关数据封装进交易这一区块链协议指定的数据结构。In step S102, the topic-related data includes at least the programming topic created by the target node in step S100. The target node constructs a topic release transaction based on the topic-related data, and actually encapsulates the topic-related data into a transaction, a data structure specified by the blockchain protocol.
S104:所述目标节点向所述区块链网络广播所述题目发布交易。S104: The target node broadcasts the topic release transaction to the blockchain network.
在步骤S104中,目标节点向区块链网络广播所述题目发布交易,实际上是将所述题目发布交易广播给其他节点,相当于将所述编程题目,分享给其他节点。In step S104, the target node broadcasts the topic publishing transaction to the blockchain network, in fact, broadcasting the topic publishing transaction to other nodes, which is equivalent to sharing the programming topic to other nodes.
S106:针对获得所述题目发布交易的每个节点,该节点基于各节点之间的共识机制,将所述题目发布交易写入区块链。S106: For each node that obtains the topic publishing transaction, the node writes the topic publishing transaction into the blockchain based on the consensus mechanism between the nodes.
针对获得所述题目发布交易的每个节点,该节点在将所述题目发布交易写入区块链 之前,可以针对所述题目发布交易进行合法性验证。For each node that obtains the topic publishing transaction, the node can verify the legality of the topic publishing transaction before writing the topic publishing transaction into the blockchain.
针对所述题目发布交易进行合法性验证的事项可以根据业务需要指定。例如,假设并不是每个节点都有发布编程题目的权限,那么,可以所述题目发布交易中的节点标识,判断所述节点标识对应的节点(即目标节点)是否具有发布编程题目的权限,如果没有权限,就拒绝将所述题目发布交易写入区块链。The items for verifying the legality of the issue publishing transaction can be specified according to business needs. For example, assuming that not every node has the authority to publish programming topics, it is possible to publish the node identifier in the title issue transaction to determine whether the node corresponding to the node identifier (ie, the target node) has the authority to issue programming topics If there is no authority, it refuses to write the issue publishing transaction into the blockchain.
在步骤S106中,各节点之间的共识机制确保了各节点每次向区块链写入的数据的一致性。因此,哪怕某个节点擅自对题目发布交易中封装的编程题目进行修改,从而改变所述题目发布交易的内容,修改后的题目发布交易也不会被大多数节点写入区块链。In step S106, the consensus mechanism between each node ensures the consistency of the data written by each node to the blockchain each time. Therefore, even if a node modifies the programming topic encapsulated in the topic publishing transaction without authorization, thereby changing the content of the topic publishing transaction, the modified topic publishing transaction will not be written into the blockchain by most nodes.
如此,目标节点创设的编程题目总是可以不经修改地被写入区块链,从而完成编程题目的分享。并且,区块链的分布式存储特性,写入区块链之后的题目发布交易也是难以被篡改的。In this way, the programming problems created by the target node can always be written into the blockchain without modification, so as to complete the sharing of programming problems. In addition, the distributed storage feature of the blockchain is difficult to be tampered with.
需要说明的是,针对后文中将要出现的解答发布交易、结果发布交易,基于同样的原因,这些交易的内容也难以被篡改。It should be noted that, for the answer release transaction and result release transaction that will appear later, for the same reason, the content of these transactions is also difficult to be tampered with.
通过图1所示的方法,任一IT机构的设备可以接入区块链网络称为节点。在区块链网络中,任一节点可以基于区块链协议,发布自身创设的编程题目,也就是说,任一节点可以基于自身创设的编程题目构建题目发布交易,然后把题目发布交易广播给其他节点。获得题目发布交易每个节点会基于各节点间的共识机制,将题目发布交易写入区块链。如此,一方面,任一IT机构都可以将自身创设的编程题目共享给其他IT机构;另一方面,任一节点发布编程题目的流程受到区块链协议的制约,编程题目从被创设到被写入区块链的整个过程中,难以被篡改,编程题目被写入区块链之后,也是难以被篡改的。Through the method shown in Figure 1, any IT organization's equipment can access the blockchain network called a node. In a blockchain network, any node can publish a programming topic created by itself based on the blockchain protocol, that is, any node can build a topic publishing transaction based on the programming topic created by itself, and then broadcast the topic publishing transaction to Other nodes. Each node that obtains the topic release transaction will write the topic release transaction into the blockchain based on the consensus mechanism among the nodes. In this way, on the one hand, any IT organization can share the programming problems created by itself to other IT organizations; on the other hand, the process for any node to issue programming problems is restricted by the blockchain protocol, and the programming problems are created from being created to being During the entire process of writing to the blockchain, it is difficult to be tampered with. After the programming problem is written to the blockchain, it is also difficult to be tampered with.
此外,在本说明书实施例中,所述题目相关数据还可以包括目标节点的节点标识。这意味着,目标节点也会将自身的节点标识封装进题目发布交易,进而写入区块链中进行公示。如此,可以明确共享给各IT机构的每个编程题目的创设者,保护创设编程题目的IT机构的权益。In addition, in the embodiment of the present specification, the topic-related data may further include the node identifier of the target node. This means that the target node will also encapsulate its own node ID into the topic release transaction, and then write it into the blockchain for publicity. In this way, it is possible to clearly share the creator of each programming topic of each IT organization, and protect the rights and interests of the IT organization that created the programming topic.
另外,在实际应用中,由于区块链这种数据存储方式较为复杂,节点当想要从写入区块链的编程题目中调取某个编程题目时,操作较为复杂。In addition, in practical applications, due to the complexity of the data storage method such as blockchain, the operation of the node is more complicated when it wants to retrieve a programming problem from the programming problems written in the blockchain.
为此,在本说明书实施例中,针对获得所述题目发布交易的每个节点,该节点可以在创建题目存储地址,并将所述题目相关数据存入所述题目存储地址。这相当于还将编 程题目以简单的存储方式进行存储。需要说明的是,针对任一题目发布交易,可以根据写入区块链的该题目发布交易,验证存入题目存储地址的编程题目是否被篡改。通过上述方式,节点当想要调取某个编程题目时,可以较为便捷。For this reason, in the embodiment of the present specification, for each node that obtains the topic issue transaction, the node may create a topic storage address and store the topic-related data in the topic storage address. This is equivalent to storing programming topics in a simple storage manner. It should be noted that if a transaction is issued for any topic, the transaction can be issued based on the topic written in the blockchain to verify whether the programming topic stored in the topic storage address has been tampered with. In the above way, the node can be more convenient when it wants to call up a programming topic.
进一步地,节点具体可以将封装有所述题目相关数据的题目智能合约存入所述题目存储地址。这种情况下,所述题目存储地址实际上是所述题目智能合约的合约标识。Further, the node may specifically store the title smart contract encapsulated with the title-related data in the title storage address. In this case, the title storage address is actually the contract identifier of the title smart contract.
智能合约是很多区块链协议(如以太坊)天然支持的数据结构,并且,很多区块链协议也天然支持智能合约的快速调用。因此,可以以智能合约这种数据结构,对编程题目进行存储,方便后续通过调用智能合约的形式,快速调取编程题目进行编程水平测试。Smart contracts are data structures that are naturally supported by many blockchain protocols (such as Ethereum), and many blockchain protocols also naturally support the rapid invocation of smart contracts. Therefore, it is possible to store programming topics in the form of a data structure such as a smart contract, which is convenient for subsequent retrieval of programming topics for programming level testing by calling a smart contract.
根据图1所示的编程题目发布方法,本说明书实施例进一步提供了一种基于区块链的解答代码发布方法,如图2所示,包括以下步骤:According to the method for publishing programming questions shown in FIG. 1, the embodiment of this specification further provides a method for issuing answer codes based on blockchain. As shown in FIG. 2, it includes the following steps:
S200:目标节点获取编程题目。S200: The target node obtains the programming problem.
所述目标节点是区块链网络中的任一节点。在实际应用中,任一IT机构想要对被测试用户的编程水平进行测试时,可以触发自身控制的目标节点获取编程题目。目标节点获取的编程题目是基于图1所示的编程题目发布方法发布的。The target node is any node in the blockchain network. In practical applications, when any IT organization wants to test the programming level of the user under test, it can trigger a target node controlled by itself to obtain programming problems. The programming topic acquired by the target node is issued based on the programming topic release method shown in FIG. 1.
具体地,目标节点可以从区块链中的任一题目发布交易中读取编程题目。Specifically, the target node can read the programming topic from any topic publishing transaction in the blockchain.
或者,如果所述题目发布交易所封装的题目相关数据也被存入了某个题目存储地址,那么,目标节点也可以从该题目存储地址获取所述编程题目。当采用这种方式获取编程题目时,较为快捷。Or, if the topic-related data packaged by the topic publishing exchange is also stored in a topic storage address, then the target node may also obtain the programming topic from the topic storage address. When using this method to obtain programming topics, it is faster.
进一步地,如果所述题目相关数据是以智能合约的形式(即题目智能合约)存入该题目存储地址的,所述目标节点可以调用该题目智能合约,从而获取到所述编程题目。Further, if the topic-related data is stored in the topic storage address in the form of a smart contract (that is, a topic smart contract), the target node can call the topic smart contract to obtain the programming topic.
S202:所述目标节点将所述编程题目提供给被测试用户进行解答,并接收所述被测试用户上传的解答代码。S202: The target node provides the programming problem to the tested user for answering, and receives the answer code uploaded by the tested user.
S204:所述目标节点基于解答相关数据,构建解答发布交易。S204: The target node constructs an answer release transaction based on the answer-related data.
在本说明书实施例中,所述解答相关数据至少包括所述编程题目的题目标识、所述解答代码与所述被测试用户的用户标识。In the embodiment of the present specification, the solution-related data includes at least the title identification of the programming topic, the solution code, and the user identification of the user under test.
其中,若所述目标节点从区块链中的任一题目发布交易中读取编程题目,则所述编程题目的题目标识为所述题目发布交易的交易哈希;若所述目标节点从任一题目存储地址获取编程题目,则所述编程题目的题目标识为所述存储地址。Wherein, if the target node reads the programming topic from any topic publishing transaction in the blockchain, the topic identification of the programming topic is the transaction hash of the topic publishing transaction; if the target node If a program storage address is used to obtain a programming problem, the problem of the programming problem is identified as the storage address.
进一步地,所述目标节点可以对所述解答代码是否存在编译或运行问题进行检查,如果检查通过,才会构建解答发布交易,如果检查不通过,则拒绝构建解答发布交易。Further, the target node may check whether there is a compilation or running problem in the answer code. If the check passes, the answer release transaction will be constructed. If the check fails, the answer release transaction will be rejected.
S206:所述目标节点向所述区块链网络广播所述解答发布交易。S206: The target node broadcasts the solution release transaction to the blockchain network.
S208:针对获得所述解答发布交易的每个节点,该节点基于各节点之间的共识机制,将所述解答发布交易写入区块链。S208: For each node that obtains the answer release transaction, the node writes the answer release transaction into the blockchain based on the consensus mechanism between the nodes.
针对获得所述解答发布交易的每个节点,该节点在将所述解答发布交易写入区块链之前,可以针对所述解答发布交易进行合法性验证。For each node that obtains the answer release transaction, the node may verify the validity of the answer release transaction before writing the answer release transaction into the blockchain.
针对所述解答发布交易进行合法性验证的事项可以根据业务需要指定。例如,假设预先规定有解答代码的格式,那么,可以对所述解答发布交易中的解答代码的格式进行验证,如果格式不符合要求,就拒绝将所述解答发布交易写入区块链。The matters for verifying the legality of the answering issue transaction can be specified according to business needs. For example, assuming that the format of the answer code is specified in advance, the format of the answer code in the answer publishing transaction can be verified, and if the format does not meet the requirements, the answer publishing transaction is refused to be written into the blockchain.
在步骤S208中,相当于将被测试用户的身份信息、被测试用户所解答的编程题目的标识信息、被测试用户给出的解答代码公示给每个节点。In step S208, it is equivalent to publicize to each node the identity information of the tested user, the identification information of the programming question answered by the tested user, and the answer code given by the tested user.
此外,为了方便节点可以快速调取被测试用户的解答代码进行检验,在本说明书实施例中,每个节点还可以创建解答存储地址,并将所述解答相关数据存入所述解答存储地址。In addition, in order to facilitate the node to quickly retrieve the answer code of the user under test for verification, in the embodiment of this specification, each node may also create a solution storage address, and store the solution-related data in the solution storage address.
进一步地,每个节点可以将封装有所述解答相关数据的解答智能合约存入所述解答存储地址。Further, each node may store a solution smart contract encapsulated with the solution-related data in the solution storage address.
根据图1所示的编程题目发布方法与图2所示的解答代码发布方法,本说明书实施例进一步提供了一种基于区块链的解答代码检验方法,如图3所示,包括以下步骤:According to the method for issuing programming questions shown in FIG. 1 and the method for issuing answer codes shown in FIG. 2, the embodiment of this specification further provides a method for verifying the answer codes based on blockchain.
S300:检验节点获取编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识。S300: The verification node obtains the answer code corresponding to the programming problem and the user identification of the user under test who uploaded the answer code.
在本说明书实施例中,所述检验节点存储有所述编程题目对应的解答检验数据的节点。所述解答检验数据是用于对解答所述编程题目所给出的解答代码的正确性进行检验的数据。如前文所述,所述解答检验数据一般包括标准输入数据与标准输出数据。In the embodiment of the present specification, the verification node stores a node that answers verification data corresponding to the programming problem. The answer verification data is data for verifying the correctness of the answer code given to answer the programming problem. As mentioned above, the solution verification data generally includes standard input data and standard output data.
所述检验节点一般是创设所述编程题目的节点。当然,创设所述编程题目的节点也可以将所述编程题目对应的解答检验数据分发给至少一个其他节点。这样,所述检验节点也可以是除创设所述编程题目的节点之外,存储有所述解答检验数据的其他节点。The verification node is generally a node that creates the programming problem. Of course, the node that created the programming problem may also distribute the solution verification data corresponding to the programming problem to at least one other node. In this way, the verification node may be another node that stores the solution verification data in addition to the node that created the programming problem.
在本说明书实施例中,检验节点可以根据存储的任一解答检验数据,确定该解答检 验数据对应的题目标识。然后,从区块链中的查询出包含所述题目标识的解答发布交易,并从所述解答发布交易中读取解答代码与用户标识。In the embodiment of the present specification, the verification node may determine the question identification corresponding to the answer test data based on any stored answer test data. Then, from the query in the blockchain, a solution publishing transaction containing the title identification is found, and the solution code and the user identification are read from the solution publishing transaction.
进一步地,检验节点也可以查询存储有所述题目标识的解答存储地址,并从所述解答存储地址获取解答代码与用户标识。Further, the verification node may also query the solution storage address where the question identification is stored, and obtain the solution code and the user identification from the solution storage address.
更进一步地,检验节点可以查询封装有所述题目标识的题目智能合约,并调用所述题目智能合约,从而获取到相应的解答代码与用户标识。Furthermore, the verification node may query a topic smart contract encapsulated with the topic identification, and call the topic smart contract to obtain the corresponding answer code and user identification.
S302:所述检验节点使用存储的对应于所述编程题目的解答检验数据,检验所述解答代码。S302: The verification node verifies the solution code using the stored solution verification data corresponding to the programming problem.
S304:若检验通过,则所述检验节点基于结果相关数据,构建结果发布交易。S304: If the verification is passed, the verification node constructs a result release transaction based on the result-related data.
在本说明书实施例中,检验节点如果对所述解答代码检验通过,则可以将检验通过的消息公示于区块链。这种情况下,所述结果相关数据实际上包括所述编程题目的题目标识与所述用户标识,所述结果发布交易的含义为,举例来说,“用户张三答对了题目1”。In the embodiment of the present specification, if the verification node passes the answer code verification, it can publish the message of the verification to the blockchain. In this case, the result-related data actually includes the title ID of the programming topic and the user ID. The meaning of the result release transaction is, for example, "user Zhang San answered the correct topic 1".
进一步地,检验节点如果对所述解答代码检验未通过,则也可以将检验未通过的消息公示于区块链。这种情况下,所述结果发布交易的含义既可以是检验通过,也可以是检验未通过。为了进行区分,所述结果相关数据还需要包括检验通过结果或检验未通过结果。Further, if the verification node fails the verification of the answer code, it may also publish the message that the verification failed on the blockchain. In this case, the result release transaction may mean that the test passed or failed. In order to distinguish, the result-related data also needs to include a test passed result or a test failed result.
S306:向所述区块链网络广播所述结果发布交易。S306: Broadcast the result release transaction to the blockchain network.
S308:针对获得所述结果发布交易的每个节点,该节点基于各节点之间的共识机制,将所述结果发布交易写入区块链。S308: For each node that obtains the result publishing transaction, the node writes the result publishing transaction into the blockchain based on the consensus mechanism between the nodes.
针对获得所述结果发布交易的每个节点,该节点在将所述题目发布交易写入区块链之前,可以针对所述结果发布交易进行合法性验证。For each node that obtains the result publishing transaction, the node may verify the validity of the result publishing transaction before writing the topic publishing transaction into the blockchain.
针对所述结果发布交易进行合法性验证的事项可以根据业务需要指定。例如,假设只有创设所述编程题目的节点才有权限检验所述编程题目对应的解答代码,那么,可以判断广播所述结果发布交易的检验节点是否有检验权限,如果没有权限,就拒绝将所述结果发布交易写入区块链。The matters for verifying the legality of the transaction for issuing the result can be specified according to business needs. For example, assuming that only the node that created the programming topic has the authority to verify the answer code corresponding to the programming topic, it can be determined whether the verification node that broadcasts the result release transaction has the verification authority. The results are published and the transaction is written to the blockchain.
在步骤S308中,相当于将被测试用户的身份信息、被测试用户所解答的编程题目的标识信息、被测试用户是否通过测试的结果公示给每个节点。In step S308, it is equivalent to publicize to each node the identity information of the tested user, the identification information of the programming question answered by the tested user, and the result of whether the tested user passed the test.
此外,为了方便节点可以快速调取被测试用户的测试结果进行查阅,在本说明书实施例中,每个节点还可以创建结果存储地址,并将所述结果相关数据存入所述结果存储地址。In addition, in order to facilitate the node to quickly retrieve the test result of the user under test for reference, in the embodiment of this specification, each node may also create a result storage address and store the result-related data in the result storage address.
进一步地,每个节点可以将封装有所述结果相关数据的结果智能合约存入所述结果存储地址。Further, each node may store the result smart contract encapsulated with the result related data in the result storage address.
另外,在实践中,所述被测试用户可能会解答不止一个编程题目,上传不止一个解答代码。这种情况下,针对每个节点,该节点可以将所述被测试用户解答多个编程题目的结果都存入同一个结果存储地址,方便统计与查阅。In addition, in practice, the user under test may answer more than one programming question and upload more than one answer code. In this case, for each node, the node can store the results of the tested user in solving multiple programming problems into the same result storage address, which is convenient for statistics and reference.
具体地,在本说明书实施例中,针对获得所述结果发布交易的每个节点,该节点若获得与所述结果发布交易相关联的其他结果发布交易,则基于各节点之间的共识机制,将所述其他结果发布交易写入区块链,其中,所述其他结果发布交易是基于所述用户标识与其他题目标识构建的。然后,该节点根据所述其他结果发布交易,将所述其他题目标识存入所述结果存储地址。Specifically, in the embodiment of this specification, for each node that obtains the result publishing transaction, if the node obtains other result publishing transactions associated with the result publishing transaction, it is based on the consensus mechanism between the nodes, The other result publishing transaction is written into the blockchain, wherein the other result publishing transaction is constructed based on the user identification and other topic identifications. Then, the node issues a transaction based on the other results, and stores the other topic identifiers in the result storage address.
也就是说,所述结果发布交易可以视为所述被测试用户解答的第一个编程题目所产生的,而其他结果发布交易可以视为所述被测试用户后续解答的其他编程题目所产生的。对于所述被测试用户后续解答的其他编程题目的结果,无需重新创建结果存储地址进行存储,而是直接将其存入之前创建的结果存储地址即可。That is to say, the result publishing transaction can be regarded as generated by the first programming question answered by the tested user, and the other result publishing transaction can be regarded as generated by other programming questions subsequently answered by the tested user . For the results of other programming problems that the tested user will subsequently answer, there is no need to recreate the result storage address for storage, but directly store it in the previously created result storage address.
如此,每个被测试用户都有唯一对应于自己的结果存储地址,用于记录自己的答题情况。In this way, each user under test has a unique storage address corresponding to his own, which is used to record his / her answers.
另外需要说明的是,在图1所示的方法中,可能存在不止一个检验节点检验所述解题代码的情况。这种情况下,针对每个检验节点,该检验节点获取编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识;然后使用存储的对应于所述编程题目的解答检验数据,检验所述解答代码;若对所述解答代码检验通过,则基于结果相关数据,构建结果发布交易,并向所述区块链网络广播所述结果发布交易。In addition, it should be noted that, in the method shown in FIG. 1, there may be cases where more than one check node checks the problem-solving code. In this case, for each verification node, the verification node obtains the answer code corresponding to the programming question and the user ID of the user under test uploading the answer code; then uses the stored answer verification data corresponding to the programming question, Verify the answer code; if the answer code is verified, construct a result release transaction based on the result-related data, and broadcast the result release transaction to the blockchain network.
基于此,针对每个节点,该节点可以当确定获得的结果发布交易的数量为指定数量时,才会基于各节点之间的共识机制,将获得的任一结果发布交易写入区块链。其中,所述指定数量不大于检验节点的数量。Based on this, for each node, when the node determines that the number of obtained result publishing transactions is the specified number, it will write any obtained result publishing transactions into the blockchain based on the consensus mechanism between the nodes. Wherein, the specified number is not greater than the number of inspection nodes.
另外,在本说明书实施例中,存在三种类型的交易,即题目发布交易、解答发布交易以及结果发布交易。其中,针对任一种交易,创建存储地址并存入该种交易所封 装的相关数据,可以视为对该种交易的执行操作。In addition, in the embodiment of the present specification, there are three types of transactions, namely, a topic issue transaction, an answer issue transaction, and a result issue transaction. Among them, for any type of transaction, creating a storage address and storing relevant data encapsulated by that type of exchange can be regarded as an execution operation for that type of transaction.
显然,不论针对上述哪种交易,执行该种交易产生的执行结果,仅仅会对一个存储地址产生影响。因此,本说明书实施例中的三种类型的交易,都适合采用下文给出的并行化的交易执行方式进行执行。下文将对这种并行化的交易执行方式进行介绍说明。Obviously, no matter what kind of transaction is mentioned above, the execution result of executing such a transaction will only affect one storage address. Therefore, the three types of transactions in the embodiments of this specification are suitable for execution using the parallel transaction execution method given below. The following will introduce and explain this parallel transaction execution method.
对于常见的区块链应用场景而言,当需要进行各节点间的共识时,各节点会基于共识算法选举出有权限将若干待执行的交易打包成区块的节点,即记账节点。在共识之后,记账节点从缓存中捞取若干待执行的交易打包成区块,并将所述区块广播给其他节点。随后,针对每个节点,该节点一方面会按照所述区块中各交易被发起的先后顺序,由先到后依次执行每个交易,另一方面会将所述区块写入区块链。For common blockchain application scenarios, when consensus among nodes is required, each node will elect a node that has the authority to package several pending transactions into blocks based on the consensus algorithm, that is, an accounting node. After consensus, the accounting node takes a number of transactions to be executed from the cache and packages them into blocks, and broadcasts the blocks to other nodes. Then, for each node, on the one hand, the node will execute each transaction in turn from the first to the last in accordance with the order in which the transactions in the block were initiated, and on the other hand, the block will be written to the blockchain .
通常,将节点由先到后逐个执行区块中的每个交易的方式称为串行化的交易执行方式。之所以要采用这种串行化的交易执行方式,是因为在常见的区块链应用场景下,一笔交易的执行有时会对不止一个存储地址上存储的信息进行更新,如果不采用串行化的交易执行方式,则容易出现有的交易执行失败的情况。Generally, the method of executing each transaction in the block one by one from first to second is called a serialized transaction execution method. The reason why this serialized transaction execution method is adopted is that in common blockchain application scenarios, the execution of a transaction sometimes updates the information stored on more than one storage address. If serialization is not used In the form of transaction execution, it is easy for some transactions to fail.
但是,在有的区块链应用场景下,不存在会对不止一个存储地址上存储的信息进行更新的交易。在这些区块链应用场景下,采用上述的串行化的交易执行方式,会导致交易执行效率较低。However, in some blockchain application scenarios, there are no transactions that update information stored on more than one storage address. In these blockchain application scenarios, adopting the above serialized transaction execution method will result in lower transaction execution efficiency.
下面,以以太坊这种区块链协议为例,对采用串行化的交易执行方式的原因进行详细说明。值得强调的是,在除以太坊之外的其他区块链协议中,采用串行化的交易执行方式的原因也是类似的。The following uses a blockchain protocol such as Ethereum as an example to explain in detail the reasons for the serialized transaction execution method. It is worth emphasizing that in other blockchain protocols besides Ethereum, the reasons for using serialized transaction execution methods are similar.
在以太坊中,存在外部账户与合约账户之分。外部账户用于存储用户拥有的以太币余额,外部账户本质上是存储有余额信息的存储地址。合约账户用于存储用户创设的智能合约,合约账户本质上是存储有智能合约代码的存储地址。In Ethereum, there are external accounts and contract accounts. The external account is used to store the user's Ether balance, and the external account is essentially a storage address where the balance information is stored. The contract account is used to store the smart contract created by the user. The contract account is essentially a storage address where the smart contract code is stored.
在以太坊中,一般有两种类型的交易,即外部账户向其他账户(可以是外部账户也可以是合约账户)的转账交易,以及外部账户创建合约账户的合约创建交易。In Ethereum, there are generally two types of transactions, namely, transfer transactions from external accounts to other accounts (which can be external accounts or contract accounts), and contract creation transactions for external account creation contract accounts.
转账交易的执行一般会对不止一个存储地址上存储的信息进行更新。具体而言,一笔转账交易的执行,通常会改变两个账户的余额(即两个账户地址上存储的余额信息),即从转账账户的余额中扣除转账金额,向收账账户的余额中增加转账金额。一笔转账交易可执行的前提是转账账户的余额不小于转账金额。The execution of transfer transactions generally updates information stored on more than one storage address. Specifically, the execution of a transfer transaction usually changes the balance of the two accounts (that is, the balance information stored on the two account addresses), that is, the transfer amount is deducted from the balance of the transfer account and added to the balance of the collection account Increase the transfer amount. The premise of a transfer transaction is that the balance of the transfer account is not less than the transfer amount.
实际应用中,某一笔转账交易(记为转账交易A)中的转账账户,有可能是之 前的另一笔转账交易(记为转账交易B)中的收账用户。如果不按照交易被发起的顺序由先到后执行交易,那么可能出现如下情况,即转账交易B未执行,导致转账交易A中的转账账户没有充足的余额进行转账。正是因为这样,凡是涉及转账交易的区块链应用场景,都不得不采用串行化的交易执行方式,以保证交易可以顺利执行。In practical applications, the transfer account in a certain transfer transaction (denoted as transfer transaction A) may be the collecting user in another previous transfer transaction (denoted as transfer transaction B). If the transaction is not executed in the order in which the transaction was initiated, then the following situation may occur, that is, the transfer transaction B has not been executed, resulting in the transfer account in the transfer transaction A not having sufficient balance for the transfer. Because of this, all blockchain application scenarios involving transfer transactions have to adopt serialized transaction execution methods to ensure that transactions can be executed smoothly.
而合约创建交易的执行实际上是创建一个合约账户,即创设一个存储地址,并将智能合约代码存入创设的存储地址。显然,合约创建交易的执行只会影响一个存储地址。The execution of the contract creation transaction is actually creating a contract account, that is, creating a storage address, and storing the smart contract code in the created storage address. Obviously, the execution of the contract creation transaction will only affect one storage address.
此外,区块链应用场景是多种多样的,在有的区块链应用场景下,可以基于以太坊进行扩展,开发出新类型的交易,这种交易的执行也可能只会影响一个存储地址。例如,利用区块链进行内容存证。一笔存证交易的执行,本质上是创设一个存储地址,将要存证的内容存入创设的存储地址。In addition, blockchain application scenarios are diverse. In some blockchain application scenarios, it can be expanded based on Ethereum to develop new types of transactions. The execution of such transactions may only affect one storage address. . For example, the use of blockchain for content certification. The execution of a deposit transaction is essentially to create a storage address and store the content to be deposited into the created storage address.
基于以上,本文提出了一种并行化执行区块链交易的方法,专门针对某一类区块链应用场景,在这类区块链场景下,每笔交易的执行结果只会影响一个存储地址。Based on the above, this paper proposes a method for parallel execution of blockchain transactions, specifically for a certain type of blockchain application scenarios. In this type of blockchain scenario, the execution result of each transaction will only affect one storage address. .
图4是本说明书实施例提供的一种并行化执行区块链交易的方法的流程示意图,包括以下步骤:FIG. 4 is a schematic flowchart of a method for executing a blockchain transaction in parallel provided by an embodiment of the present specification, including the following steps:
S400:针对区块链网络中的每个节点,该节点获取待写入区块。S400: For each node in the blockchain network, the node obtains the block to be written.
在本说明书实施例中,所述待写入区块实际上各节点共识之后,由记账节点打包成的区块。记账节点会将所述待写入区块广播给其他节点。众所周知,在区块链协议中,每个节点一方面需要执行待写入区块中的每个交易,另一方面需要将待写入区块写入到区块链中进行公示。所述待写入区块一旦写入区块链中,相当于将待写入区块中的每个交易进行了公示。公示于区块链上的交易可以用来核查相应的交易执行结果是否正确,以防止有节点作恶。In the embodiment of the present specification, after the blocks to be written are actually agreed by all nodes, the blocks packed by the accounting node. The accounting node broadcasts the block to be written to other nodes. As we all know, in the blockchain protocol, on the one hand, each node needs to execute each transaction in the block to be written, on the other hand, it needs to write the block to be written into the blockchain for publicity. Once the block to be written is written into the blockchain, it is equivalent to publicizing each transaction in the block to be written. The transaction published on the blockchain can be used to check whether the corresponding transaction execution result is correct to prevent any node from doing evil.
在步骤S400中,针对每个节点,如果该节点是记账节点,那么该节点获取所述待写入区块的方式具体可以是从自身的缓存中捞取若干交易打包成所述待写入区块;如果该节点不是记账节点,那么该节点获取所述待写入区块的方式具体可以是接收记账节点广播的所述待写入区块。In step S400, for each node, if the node is an accounting node, then the way for the node to obtain the block to be written may specifically be to grab several transactions from its own cache and package it into the area to be written Block; if the node is not an accounting node, then the way for the node to obtain the block to be written may specifically be to receive the block to be written broadcast by the accounting node.
值得强调的是,针对所述待写入区块中的每个交易,该交易的执行结果为,创设一个存储地址并存入信息,或更新一个存储地址上存储的信息(向一个存储地址存入信息或修改一个存储地址上存储的信息)。也就是说,所述待写入区块中的每个交易的 执行结果,只会对一个存储地址产生影响。It is worth emphasizing that for each transaction in the block to be written, the execution result of the transaction is to create a storage address and store the information, or update the information stored on a storage address Enter information or modify the information stored on a storage address). In other words, the execution result of each transaction in the block to be written will only affect one storage address.
例如,创建合约账户的合约创建交易,就是执行结果为创设一个存储地址并存入信息的交易。前文提及的题目发布交易与解答发布交易,也是执行结果为创设一个存储地址并存入信息的交易。For example, a contract creation transaction that creates a contract account is a transaction whose execution result is to create a storage address and deposit information. The issue publishing transaction and answer publishing transaction mentioned above are also the transactions whose execution results are creating a storage address and storing information.
又如,在有些区块链应用场景下,需要对每个用户的购物记录进行存证。那么,就需要在数据库中创设每个用户对应的记录存储地址。当目标用户进行购物时,就会产生一条购物记录,区块链网络中的任一节点会基于该购物记录构建记录存证交易并广播。然后,针对每个节点,该节点会在合适的时机(即该记录存证交易被打包进待写入模块并广播给各节点时)执行该记录存证交易,即将该购物记录存入目标用户对应的记录存储地址。显然,目标用户进行多次购物所产生的多条购物记录都会被存入目标用户对应的记录存储地址。因此,上述的记录存证交易,就是执行结果为更新一个存储地址上存储的信息交易。As another example, in some blockchain application scenarios, each user's shopping record needs to be documented. Then, it is necessary to create a record storage address corresponding to each user in the database. When the target user makes a purchase, a shopping record will be generated, and any node in the blockchain network will build a record and record the transaction based on the shopping record and broadcast it. Then, for each node, the node will execute the record storage transaction at the appropriate time (that is, when the record storage transaction is packaged into the module to be written and broadcast to each node), that is, store the shopping record into the target user Corresponding record storage address. Obviously, multiple shopping records generated by the target user making multiple purchases will be stored in the record storage address corresponding to the target user. Therefore, the above record-storage transaction is the transaction whose execution result is updating the information stored on a storage address.
前文提及的结果发布交易,也是执行结果为更新一个存储地址上存储的信息交易。The results mentioned above issue the transaction, and the execution result is the transaction that updates the information stored on a storage address.
S402:从所述待写入区块中读取各交易,并将各交易组织成N个交易队列。S402: Read each transaction from the block to be written, and organize each transaction into N transaction queues.
在现有技术中,每个节点通常采用串行化的交易执行方式来执行所述待写入区块中的各交易。如图5所示,所谓串行化的交易执行方式,是指每个节点按照一定的先手顺序,逐个执行所述待写入区块中的每个交易。In the prior art, each node usually adopts a serialized transaction execution method to execute each transaction in the block to be written. As shown in FIG. 5, the so-called serialized transaction execution method refers to that each node executes each transaction in the to-be-written block one by one according to a certain first order.
而在本说明书实施例中,会将所述待写入区块中的各交易拆分为N组,其中,N为大于1的自然数。然后,针对每个组,将这个组中的交易排列成一个交易队列。本说明书对每个交易队列中交易的排列顺序不做具体限定。In the embodiment of the present specification, each transaction in the block to be written is divided into N groups, where N is a natural number greater than 1. Then, for each group, arrange the transactions in this group into a transaction queue. This specification does not specifically limit the order of transactions in each transaction queue.
S404:同时针对每个交易队列,由先到后依次执行该交易队列中的每个交易。S404: At the same time, for each transaction queue, each transaction in the transaction queue is executed in order from first to last.
在步骤S404中,实际上是同时开始并行化的针对每个交易队列进行交易执行。而具体到每个交易队列,实际上是串行化执行该交易队列中的每个交易。如图6所示。In step S404, the parallel execution of transaction execution for each transaction queue is actually started at the same time. And specific to each transaction queue, actually execute each transaction in the transaction queue serially. As shown in Figure 6.
所谓“同时”,是指节点在同一时间开始执行每个交易队列中的交易。相当于节点在同一时间创设了N个交易执行进程,每个交易进程负责执行一个交易队列中的交易。The so-called "simultaneously" means that the nodes start executing transactions in each transaction queue at the same time. It is equivalent to the node creating N transaction execution processes at the same time, and each transaction process is responsible for executing transactions in a transaction queue.
对比图5和图6的两种交易执行方式,显然,采用图6所示的交易执行方式, 可以在单位时间内执行更多的交易。Comparing the two transaction execution methods of FIG. 5 and FIG. 6, it is clear that the transaction execution method shown in FIG. 6 can execute more transactions per unit time.
S406:将所述待写入区块写入区块链。S406: Write the block to be written into the blockchain.
在本说明书实施例中,针对每个节点,可以在执行步骤S404之后,执行步骤S406;也可以不在执行步骤S404之后才执行步骤S406。In the embodiment of the present specification, for each node, step S406 may be performed after step S404; or step S406 may not be performed after step S404 is performed.
通过图4所示的并行化执行区块链交易的方法,如果待写入区块中的每个交易皆不是对不止一个存储地址上存储的信息进行更新的交易,那么,区块链网络中的每个节点可以将待写入区块中的各交易组织成至少两个交易队列,然后,同时开始执行每个交易队列中的交易。如此,每个节点可以在单位时间内执行更多数量的交易,提升了交易执行效率。Through the parallelized method of executing blockchain transactions shown in FIG. 4, if each transaction to be written in the block is not a transaction that updates information stored in more than one storage address, then, in the blockchain network Each node of can organize each transaction to be written into the block into at least two transaction queues, and then, at the same time, start executing the transactions in each transaction queue. In this way, each node can execute a larger number of transactions per unit time, which improves the efficiency of transaction execution.
此外,在本说明书实施例中,每个交易队列对应的交易数量(即每个交易队列中的交易的数量)可以比较接近。如此,在并行化的同时针对各交易队列进行交易执行时,每个执行进程所执行的交易的数量比较接近,不会出现有的进程闲置,有的进程负荷过重的情况。这也意味着,节点可以在单位时间内,执行尽可能多的交易。In addition, in the embodiment of the present specification, the number of transactions corresponding to each transaction queue (that is, the number of transactions in each transaction queue) may be relatively close. In this way, when the transaction execution is executed for each transaction queue while being parallelized, the number of transactions executed by each execution process is relatively close, and some processes are not idle and some processes are overloaded. This also means that nodes can execute as many transactions as possible in a unit of time.
具体地,可以设置基于每个交易队列对应的交易数量计算得到的方差不大于指定阈值。基于每个交易队列对应的交易数量计算得到的方差越小,各交易队列对应的交易数量就越接近。Specifically, it may be set that the variance calculated based on the number of transactions corresponding to each transaction queue is not greater than a specified threshold. The smaller the variance calculated based on the number of transactions corresponding to each transaction queue, the closer the number of transactions corresponding to each transaction queue.
另外,在本说明书实施例中,具体可以采用以太坊协议构建区块链网络。在以太坊中,每个节点上安装有虚拟机程序,用于为以太坊协议的实现提供运行环境。In addition, in the embodiments of this specification, the Ethereum protocol can be used to construct a blockchain network. In Ethereum, a virtual machine program is installed on each node to provide a running environment for the implementation of the Ethereum protocol.
通常,一个虚拟机程序用于执行一个区块链进程。而在本说明书实施例中,由于需要同时针对不止一个交易队列,并行化的执行不止一个区块链进程,因此,需要在每个节点上预先部署不止一个虚拟机程序。Usually, a virtual machine program is used to execute a blockchain process. However, in the embodiment of the present specification, since more than one transaction queue needs to be simultaneously executed and more than one blockchain process needs to be executed in parallel, it is necessary to deploy more than one virtual machine program in advance on each node.
具体地,如果需要将待写入区块中的交易组织成N个交易队列,那么,就需要预先在每个节点上部署N个虚拟机程序。Specifically, if the transactions to be written in the block need to be organized into N transaction queues, then N virtual machine programs need to be deployed on each node in advance.
如此,在步骤S404中,可以建立预先部署的N个虚拟机程序与N个交易队列之间的一一对应关系;同时针对每个交易队列,通过该交易队列对应的虚拟机程序,由先到后依次执行该交易队列中的每个交易。As such, in step S404, a one-to-one correspondence between N virtual machine programs and N transaction queues that are pre-deployed can be established; at the same time, for each transaction queue, the virtual machine program corresponding to that transaction queue Then execute each transaction in the transaction queue in turn.
此外,在本说明书实施例中,通常,待写入区块中的交易既有第一类交易,也有第二类交易。其中,第一类交易是指,执行结果为更新一个存储地址上存储的信息的 交易;第二类交易是指,执行结果为创设一个存储地址并存入信息的交易。In addition, in the embodiment of the present specification, generally, the transactions to be written in the block include both the first type transaction and the second type transaction. Among them, the first type of transaction refers to the transaction whose execution result is to update the information stored on a storage address; the second type of transaction refers to the transaction whose execution result is to create a storage address and store the information.
显然,待写入区块中可能存在不止一个第一类交易会对同一个存储地址上存储的信息进行更新。而节点在执行每个第一类交易时,往往需要先访问当前所执行的第一类交易所针对的存储地址。这种情况下,节点在执行待写入区块中的交易时,如果能对同一存储地址对应的所有第一类交易进行集中批量执行,那么只需要针对同一个存储地址进行一次访问即可,这会显著提升节点执行交易的速度。Obviously, there may be more than one type 1 transaction in the block to be written, which will update the information stored on the same storage address. Nodes often need to first access the storage address targeted by the currently executing first-class exchange when executing each first-class transaction. In this case, when the node executes the transactions in the block to be written, if it can perform batch execution of all the first type transactions corresponding to the same storage address, then only one access to the same storage address is required, This will significantly increase the speed at which nodes execute transactions.
具体地,在步骤S402中,可以从各交易中选择出执行结果为更新一个存储地址上存储的信息的交易,作为第一类交易,以及,将各交易中除第一类交易以外的其他交易作为第二类交易;将各第一类交易中,对应的存储地址相同的第一类交易组织成一个交易子队列;以每个交易子队列为一个处理单位,并且,以每个第二类交易视为一个处理单位;将各处理单位组织成N个交易队列。Specifically, in step S402, a transaction whose execution result is to update the information stored on a storage address may be selected from each transaction as a first-type transaction, and other transactions except the first-type transaction in each transaction As a second type of transaction; in each first type of transaction, the corresponding first type of transaction with the same storage address is organized into a transaction sub-queue; each transaction sub-queue is a processing unit, and each second type of transaction The transaction is regarded as one processing unit; each processing unit is organized into N transaction queues.
如此,所述待写入区块中,对应于任一存储地址的全部第一类交易都会被整合一个交易子队列,该交易子队列会被整体放入到某个交易队列中。节点在针对该交易队列进行交易执行时,一旦访问该存储地址,就会连续执行该存储地址对应的全部第一类交易。In this way, in the block to be written, all the first-type transactions corresponding to any storage address will be integrated into a transaction sub-queue, and the transaction sub-queue will be put into a transaction queue as a whole. When the node executes a transaction for the transaction queue, once accessing the storage address, it will continuously execute all the first-type transactions corresponding to the storage address.
进一步地,将各处理单位组织成N个交易队列,可以如下:Further, each processing unit is organized into N transaction queues, which can be as follows:
根据每个处理单位对应的交易数量,由大到小对各处理单位进行排序;并且,初始化每个交易队列对应的交易数量为0;根据排序结果,选择第一个处理单位;将当前选择的处理单位添加到最小交易队列的队尾,并更新所述最小交易队列对应的交易数量;最小交易队列是当前对应的交易数量最小的交易队列;继续选择下一个处理单位,直至所有处理单位都被添加到交易队列。According to the number of transactions corresponding to each processing unit, the processing units are sorted from large to small; and, the number of transactions corresponding to each transaction queue is initialized to 0; according to the sorting result, the first processing unit is selected; the currently selected The processing unit is added to the tail of the minimum transaction queue, and the number of transactions corresponding to the minimum transaction queue is updated; the minimum transaction queue is the transaction queue with the smallest corresponding number of transactions; continue to select the next processing unit until all processing units are Add to the transaction queue.
通过这种方式,可以使得各交易队列分别对应的交易数量大体相当。这样,在基于各交易队列进行并行化的交易执行时,各执行进程上的工作负荷也大体相当,不会有某个执行进程闲置的情况出现,这样可以在单位时间内执行最多的交易,显著提升节点的交易执行效率。In this way, the number of transactions corresponding to each transaction queue can be made substantially the same. In this way, when parallel transaction execution is performed based on each transaction queue, the workload on each execution process is also roughly the same, and no execution process will be idle, so that the most transactions can be executed in a unit time, significantly Improve the transaction execution efficiency of nodes.
基于图1所示的方法,本说明书实施例还对应提供了一种基于区块链的编程题目发布装置,如图7所示,所述装置为区块链网络中的任一节点,所述装置包括:Based on the method shown in FIG. 1, the embodiment of this specification also correspondingly provides a blockchain-based programming issue issuing device. As shown in FIG. 7, the device is any node in the blockchain network. The device includes:
创设模块701,创设待发布的编程题目;Create a module 701 to create programming topics to be released;
构建广播模块702,基于题目相关数据,构建题目发布交易,并向所述区块链网 络广播所述题目发布交易;所述题目相关数据包括所述编程题目,以使获得所述题目发布交易的每个节点基于各节点之间的共识机制,将所述题目发布交易写入区块链。Construct a broadcast module 702, construct a topic release transaction based on the topic-related data, and broadcast the topic release transaction to the blockchain network; the topic-related data includes the programming topic, so that the topic release transaction is obtained Each node writes the issue publishing transaction into the blockchain based on the consensus mechanism between the nodes.
基于图2所示的方法,本说明书实施例还对应提供了一种基于区块链的解答代码发布装置,如图8所示,所述装置为区块链网络中的任一节点,所述装置包括:Based on the method shown in FIG. 2, the embodiment of this specification also correspondingly provides a blockchain-based solution code issuing device. As shown in FIG. 8, the device is any node in the blockchain network. The device includes:
获取模块801,获取编程题目;所述编程题目是通过权利要求1~4任一项所述的方法发布的;The obtaining module 801 obtains programming topics; the programming topics are issued by the method according to any one of claims 1 to 4;
解答模块802,将所述编程题目提供给被测试用户进行解答,并接收所述被测试用户上传的解答代码;The answering module 802 provides the programming question to the tested user for answering, and receives the answer code uploaded by the tested user;
构建广播模块803,基于解答相关数据,构建解答发布交易,并向所述区块链网络广播所述解答发布交易,以使获得所述解答发布交易的每个节点基于各节点之间的共识机制,将所述解答发布交易写入区块链;Build a broadcast module 803, construct answer release transactions based on answer-related data, and broadcast the answer release transactions to the blockchain network, so that each node that obtains the answer release transactions is based on the consensus mechanism between the nodes , Write the answer release transaction into the blockchain;
其中,所述解答相关数据包括所述编程题目的题目标识、所述解答代码与所述被测试用户的用户标识。Wherein, the solution-related data includes a problem identification of the programming problem, the solution code, and a user identification of the user under test.
基于图2所示的方法,本说明书实施例还对应提供了一种基于区块链的解答代码检验装置,如图9所示,所述装置是区块链网络中,存储有编程题目对应的解答检验数据的节点,所述装置包括:Based on the method shown in FIG. 2, the embodiment of the present specification also correspondingly provides a blockchain-based solution code verification device. As shown in FIG. 9, the device is in a blockchain network and stores corresponding programming problems. To answer the node of inspection data, the device includes:
获取模块901,获取所述编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识;所述编程题目是通过图1所示的方法发布的,所述解答代码是通过图2所示的方法发布的;The obtaining module 901 obtains the answer code corresponding to the programming question and the user ID of the user who is tested by uploading the answer code; the programming question is issued by the method shown in FIG. Published by the method shown;
检验模块902,使用存储的对应于所述编程题目的解答检验数据,检验所述解答代码;The verification module 902 uses the stored verification data corresponding to the programming problem to verify the solution code;
构建广播模块903,若检验通过,则基于结果相关数据,构建结果发布交易,并向所述区块链网络广播所述结果发布交易,以使获得所述结果发布交易的每个节点基于各节点之间的共识机制,将所述结果发布交易写入区块链;Construct a broadcasting module 903, if the test passes, construct a result publishing transaction based on the result-related data, and broadcast the result publishing transaction to the blockchain network, so that each node that obtains the result publishing transaction is based on each node Between the consensus mechanism, write the result release transaction into the blockchain;
其中,所述结果相关数据包括所述编程题目的题目标识与所述用户标识。Wherein, the result-related data includes the title identification of the programming topic and the user identification.
基于图1所示的方法,本说明书实施例还对应提供了一种基于区块链的编程题目发布系统,包括由多个节点组成的区块链网络;Based on the method shown in FIG. 1, the embodiments of the present specification also correspondingly provide a blockchain-based programming topic publishing system, including a blockchain network composed of multiple nodes;
任一节点,创设待发布的编程题目;基于题目相关数据,构建题目发布交易, 并向所述区块链网络广播所述题目发布交易,所述题目相关数据包括所述编程题目;Any node creates a programming topic to be released; based on the data related to the topic, constructs a topic release transaction, and broadcasts the topic release transaction to the blockchain network, and the topic related data includes the programming topic;
获得所述题目发布交易的每个节点,基于各节点之间的共识机制,将所述题目发布交易写入区块链。Each node that obtains the topic release transaction writes the topic release transaction into the blockchain based on the consensus mechanism between the nodes.
基于图2所示的方法,本说明书实施例还对应提供了一种基于区块链的解答代码发布系统,包括由多个节点组成的区块链网络;Based on the method shown in FIG. 2, the embodiment of this specification also correspondingly provides a blockchain-based solution code issuing system, including a blockchain network composed of multiple nodes;
任一节点,获取编程题目;所述目标节点为区块链网络中的任一节点,所述编程题目是根据图1所示的方法发布的;将所述编程题目提供给被测试用户进行解答,并接收所述被测试用户上传的解答代码;基于解答相关数据,构建解答发布交易,并向所述区块链网络广播所述解答发布交易;其中,所述解答相关数据包括所述编程题目的题目标识、所述解答代码与所述被测试用户的用户标识;Get a programming question at any node; the target node is any node in the blockchain network, and the programming question is published according to the method shown in Figure 1; provide the programming question to the tested user for answering , And receive the answer code uploaded by the tested user; based on the answer-related data, construct an answer release transaction, and broadcast the answer release transaction to the blockchain network; wherein, the answer-related data includes the programming topic Title identification, the answer code and the user identification of the tested user;
获得所述解答发布交易的每个节点,基于各节点之间的共识机制,将所述解答发布交易写入区块链。Each node that obtains the answer release transaction writes the answer release transaction into the blockchain based on the consensus mechanism between the nodes.
基于图3所示的方法,本说明书实施例还对应提供了一种基于区块链的解答代码检验系统,包括由多个节点组成的区块链网络;Based on the method shown in FIG. 3, the embodiment of this specification also correspondingly provides a blockchain-based solution code verification system, including a blockchain network composed of multiple nodes;
检验节点,获取编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识,所述编程题目是根据图1所示的方法发布的,所述解答代码是根据图2所示的方法发布的,所述检验节点是区块链网络中,存储有所述编程题目对应的解答检验数据的节点;使用存储的对应于所述编程题目的解答检验数据,检验所述解答代码;若检验通过,则基于结果相关数据,构建结果发布交易,并向所述区块链网络广播所述结果发布交易;其中,所述结果相关数据包括所述编程题目的题目标识与所述用户标识;Check the node to obtain the answer code corresponding to the programming question and the user ID of the user under test who uploaded the answer code. The programming question is issued according to the method shown in FIG. 1 and the answer code is shown in FIG. 2 Issued by the method, the verification node is a node in the blockchain network that stores the solution verification data corresponding to the programming problem; use the stored solution verification data corresponding to the programming problem to verify the solution code; if If the test passes, the result release transaction is constructed based on the result-related data, and the result release transaction is broadcast to the blockchain network; wherein, the result-related data includes the title identification of the programming topic and the user identification;
获得所述结果发布交易的每个节点,基于各节点之间的共识机制,将所述结果发布交易写入区块链。Each node that obtains the result publishing transaction writes the result publishing transaction into the blockchain based on the consensus mechanism between the nodes.
图10是本说明书实施例提供的一种基于区块链的编程水平测试系统的结构示意图。图10所示的系统,具体可以用于实现基于区块链的编程题目发布系统、解答代码发布系统、解答代码检验系统。FIG. 10 is a schematic structural diagram of a blockchain-based programming level testing system provided by an embodiment of the present specification. The system shown in FIG. 10 can be specifically used to implement a block chain-based programming question issuing system, answer code issuing system, and answer code checking system.
本说明书实施例还提供一种计算机设备,其至少包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,处理器执行所述程序时实现图1或图2或图3所示方法的功能。An embodiment of the present specification also provides a computer device, which includes at least a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the program to implement FIG. 1 or FIG. 2 or The function of the method shown in Figure 3.
图11示出了本说明书实施例所提供的一种更为具体的计算设备硬件结构示意图,该设备可以包括:处理器1010、存储器1020、输入/输出接口1030、通信接口1040和总线1050。其中处理器1010、存储器1020、输入/输出接口1030和通信接口1040通过总线1050实现彼此之间在设备内部的通信连接。FIG. 11 shows a schematic diagram of a more specific hardware structure of a computing device provided by an embodiment of the present specification. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 realize the communication connection between the devices within the device through the bus 1050.
处理器1010可以采用通用的CPU(Central Processing Unit,中央处理器)、微处理器、应用专用集成电路(Application Specific Integrated Circuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本说明书实施例所提供的技术方案。The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit, central processing unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. Programs to implement the technical solutions provided by the embodiments of the present specification.
存储器1020可以采用ROM(Read Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、静态存储设备,动态存储设备等形式实现。存储器1020可以存储操作系统和其他应用程序,在通过软件或者固件来实现本说明书实施例所提供的技术方案时,相关的程序代码保存在存储器1020中,并由处理器1010来调用执行。The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory, random access memory), static storage devices, and dynamic storage devices. The memory 1020 may store an operating system and other application programs. When the technical solutions provided by the embodiments of the present specification are implemented by software or firmware, related program codes are stored in the memory 1020 and are called and executed by the processor 1010.
输入/输出接口1030用于连接输入/输出模块,以实现信息输入及输出。输入输出/模块可以作为组件配置在设备中(图中未示出),也可以外接于设备以提供相应功能。其中输入设备可以包括键盘、鼠标、触摸屏、麦克风、各类传感器等,输出设备可以包括显示器、扬声器、振动器、指示灯等。The input / output interface 1030 is used to connect input / output modules to realize information input and output. The input / output / module can be configured as a component in the device (not shown in the figure), or can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, and the like.
通信接口1040用于连接通信模块(图中未示出),以实现本设备与其他设备的通信交互。其中通信模块可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信。The communication interface 1040 is used to connect a communication module (not shown in the figure) to implement communication interaction between the device and other devices. The communication module can realize communication through a wired method (such as USB, network cable, etc.), and can also implement communication through a wireless method (such as mobile network, WIFI, Bluetooth, etc.).
总线1050包括一通路,在设备的各个组件(例如处理器1010、存储器1020、输入/输出接口1030和通信接口1040)之间传输信息。The bus 1050 includes a path for transferring information between various components of the device (for example, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
需要说明的是,尽管上述设备仅示出了处理器1010、存储器1020、输入/输出接口1030、通信接口1040以及总线1050,但是在具体实施过程中,该设备还可以包括实现正常运行所必需的其他组件。此外,本领域的技术人员可以理解的是,上述设备中也可以仅包含实现本说明书实施例方案所必需的组件,而不必包含图中所示的全部组件。It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device may also include the necessary to achieve normal operation Other components. In addition, those skilled in the art can understand that the above-mentioned device may also include only the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figures.
本说明书实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现图1和/或图4所示方法的功能。Embodiments of the present specification also provide a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the functions of the method shown in FIG. 1 and / or FIG. 4.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方 法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer readable media, including permanent and non-permanent, removable and non-removable media, can store information by any method or technology. The information may be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本说明书实施例可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本说明书实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本说明书实施例各个实施例或者实施例的某些部分所述的方法。It can be known from the description of the above implementation manners that those skilled in the art can clearly understand that the embodiments of this specification can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solutions of the embodiments of the present specification can be embodied in the form of software products in essence or part of contributions to the existing technology, and the computer software products can be stored in a storage medium, such as ROM / RAM Magnetic disks, optical disks, etc., include several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in the embodiments of this specification or some parts of the embodiments.
上述实施例阐明的系统、方法、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。The system, method, module or unit explained in the above embodiments may be implemented by a computer chip or entity, or by a product with a certain function. A typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or any combination of these devices.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置和设备实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的方法实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,在实施本说明书实施例方案时可以把各模块的功能在同一个或多个软件和/或硬件中实现。也可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。The embodiments in this specification are described in a progressive manner. The same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and device embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the related parts, refer to the description of the method embodiments. The method embodiments described above are only schematics, wherein the modules described as separate components may or may not be physically separated, and the functions of the modules may be the same when implementing the embodiment solutions of this specification Or multiple software and / or hardware. Part or all of the modules may also be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement without paying creative labor.
以上所述仅是本说明书实施例的具体实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本说明书实施例原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本说明书实施例的保护范围。The above is only a specific implementation of the embodiments of this specification. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of the embodiments of this specification, several improvements and retouches can be made. These Improvements and retouching should also be regarded as the scope of protection of the embodiments of this specification.

Claims (28)

  1. 一种基于区块链的编程题目发布方法,包括:A method for publishing programming questions based on blockchain, including:
    目标节点创设待发布的编程题目;所述目标节点为区块链网络中的任一节点;The target node creates a programming topic to be released; the target node is any node in the blockchain network;
    所述目标节点基于题目相关数据,构建题目发布交易,并向所述区块链网络广播所述题目发布交易;所述题目相关数据包括所述编程题目;The target node constructs a topic publishing transaction based on topic related data, and broadcasts the topic publishing transaction to the blockchain network; the topic related data includes the programming topic;
    针对获得所述题目发布交易的每个节点,该节点基于各节点之间的共识机制,将所述题目发布交易写入区块链。For each node that obtains the topic release transaction, the node writes the topic release transaction into the blockchain based on the consensus mechanism between the nodes.
  2. 如权利要求1所述的方法,所述题目相关数据还包括所述目标节点的节点标识。The method according to claim 1, wherein the topic-related data further includes a node identifier of the target node.
  3. 如权利要求1所述的方法,所述方法还包括:针对获得所述题目发布交易的每个节点,该节点创建题目存储地址,并将所述题目相关数据存入所述题目存储地址。The method according to claim 1, further comprising: for each node that obtains the topic issue transaction, the node creates a topic storage address, and stores the topic-related data in the topic storage address.
  4. 如权利要求3所述的方法,将所述题目相关数据存入所述题目存储地址,具体包括:The method according to claim 3, storing the title-related data in the title storage address, specifically including:
    将封装有所述题目相关数据的题目智能合约存入所述题目存储地址。The title smart contract encapsulated with the relevant data of the title is stored in the title storage address.
  5. 一种基于区块链的解答代码发布方法,包括:A blockchain-based answer code publishing method, including:
    目标节点获取编程题目;所述目标节点为区块链网络中的任一节点,所述编程题目是通过权利要求1~4任一项所述的方法发布的;The target node obtains the programming topic; the target node is any node in the blockchain network, and the programming topic is issued by the method according to any one of claims 1 to 4;
    所述目标节点将所述编程题目提供给被测试用户进行解答,并接收所述被测试用户上传的解答代码;The target node provides the programming problem to the tested user for answering, and receives the answer code uploaded by the tested user;
    所述目标节点基于解答相关数据,构建解答发布交易,并向所述区块链网络广播所述解答发布交易;所述解答相关数据包括所述编程题目的题目标识、所述解答代码与所述被测试用户的用户标识;The target node constructs an answer release transaction based on the answer-related data, and broadcasts the answer release transaction to the blockchain network; the answer-related data includes the title identification of the programming topic, the answer code, and the The user ID of the tested user;
    针对获得所述解答发布交易的每个节点,该节点基于各节点之间的共识机制,将所述解答发布交易写入区块链。For each node that obtains the answer release transaction, the node writes the answer release transaction into the blockchain based on the consensus mechanism between the nodes.
  6. 如权利要求5所述的方法,目标节点获取编程题目,具体包括:According to the method of claim 5, the target node obtains the programming topic, specifically including:
    目标节点从区块链中的任一题目发布交易中读取编程题目;或The target node reads the programming topic from any topic publishing transaction in the blockchain; or
    目标节点从任一题目存储地址获取编程题目。The target node obtains the programming topic from any topic storage address.
  7. 如权利要求6所述的方法,若所述目标节点从区块链中的任一题目发布交易中读取编程题目,则所述编程题目的题目标识为所述题目发布交易的交易哈希;The method of claim 6, if the target node reads a programming topic from any topic publishing transaction in the blockchain, the topic identification of the programming topic is the transaction hash of the topic publishing transaction;
    若所述目标节点从任一题目存储地址获取编程题目,则所述编程题目的题目标识为所述存储地址。If the target node obtains a programming topic from any topic storage address, the topic of the programming topic is identified as the storage address.
  8. 如权利要求5所述的方法,所述方法还包括:针对获得所述解答发布交易的每 个节点,该节点创建解答存储地址,并将所述解答相关数据存入所述解答存储地址。The method according to claim 5, further comprising: for each node that obtains the solution issuing transaction, the node creates a solution storage address, and stores the solution related data in the solution storage address.
  9. 如权利要求8所述的方法,将所述解答相关数据存入所述解答存储地址,具体包括:The method of claim 8, storing the answer-related data in the answer storage address, specifically including:
    将封装有所述解答相关数据的解答智能合约存入所述解答存储地址。The solution smart contract encapsulated with the solution related data is stored in the solution storage address.
  10. 一种基于区块链的解答代码检验方法,包括:A blockchain-based solution code verification method, including:
    检验节点获取编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识;所述编程题目是通过权利要求1~4任一项所述的方法发布的,所述解答代码是通过权利要求5~9任一项所述的方法发布的,所述检验节点是区块链网络中,存储有所述编程题目对应的解答检验数据的节点;The verification node obtains the answer code corresponding to the programming question and the user ID of the user who is testing the uploading the answer code; the programming question is issued by the method of any one of claims 1 to 4, and the answer code According to the method of any one of claims 5 to 9, the verification node is a node in a blockchain network that stores answer verification data corresponding to the programming problem;
    所述检验节点使用存储的对应于所述编程题目的解答检验数据,检验所述解答代码;The verification node uses the stored solution verification data corresponding to the programming problem to verify the solution code;
    若检验通过,则所述检验节点基于结果相关数据,构建结果发布交易,并向所述区块链网络广播所述结果发布交易;所述结果相关数据包括所述编程题目的题目标识与所述用户标识;If the verification passes, the verification node constructs a result publishing transaction based on the result-related data, and broadcasts the result publishing transaction to the blockchain network; User identification
    针对获得所述结果发布交易的每个节点,该节点基于各节点之间的共识机制,将所述结果发布交易写入区块链。For each node that obtains the result publishing transaction, the node writes the result publishing transaction into the blockchain based on the consensus mechanism between the nodes.
  11. 如权利要求10所述的方法,检验节点获取编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识,具体包括:According to the method of claim 10, the verification node obtains the answer code corresponding to the programming problem and the user ID of the user under test uploading the answer code, specifically including:
    检验节点根据存储的任一解答检验数据,确定该解答检验数据对应的题目标识;The inspection node determines the question ID corresponding to the answer test data according to any stored answer test data;
    从区块链中的查询出包含所述题目标识的解答发布交易,并从所述解答发布交易中读取解答代码与用户标识;或查询存储有所述题目标识的解答存储地址,并从所述解答存储地址获取解答代码与用户标识。From the query in the blockchain, find the answer publishing transaction that contains the question ID, and read the answer code and user ID from the answer publishing transaction; or query the answer storage address where the question ID is stored, and search from all Get the answer code and user ID in the answer storage address.
  12. 如权利要求10所述的方法,所述结果相关数据还包括检验通过结果或检验未通过结果。The method according to claim 10, wherein the result-related data further includes a test passed result or a test failed result.
  13. 如权利要求10所述的方法,所述方法还包括:针对获得所述结果发布交易的每个节点,该节点创建结果存储地址,并将所述结果相关数据存入所述结果存储地址。The method of claim 10, further comprising: for each node that obtains the result publishing transaction, the node creates a result storage address, and stores the result related data in the result storage address.
  14. 如权利要求13所述的方法,将所述结果相关数据存入所述结果存储地址,具体包括:The method of claim 13, storing the result-related data in the result storage address, specifically including:
    将封装有所述结果相关数据的结果智能合约存入所述结果存储地址。Storing the result smart contract encapsulated with the result-related data in the result storage address.
  15. 如权利要求13所述的方法,所述方法还包括:The method of claim 13, further comprising:
    针对获得所述结果发布交易的每个节点,该节点若获得与所述结果发布交易相关联的其他结果发布交易,则基于各节点之间的共识机制,将所述其他结果发布交易写入区 块链;所述其他结果发布交易是基于所述用户标识与其他题目标识构建的;For each node that obtains the result publishing transaction, if the node obtains other result publishing transactions associated with the result publishing transaction, the node writes the other result publishing transactions into the zone based on the consensus mechanism between the nodes Blockchain; the other result release transaction is constructed based on the user ID and other topic IDs;
    以及as well as
    该节点根据所述其他结果发布交易,将所述其他题目标识存入所述结果存储地址。The node issues a transaction based on the other results, and stores the other topic identifiers in the result storage address.
  16. 如权利要求10所述的方法,检验节点的数量大于1;The method of claim 10, the number of check nodes is greater than 1;
    检验节点获取编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识,具体包括:The verification node obtains the answer code corresponding to the programming problem and the user ID of the user under test uploading the answer code, which specifically includes:
    针对每个检验节点,该检验节点获取编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识;For each verification node, the verification node obtains the answer code corresponding to the programming problem and the user ID of the user under test uploading the answer code;
    所述检验节点使用存储的对应于所述编程题目的解答检验数据,检验所述解答代码,具体包括:The verification node uses the stored solution verification data corresponding to the programming problem to verify the solution code, specifically including:
    针对每个检验节点,该检验节点使用存储的对应于所述编程题目的解答检验数据,检验所述解答代码;For each check node, the check node uses the stored answer test data corresponding to the programming problem to check the answer code;
    若检验通过,则所述检验节点基于结果相关数据,构建结果发布交易,并向所述区块链网络广播所述结果发布交易,具体包括:If the verification passes, the verification node constructs a result release transaction based on the result-related data, and broadcasts the result release transaction to the blockchain network, specifically including:
    针对每个检验节点,该检验节点若对所述解答代码检验通过,则基于结果相关数据,构建结果发布交易,并向所述区块链网络广播所述结果发布交易。For each verification node, if the verification node passes the answer code, it constructs a result release transaction based on the result-related data, and broadcasts the result release transaction to the blockchain network.
  17. 如权利要求16所述的方法,针对获得所述结果发布交易的每个节点,该节点基于各节点之间的共识机制,将所述结果发布交易写入区块链,具体包括:The method of claim 16, for each node that obtains the result publishing transaction, the node writes the result publishing transaction into the blockchain based on a consensus mechanism between the nodes, specifically including:
    该节点当确定获得的结果发布交易的数量为指定数量时,基于各节点之间的共识机制,将获得的任一结果发布交易写入区块链;When the node determines that the number of obtained result publishing transactions is the specified number, based on the consensus mechanism between each node, any obtained result publishing transactions are written into the blockchain;
    其中,所述指定数量不大于检验节点的数量。Wherein, the specified number is not greater than the number of inspection nodes.
  18. 如权利要求10所述的方法,所述检验节点,是所述区块链网络中创设所述编程题目的节点。The method according to claim 10, wherein the verification node is a node that creates the programming problem in the blockchain network.
  19. 一种基于区块链的编程题目发布方法,包括:A method for publishing programming questions based on blockchain, including:
    目标节点创设待发布的编程题目;所述目标节点为区块链网络中的任一节点;The target node creates a programming topic to be released; the target node is any node in the blockchain network;
    基于题目相关数据,构建题目发布交易,并向所述区块链网络广播所述题目发布交易;所述题目相关数据包括所述编程题目,以使获得所述题目发布交易的每个节点基于各节点之间的共识机制,将所述题目发布交易写入区块链。Based on the topic-related data, construct a topic issue transaction, and broadcast the topic issue transaction to the blockchain network; the topic-related data includes the programming topic, so that each node that obtains the topic issue transaction is based on The consensus mechanism between the nodes writes the issue publishing transaction into the blockchain.
  20. 一种基于区块链的解答代码发布方法,包括:A blockchain-based answer code publishing method, including:
    目标节点获取编程题目;所述目标节点为区块链网络中的任一节点,所述编程题目是通过权利要求1~4任一项所述的方法发布的;The target node obtains the programming topic; the target node is any node in the blockchain network, and the programming topic is issued by the method according to any one of claims 1 to 4;
    将所述编程题目提供给被测试用户进行解答,并接收所述被测试用户上传的解答代码;Providing the programming problem to the tested user for answering, and receiving the answer code uploaded by the tested user;
    基于解答相关数据,构建解答发布交易,并向所述区块链网络广播所述解答发布交易,以使获得所述解答发布交易的每个节点基于各节点之间的共识机制,将所述解答发布交易写入区块链;Based on the answer-related data, construct an answer release transaction, and broadcast the answer release transaction to the blockchain network, so that each node that obtains the answer release transaction will base the answer on the consensus mechanism between the nodes Post transactions into the blockchain;
    其中,所述解答相关数据包括所述编程题目的题目标识、所述解答代码与所述被测试用户的用户标识。Wherein, the solution-related data includes a problem identification of the programming problem, the solution code, and a user identification of the user under test.
  21. 一种基于区块链的解答代码检验方法,包括:A blockchain-based solution code verification method, including:
    检验节点获取编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识;所述编程题目是通过权利要求1~4任一项所述的方法发布的,所述解答代码是通过权利要求5~9任一项所述的方法发布的,所述检验节点是区块链网络中,存储有所述编程题目对应的解答检验数据的节点;The verification node obtains the answer code corresponding to the programming question and the user ID of the user who is testing the uploading the answer code; the programming question is issued by the method of any one of claims 1 to 4, and the answer code According to the method of any one of claims 5 to 9, the verification node is a node in a blockchain network that stores answer verification data corresponding to the programming problem;
    使用存储的对应于所述编程题目的解答检验数据,检验所述解答代码;Using the stored answer verification data corresponding to the programming problem to verify the answer code;
    若检验通过,则基于结果相关数据,构建结果发布交易,并向所述区块链网络广播所述结果发布交易,以使获得所述结果发布交易的每个节点基于各节点之间的共识机制,将所述结果发布交易写入区块链;If the test passes, based on the result-related data, construct a result publishing transaction, and broadcast the result publishing transaction to the blockchain network, so that each node that obtains the result publishing transaction is based on the consensus mechanism between the nodes , Write the result release transaction into the blockchain;
    其中,所述结果相关数据包括所述编程题目的题目标识与所述用户标识。Wherein, the result-related data includes the title identification of the programming topic and the user identification.
  22. 一种基于区块链的编程题目发布装置,所述装置为区块链网络中的任一节点,所述装置包括:A blockchain-based programming issue issuing device, the device is any node in a blockchain network, the device includes:
    创设模块,创设待发布的编程题目;Create modules to create programming topics to be released;
    构建广播模块,基于题目相关数据,构建题目发布交易,并向所述区块链网络广播所述题目发布交易;所述题目相关数据包括所述编程题目,以使获得所述题目发布交易的每个节点基于各节点之间的共识机制,将所述题目发布交易写入区块链。Build a broadcast module, build a topic release transaction based on the topic-related data, and broadcast the topic release transaction to the blockchain network; the topic-related data includes the programming topic, so that each issue of the topic release transaction is obtained Each node writes the issue publishing transaction into the blockchain based on the consensus mechanism between each node.
  23. 一种基于区块链的解答代码发布装置,所述装置为区块链网络中的任一节点,所述装置包括:A blockchain-based solution code issuing device, the device is any node in a blockchain network, the device includes:
    获取模块,获取编程题目;所述编程题目是通过权利要求1~4任一项所述的方法发布的;An acquisition module to acquire programming questions; the programming questions are issued by the method of any one of claims 1 to 4;
    解答模块,将所述编程题目提供给被测试用户进行解答,并接收所述被测试用户上传的解答代码;The answering module provides the programming question to the tested user for answering, and receives the answer code uploaded by the tested user;
    构建广播模块,基于解答相关数据,构建解答发布交易,并向所述区块链网络广播所述解答发布交易,以使获得所述解答发布交易的每个节点基于各节点之间的共识机制, 将所述解答发布交易写入区块链;Build a broadcast module, build answer release transactions based on answer-related data, and broadcast the answer release transactions to the blockchain network, so that each node that obtains the answer release transactions is based on the consensus mechanism between the nodes, Write the answer release transaction into the blockchain;
    其中,所述解答相关数据包括所述编程题目的题目标识、所述解答代码与所述被测试用户的用户标识。Wherein, the solution-related data includes a problem identification of the programming problem, the solution code, and a user identification of the user under test.
  24. 一种基于区块链的解答代码检验装置,所述装置是区块链网络中,存储有编程题目对应的解答检验数据的节点,所述装置包括:An answer code verification device based on a blockchain. The device is a node in a blockchain network that stores answer verification data corresponding to a programming problem. The device includes:
    获取模块,获取所述编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识;所述编程题目是通过权利要求1~4任一项所述的方法发布的,所述解答代码是通过权利要求5~9任一项所述的方法发布的;An obtaining module, obtaining the answer code corresponding to the programming question and the user ID of the user under test uploading the answer code; the programming question is issued by the method according to any one of claims 1 to 4, and the answer The code is issued by the method of any one of claims 5-9;
    检验模块,使用存储的对应于所述编程题目的解答检验数据,检验所述解答代码;A verification module, using the stored verification data corresponding to the programming problem to verify the solution code;
    构建广播模块,若检验通过,则基于结果相关数据,构建结果发布交易,并向所述区块链网络广播所述结果发布交易,以使获得所述结果发布交易的每个节点基于各节点之间的共识机制,将所述结果发布交易写入区块链;Build a broadcasting module, if the test passes, build a result publishing transaction based on the result-related data, and broadcast the result publishing transaction to the blockchain network, so that each node that obtains the result publishing transaction is based on the The consensus mechanism between the two, writes the result release transaction into the blockchain;
    其中,所述结果相关数据包括所述编程题目的题目标识与所述用户标识。Wherein, the result-related data includes the title identification of the programming topic and the user identification.
  25. 一种基于区块链的编程题目发布系统,包括由多个节点组成的区块链网络;A blockchain-based programming topic publishing system, including a blockchain network composed of multiple nodes;
    任一节点,创设待发布的编程题目;基于题目相关数据,构建题目发布交易,并向所述区块链网络广播所述题目发布交易,所述题目相关数据包括所述编程题目;Any node creates a programming topic to be released; based on the data related to the topic, constructs a topic release transaction, and broadcasts the topic release transaction to the blockchain network, and the topic related data includes the programming topic;
    获得所述题目发布交易的每个节点,基于各节点之间的共识机制,将所述题目发布交易写入区块链。Each node that obtains the topic release transaction writes the topic release transaction into the blockchain based on the consensus mechanism between the nodes.
  26. 一种基于区块链的解答代码发布系统,包括由多个节点组成的区块链网络;A blockchain-based answer code publishing system, including a blockchain network composed of multiple nodes;
    任一节点,获取编程题目;所述目标节点为区块链网络中的任一节点,所述编程题目是通过权利要求1~4任一项所述的方法发布的;将所述编程题目提供给被测试用户进行解答,并接收所述被测试用户上传的解答代码;基于解答相关数据,构建解答发布交易,并向所述区块链网络广播所述解答发布交易;其中,所述解答相关数据包括所述编程题目的题目标识、所述解答代码与所述被测试用户的用户标识;Any node to obtain a programming topic; the target node is any node in the blockchain network, the programming topic is issued by the method according to any one of claims 1 to 4; the programming topic is provided Answer to the tested user and receive the answer code uploaded by the tested user; based on the relevant data of the answer, construct an answer publishing transaction and broadcast the answer publishing transaction to the blockchain network; wherein, the answer is relevant The data includes the title identification of the programming topic, the answer code and the user identification of the tested user;
    获得所述解答发布交易的每个节点,基于各节点之间的共识机制,将所述解答发布交易写入区块链。Each node that obtains the answer release transaction writes the answer release transaction into the blockchain based on the consensus mechanism between the nodes.
  27. 一种基于区块链的解答代码检验系统,包括由多个节点组成的区块链网络;A block-based answer code verification system, including a block chain network composed of multiple nodes;
    检验节点,获取编程题目对应的解答代码与上传所述解答代码的被测试用户的用户标识,所述编程题目是通过权利要求1~4任一项所述的方法发布的,所述解答代码是通过权利要求5~9任一项所述的方法发布的,所述检验节点是区块链网络中,存储有所述编程题目对应的解答检验数据的节点;使用存储的对应于所述编程题目的解答检验数据, 检验所述解答代码;若检验通过,则基于结果相关数据,构建结果发布交易,并向所述区块链网络广播所述结果发布交易;其中,所述结果相关数据包括所述编程题目的题目标识与所述用户标识;A verification node to obtain the answer code corresponding to the programming question and the user ID of the user under test uploading the answer code, the programming question is issued by the method according to any one of claims 1 to 4, and the answer code is Issued by the method of any one of claims 5 to 9, the verification node is a node in the blockchain network that stores the answer verification data corresponding to the programming problem; using the stored data corresponding to the programming problem Answer verification data to verify the answer code; if the test passes, based on the result-related data, construct a result-publishing transaction and broadcast the result-publishing transaction to the blockchain network; where the result-related data includes all The title identification of the programming topic and the user identification;
    获得所述结果发布交易的每个节点,基于各节点之间的共识机制,将所述结果发布交易写入区块链。Each node that obtains the result publishing transaction writes the result publishing transaction into the blockchain based on the consensus mechanism between the nodes.
  28. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,所述处理器执行所述程序时实现如权利要求1~21任一项所述的方法。A computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, the program according to any one of claims 1 to 21 is implemented method.
PCT/CN2019/104897 2018-10-26 2019-09-09 Methods and systems for publishing programming problem, publishing solution code, and checking solution code WO2020082917A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811260961.0 2018-10-26
CN201811260961.0A CN109345392B (en) 2018-10-26 2018-10-26 Method and system for issuing programming question, issuing solution code and checking solution code

Publications (1)

Publication Number Publication Date
WO2020082917A1 true WO2020082917A1 (en) 2020-04-30

Family

ID=65312467

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/104897 WO2020082917A1 (en) 2018-10-26 2019-09-09 Methods and systems for publishing programming problem, publishing solution code, and checking solution code

Country Status (3)

Country Link
CN (1) CN109345392B (en)
TW (1) TWI706252B (en)
WO (1) WO2020082917A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116032793A (en) * 2022-11-17 2023-04-28 中国联合网络通信集团有限公司 Information processing method, information processing device, electronic equipment and computer readable medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109345392B (en) * 2018-10-26 2020-06-23 阿里巴巴集团控股有限公司 Method and system for issuing programming question, issuing solution code and checking solution code
CN110096435B (en) * 2019-04-09 2023-08-08 平安科技(深圳)有限公司 Automatic code writing method, device, computer equipment and storage medium
CN110602097B (en) * 2019-09-13 2021-09-14 腾讯科技(深圳)有限公司 Block chain-based task processing method, device, equipment and storage medium
CN110688410B (en) * 2019-09-23 2021-03-19 创新先进技术有限公司 Suggestion processing method and device based on block chain and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108111312A (en) * 2017-12-28 2018-06-01 电子科技大学 A kind of intelligent terminal safety communicating method based on block chain
CN108171493A (en) * 2017-11-14 2018-06-15 北京欧链科技有限公司 The data processing method and device of block chain
CN108595535A (en) * 2018-03-30 2018-09-28 李欣宇 Knowledge Q-A system and method based on the double-chain block chain of same root
CN109345392A (en) * 2018-10-26 2019-02-15 阿里巴巴集团控股有限公司 Program topic publication, the publication of answer code, answer code check method and system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016200428A1 (en) * 2015-06-07 2016-12-15 Sarafzade Ali Educational proficiency development and assessment system
WO2017090329A1 (en) * 2015-11-24 2017-06-01 ソニー株式会社 Information processing device, information processing method, and program
GB201705749D0 (en) * 2017-04-10 2017-05-24 Nchain Holdings Ltd Computer-implemented system and method
CN107622385A (en) * 2017-08-28 2018-01-23 南京邮电大学 A kind of copyright distributing method based on block chain intelligence contract
CN108550041A (en) * 2018-03-20 2018-09-18 深圳市元征科技股份有限公司 Protect the method, apparatus and terminal of original works
CN108521456B (en) * 2018-04-01 2020-10-02 南京米好信息安全有限公司 Block chain-based network building competition system
CN108615153A (en) * 2018-04-28 2018-10-02 百度在线网络技术(北京)有限公司 Processing method, device, system, equipment and the storage medium of block chain data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108171493A (en) * 2017-11-14 2018-06-15 北京欧链科技有限公司 The data processing method and device of block chain
CN108111312A (en) * 2017-12-28 2018-06-01 电子科技大学 A kind of intelligent terminal safety communicating method based on block chain
CN108595535A (en) * 2018-03-30 2018-09-28 李欣宇 Knowledge Q-A system and method based on the double-chain block chain of same root
CN109345392A (en) * 2018-10-26 2019-02-15 阿里巴巴集团控股有限公司 Program topic publication, the publication of answer code, answer code check method and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116032793A (en) * 2022-11-17 2023-04-28 中国联合网络通信集团有限公司 Information processing method, information processing device, electronic equipment and computer readable medium
CN116032793B (en) * 2022-11-17 2024-04-02 中国联合网络通信集团有限公司 Information processing method, information processing device, electronic equipment and computer readable medium

Also Published As

Publication number Publication date
CN109345392A (en) 2019-02-15
CN109345392B (en) 2020-06-23
TWI706252B (en) 2020-10-01
TW202016778A (en) 2020-05-01

Similar Documents

Publication Publication Date Title
WO2020082917A1 (en) Methods and systems for publishing programming problem, publishing solution code, and checking solution code
WO2020082871A1 (en) Method, device and system for executing blockchain transactions in parallel
TWI705346B (en) Transaction method and system based on centralized settlement and blockchain deposit certificate
US20210049602A1 (en) Transaction method and system based on centralized settlement and blockchain deposit certificates
WO2020029629A1 (en) Transaction method and system based on centralized settlement and block chain storage
TWI728678B (en) Block chain-based enterprise certification and certification tracing method, device and equipment
WO2020119287A1 (en) Blockchain-based invoice creation method and apparatus, and electronic device
CN111898139B (en) Data reading and writing method and device and electronic equipment
WO2020093808A1 (en) Method and apparatus for constructing merkle trees, and method and apparatus for simplified payment verification
US11176246B2 (en) Enclave pool shared key
WO2020119286A1 (en) Blockchain-based invoice creating method and apparatus, and electronic device
TWI739059B (en) Block chain-based virtual resource delivery and crowd fundraising method and device
CN110046523B (en) Intelligent contract checking method and device and electronic equipment
CN110032598B (en) Method and device for updating field and electronic equipment
US10664591B2 (en) Enclave pools
WO2020134628A1 (en) Method and apparatus for performing evidence storage on structured work based on blockchain
TWI706282B (en) Method and device for concealing transactions written in blockchain, blockchain system, and computer equipment
TWI712907B (en) Method and device for obtaining blockchain certificate for webpage through file acquisition
WO2020093809A1 (en) Method and device for reading blockchain data
WO2020019799A1 (en) Object selection method and device and electronic device
WO2020108054A1 (en) Data storage and attestation method and system based on multiple blockchain networks
WO2021239074A1 (en) Smart contract code generation method, program, and device
CN111459948B (en) Transaction integrity verification method based on centralized block chain type account book
US10104163B1 (en) Secure transfer of virtualized resources between entities
CN111464319B (en) Transaction storage and signature verification method based on centralized block chain type account book

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19877462

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19877462

Country of ref document: EP

Kind code of ref document: A1