CN109395392B - Forecast guess game deployment method and game method, equipment and storage medium - Google Patents

Forecast guess game deployment method and game method, equipment and storage medium Download PDF

Info

Publication number
CN109395392B
CN109395392B CN201811151670.8A CN201811151670A CN109395392B CN 109395392 B CN109395392 B CN 109395392B CN 201811151670 A CN201811151670 A CN 201811151670A CN 109395392 B CN109395392 B CN 109395392B
Authority
CN
China
Prior art keywords
game
block
contract
node
main chain
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811151670.8A
Other languages
Chinese (zh)
Other versions
CN109395392A (en
Inventor
柳宇航
吴思进
王志文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN201811151670.8A priority Critical patent/CN109395392B/en
Publication of CN109395392A publication Critical patent/CN109395392A/en
Application granted granted Critical
Publication of CN109395392B publication Critical patent/CN109395392B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/75Enforcing rules, e.g. detecting foul play or generating lists of cheating players
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/53Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of basic data processing
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • A63F2300/5526Game data structure
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • A63F2300/5586Details of game data or player data management for enforcing rights or rules, e.g. to prevent foul play
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a forecast guessing game deployment method, a game method, equipment and a storage medium, and belongs to the technical field of block chains. Deploying a first game contract of a first game on a first parallel chain, so that a plurality of first game terminals can obtain and call game opening interfaces of the first game contract to respectively create first games on the first parallel chain; a plurality of second game terminals acquire and call game participation interfaces of the first game contract to respectively participate in the first game on the first parallel chain; sending a first game contract of the first game to the corresponding main chain node for recording and consensus; corresponding gaming methods, devices and storage media are also included. The method can ensure the fairness and fairness of the game, improve the expansibility of the game, bear more people to play the game without being limited by the performance of the block chain, further realize the scheme of the lightweight block chain game, and have higher degree of freedom.

Description

Forecast guess game deployment method and game method, equipment and storage medium
Technical Field
The invention relates to the technical field of block chains, in particular to a forecast guessing game deployment method, a game method, equipment and a storage medium.
Background
The current block chain games such as the victory or defeat of football and basketball or the prediction of match and the like have two types, one type is similar to the traditional online games, a centralized game server is still configured, and the block chain is only used for recording and proving the key information such as the attribution right of game props in the game scheme; the other type is no longer equipped with a centralized game server, but rather a decentralized blockchain network is used as a game server.
The disadvantage of the former type of centralized game schemes is that they are still conventional in nature, and they cannot avoid and get rid of the poor game control of the control party of the centralized server, such as the failure to extract prizes after the win prediction, and these centralized platforms cannot provide fair and fair game.
For the latter decentralized game scheme, the current is still relatively immature, only a few companies are trying to do some attempts, the existing game scheme utilizing the block chain technology adopts an intelligent contract to improve the fairness and fairness of the game, but the scheme is poor in expansibility, mainly because the current block chain is limited by factors such as performance and the like, the game cannot be carried by more people, the development speed of the game on the block chain is further limited, and the current lacks of a scheme which can realize a lightweight block chain game through simple and convenient deployment and application, so that more users cannot be attracted to participate in the decentralized block chain game;
further, the existing decentralized blockchain game also has the defect of low degree of freedom, and under the condition that the rule is simple, the low degree of freedom causes poor interest of the game, and the game still depends on the fixed game operated by a game developer, for example, a general forecast guess game needs a fixed event, and is difficult to attract and retain users.
Disclosure of Invention
1. Technical problem to be solved by the invention
In order to overcome the technical problems, the invention provides a forecast guessing game deployment method, a game method, equipment and a storage medium. The method can ensure the fairness and fairness of the game, improve the expansibility of the game, bear more people to play the game without being limited by the performance of the block chain, further realize the scheme of the lightweight block chain game without being limited by fixed events, can independently develop and predict the guess game, and has higher degree of freedom.
2. Technical scheme
In order to solve the problems, the technical scheme provided by the invention is as follows:
first, the present invention provides a method for deploying a guessing game, which is applicable to nodes of a first parallel chain, and comprises:
deploying a first game contract of a first game on a first parallel chain, so that a plurality of first game terminals can obtain and call game opening interfaces of the first game contract to respectively create first games on the first parallel chain; a plurality of second game terminals acquire and call game participation interfaces of the first game contract to respectively participate in the first game on the first parallel chain;
sending a first game contract of a first game to a corresponding main chain node, so that each node of a first parallel chain obtains and executes a first game contract of the first game from the corresponding main chain node, and each verification node of the first parallel chain packs first block information of a first block and sends the first block information to the corresponding main chain node for recording the first block information to the main chain, and verifying whether block information not less than a first threshold number is the same in the first block information, if so, the first block is commonly identified by the main chain, and a commit identifier for authentication is configured for the first block of the first parallel chain; wherein the first block information includes an execution result of a first game contract of the first game.
Preferably, the first game contract is further configured with a game ending interface for the first game terminal to acquire and invoke to generate a game ending transaction, the game ending transaction configured with at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule.
Preferably, the first game contract is further configured with a plurality of rule templates for the first game terminal to acquire and invoke to quickly configure at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule.
Preferably, the method further comprises:
deploying a rule configuration review contract for the first game on the first parallel chain;
wherein the rule configuration review contract is for reviewing at least one of: the game end triggering rule, the game result judging rule and the reward issuing rule generate examination result information and send the examination result information to corresponding main chain nodes, so that each node of the first parallel chain respectively obtains and executes examination result information from the corresponding main chain node, each verification node of the first parallel chain respectively packs first block information of a first block and sends the first block information to the corresponding main chain node to record the first block information to the main chain, and whether the block information with the number not less than a first threshold value is the same in the first block information is verified, if yes, the first block is commonly identified by the main chain, and a mit identifier for authentication is configured for the first block of the first parallel chain; for the second gaming terminal to obtain for reference; wherein the first block information includes the examination result information.
Preferably, the method further comprises:
sending a first game creation transaction, a first game participation transaction, a game ending transaction and a rule configuration examination contract to corresponding main chain nodes, so that each node of a first parallel chain can respectively obtain and execute the first game creation transaction, the first game participation transaction, the game ending transaction and the rule configuration examination contract from the corresponding main chain node, each verification node of the first parallel chain respectively packages first block information of a first block and sends the first block information to the corresponding main chain node so as to record the first block information onto the main chain, and whether block information which is not less than a first threshold number is identical in the first block information is verified, if yes, the first block is commonly identified by the main chain, and a commit identifier for authentication is configured for the first block of the first parallel chain; wherein the first tile information comprises the first game creation transaction, a first game participation transaction, a game end transaction, and a rule configuration review contract; the first game creation transaction is generated when a plurality of first game terminals acquire and call game opening interfaces to respectively create first games; the first game participation transaction is generated when the plurality of second game terminals acquire and call the game participation interfaces to participate in the first game respectively.
Secondly, the invention provides a forecast guessing game deployment method, which comprises the following steps:
receiving a first game contract of a first game, wherein the first game contract of the first game is deployed on a first parallel chain by nodes of the first parallel chain, so that each node of the first parallel chain acquires and executes a first game contract of the first game from a corresponding main chain node, each verification node of the first parallel chain packs first block information of a first block and sends the first block information to the corresponding main chain node, the first block information is recorded on the main chain, whether block information which is not less than a first threshold number is the same in the first block information is verified, if yes, the first block is identified by the main chain, and a commit identifier for authentication is configured for the first block of the first parallel chain; wherein the first block information includes an execution result of a first game contract of the first game;
receiving, recording and commonly recognizing the first block and information thereof;
the game starting interfaces are configured on the first game contract of the first game, so that a plurality of first game terminals can acquire and call the game starting interfaces to respectively create the first game;
the first game contract of the first game is also provided with game participation interfaces, so that a plurality of second game terminals can acquire and call the game participation interfaces to participate in the first game respectively.
Preferably, the first game contract is configured with a plurality of rule templates for the first game terminal to acquire and invoke to quickly configure at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule.
Preferably, the first game contract is configured with a game ending interface for the first game terminal to acquire and invoke to generate a game ending transaction, the game ending transaction configured with at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule.
Preferably, the method further comprises:
receiving examination result information, enabling each node of a first parallel chain to obtain examination result information of a first game from a corresponding main chain node, enabling each verification node of the first parallel chain to pack first block information of a first block and send the first block information to the corresponding main chain node for recording the first block information to the main chain, and verifying whether the first block information has block information which is not less than a first threshold number and is the same, if so, enabling the first block to be identified by the main chain and configuring a commit identifier for authentication for the first block of the first parallel chain; for the second gaming terminal to obtain for reference; wherein the first tile information includes review result information of the first game;
wherein the review result information is used by a rule configuration review contract to review at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule are generated and sent to the main chain node; the rule configuration review contract is deployed on the first parallel chain by a node of the first parallel chain.
Preferably, the method further comprises:
receiving a first game creation transaction, a first game participation transaction, a game ending transaction and a rule configuration examination contract to corresponding main chain nodes, so that each node of a first parallel chain can respectively obtain and execute the first game creation transaction, the first game participation transaction, the game ending transaction and the rule configuration examination contract from the corresponding main chain node, wherein each verification node of the first parallel chain respectively packages first block information of a first block and sends the first block information to the corresponding main chain node so as to record the first block information to the main chain, and verifies whether the block information not less than a first threshold number is the same in the first block information, if yes, the first block is commonly identified by the main chain, and a commit identifier for authentication is configured for the first block of the first parallel chain; wherein the first tile information comprises the first game creation transaction, a first game participation transaction, a game end transaction, and a rule review contract; the first game creating transaction is generated when a plurality of first game terminals acquire and call game opening interfaces to respectively create first games and is sent to nodes of a first parallel chain; the first game participation transaction is generated when the plurality of second game terminals acquire and call the game participation interfaces to participate in the first game respectively and is sent to the nodes of the first parallel chain.
A predictive guessing game method comprising:
receiving game opening transactions to create a first game on a first parallel chain, wherein the game opening transactions are acquired by a first game terminal, call a game opening interface of a first game contract deployed on the first parallel chain, generate and send the game opening interface to nodes of the first parallel chain;
receiving a number of game participation transactions to determine participants of the first game; the game participation transaction is generated and sent to the nodes of the first parallel chain by a second game terminal after acquiring the information of the first game through the first parallel chain and calling a game participation interface of the first game contract;
generating a game result according to a plurality of preconfigured rules, and sending a game opening transaction, a plurality of game participation transactions and the game result of a first game to a corresponding main chain node, so that each node of a first parallel chain can respectively obtain and execute the game opening transaction, the plurality of game participation transactions and the game result of the first game from the corresponding main chain node, each verification node of the first parallel chain respectively packages first block information of a first block and sends the first block information to the corresponding main chain node for recording the first block information onto the main chain, and whether block information which is not less than a first threshold number is the same in the first block information is verified, if yes, the first block is commonly identified by the main chain, and a commit identifier for authentication is configured for the first block of the first parallel chain; wherein the first tile information comprises a game opening transaction, a plurality of game participation transactions and a game result of the first game.
Preferably, the generating the game result according to the preconfigured rules, and the sending the game result of the first game to the corresponding main chain node includes:
monitoring a tile height or time of the first parallel chain by running a virtual machine of the first game, and determining whether the tile height or time triggers a preconfigured game end triggering rule:
if yes, generating a game result according to a pre-configured game result judgment rule, and sending the game result of the first game to the corresponding main chain node.
Preferably, said receiving a game play transaction to create a first game on a first parallel chain further comprises:
receiving a game ending transaction; wherein the end of game transaction is configured with at least one of the following for the first game: a game ending triggering rule, a game result judging rule and an award issuing rule; the game ending transaction is generated by the first game terminal acquiring and calling a game ending interface of the first game contract;
the generating of the game result according to the plurality of preconfigured rules, the sending of the game result of the first game to the corresponding main chain node comprises:
and executing the game ending transaction by running the virtual machine of the first game to generate a game result and sending the game result of the first game to the corresponding main chain node.
Preferably, the first game contract is further configured with a number of rule templates by which the game end transaction is quickly configured with at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule.
Preferably, the method further comprises:
invoking a rule configuration review contract for the first game to review at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule generate examination result information and send the examination result information to the corresponding main chain node record and consensus, so that each node of the first parallel chain can obtain the examination result information of the first game from the corresponding main chain node respectively for reference by the second game terminal.
Fourth, the present invention provides an apparatus, comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of the first to third.
Fifth, the present invention provides a storage medium storing a computer program which, when executed by a processor, implements the method according to any one of the first to third aspects.
3. Advantageous effects
Compared with the prior art, the technical scheme provided by the invention has the following beneficial effects:
(1) the invention can ensure the fairness and fairness of games, improve the expansibility of guessing games, bear more people to play games without being limited by the performance of the block chain, further realize the scheme of lightweight block chain games and have higher degree of freedom;
(2) the invention can fairly and fairly predict the guess by using the decentralization of the block chain and the intelligent contract, and can also lead the scheme to lead the user to initiate the predicted guess for any aspect of predicting the guess, thereby greatly widening the breadth of the predicted guess and expanding the predicted guess type scheme;
(3) the invention can enable all participants to initiate prediction, and the prediction scheme can directly utilize an intelligent contract (a first game contract) to automatically execute the prediction result on a block chain without the supervision of a third party, thereby providing safety guarantee for users;
(4) the game opening transaction, the game participation transaction, the rule configuration examination contract and the game result are all carried out on the parallel chain and are recorded on the main chain for the main chain to be identified, thereby ensuring the decentralization, the fairness and the justice of the game;
(5) the invention can improve the fairness of the forecast guess game, and automatically executes result distribution by using the intelligent contract of the block chain; the scheme can enable the user to initiate the forecast guess by himself, the participation of the user is improved, no centralized participation exists in the whole process, and the intelligent contract automatically distributes rewards according to guess results;
(6) the parallel chain has the advantages that the advantages of the parallel chain are utilized, the parallel chain is high in expansibility, high in efficiency and strong in safety, the parallel chain can develop own functions on the framework of the main chain, the safety does not need to be maintained, the parallel chain and the main chain are in independent and connected relation, and the parallel chain has good expansibility, namely different parallel chains can be built according to different forecast guess game scenes; the parallel chain only needs to process the transaction related to the self-forecast guessing game, and the data of the parallel chain is stored in the main chain, so that the parallel chain is convenient for anyone to verify, the safety is improved, and the efficiency is improved.
Drawings
FIG. 1 is a schematic diagram of a parallel chain scenario of the present invention;
fig. 2 is a flowchart of a method for deploying a guessing game suitable for parallel chain nodes according to an embodiment of the present invention;
fig. 3 is a flowchart of a guessing game deployment method suitable for main chain nodes corresponding to parallel chain nodes according to an embodiment of the present invention;
FIG. 4 is a flowchart of a method for predicting a guessing game according to an embodiment of the present invention;
fig. 5 is a second flowchart of a guessing game deployment method suitable for parallel chain nodes according to an embodiment of the present invention;
fig. 6 is a second flowchart of a guessing game deployment method suitable for the main chain nodes corresponding to the parallel chain nodes according to an embodiment of the present invention;
FIG. 7 is a second flowchart of a method for predicting a guessing game according to an embodiment of the present invention;
FIG. 8 is a schematic illustration of a first game contract according to the present invention;
FIG. 9 is a schematic structural diagram of an apparatus according to an embodiment of the present invention;
FIG. 10 is a diagram illustrating a parallel chain consensus scenario in accordance with an embodiment of the present invention;
FIG. 11 is a schematic diagram illustrating an application flow of a guessing game applied to parallel chain nodes in a parallel chain consensus method according to an embodiment of the present invention;
fig. 12 is a schematic view of an application flow of the guessing game suitable for the parallel link point to correspond to the main chain node in the parallel chain consensus method according to an embodiment of the present invention.
Detailed Description
For a further understanding of the present invention, reference will now be made in detail to the embodiments illustrated in the drawings.
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
The terms first, second, and the like in the present invention are provided for convenience of describing the technical solution of the present invention, and have no specific limiting effect, but are all generic terms, and do not limit the technical solution of the present invention.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In the present invention, one main chain may be provided with one or more parallel chains. The nodes on one parallel chain comprise two kinds, namely verification nodes and non-verification nodes, which respectively correspond to different main chain nodes and can communicate with the corresponding main chain nodes, and the nodes of the parallel chain cannot communicate with each other; the nodes on the main chain are communicated with each other.
The verification node on one parallel chain can be used for receiving the transactions and contracts sent by a plurality of game terminals and executing the corresponding transactions and contracts, can also be used for creating the transactions, deploying the contracts and packaging the block information, and can send, acquire and execute the corresponding transactions, contracts and block information to the corresponding main chain node.
The non-verification node on one parallel chain can be used for receiving the transactions and contracts sent by a plurality of game terminals and executing the corresponding transactions and contracts, and can also be used for creating the transactions and deploying the contracts, and can send, acquire and execute the corresponding transaction, contract and package block information to the corresponding main chain node, but can not package the block information.
The verification or non-verification nodes on one parallel chain respectively correspond to a plurality of game terminals, and each game player corresponds to one game terminal.
The consensus mechanism of parallel chains is based on the consensus of the main chains: the consensus mechanism can employ existing POWs: the parallel chain is provided with a plurality of verification nodes (usually 3f +1, f is a positive integer), each verification node respectively packs block information of a block to be identified and sends the block information to a corresponding main chain node, the main chain node records the block information to the main chain and verifies whether the block information with the number not less than a first threshold number is the same, if yes, the parallel chain block is identified by the main chain in a way of POW, POS or DPOS and the like, and a commit mark for authentication is configured for the parallel chain block.
The following consensus mechanism may also be employed: a plurality of verification nodes (usually 3f +1, f is a positive integer) are configured in the parallel chain, each verification node respectively packages block information of the block to be identified and sends the block information to a corresponding main chain node, the main chain node records each block information to the main chain, and verifies whether block information not less than a first threshold number is the same in each block information: if yes, the parallel chain block passes the consensus and the commit mark for authentication is allocated for the parallel chain block.
The scheme provided by the invention is specifically explained in the following with reference to the attached drawings.
Fig. 10 is a schematic diagram of a parallel chain consensus scenario in an embodiment of the invention. As shown in FIG. 10, in this embodiment, parallel A has parallel node A1, main B has main node B1, and parallel node A1 cooperates with main node B1 to provide a consensus method for parallel A. Referring to fig. 11, the application of the deployment method of the predictive guessing game in the parallel chain consensus method provided by the present invention is applicable to nodes on parallel chains, and is specifically described below with reference to fig. 11.
And each verification node of the first parallel chain respectively packages first block information of the first block and sends the first block information to a corresponding main chain node for recording the first block information to the main chain, and verifies whether the block information which is not less than a first threshold number is the same in the first block information, if so, the first block is commonly identified by the main chain, a commit mark for authentication is configured for the first block of the first parallel chain, and each node of the first parallel chain acquires and executes the commonly identified first block from the corresponding main chain node.
Referring to fig. 12, the application of the deployment method of the predicted guessing game in the parallel chain consensus method is applicable to the main chain nodes corresponding to the nodes on the parallel chain, and is specifically described below with reference to fig. 11.
Receiving first block information sent by each verification node of a first parallel chain, recording the first block information to a main chain, and verifying whether block information which is not less than a first threshold number is the same in the first block information, if so, the first block is identified by the main chain, allocating a commit identifier for authentication for the first block of the first parallel chain, and each main chain node writes the identified first block into a corresponding node of the first parallel chain, so that each node of the first parallel chain can acquire and execute the identified first block.
The first block information comprises a first game contract and an execution result of the first game, a first game creating transaction, a first game participation transaction, a game ending transaction, a rule configuration examination contract and examination result information.
Specifically, taking the application scenario shown in fig. 10 as an example, it is assumed that a first block to be identified in the first parallel chain is a block with a block height H on the first parallel chain, the pieces of information of the first block are the state hash, the block height, the signature information, and the state information of each packaged transaction of the first block, and the identification result is the state hash, the block height, the state information of each packaged transaction of the first block, and the authentication identifier.
As shown in fig. 11, the parallel chain node a1 packs several information of the first block to be identified of the first parallel chain a to generate the first block information, and since the first block to be identified of the first parallel chain a is a block with a block height H on the first parallel chain and several information of the first block is a state hash, a block height, signature information of the first block and state information of each packed transaction, the parallel chain node a1 packs the state hash, the block height, the signature information of the block with the block height H of the first parallel chain a and the state information of each packed transaction to generate the first block information.
The parallel chain node A1 sends the first block information to the corresponding main chain node B1, so that the main chain node B1 records the first block information on the main chain B, the main chain node B1 verifies whether the first block information not less than a first threshold number in each piece of first block information recorded by the main chain B is the same and generates a consensus result, the parallel chain node A1 sends the first block information to the corresponding main chain node B1, so that the main chain node B1 records the first block information on the main chain B, and the main chain node B1 verifies whether the first block information not less than the first threshold number in each piece of first block information recorded by the main chain B is the same and generates the state hash, the block height, the state information of each packaged transaction, the state information of the first block, Authenticating the identification;
parallel chain node a1 synchronizes the state hash of the first chunk, the chunk height, the state information of each packaged transaction, the authentication tag, and writes the first chunk that passes the consensus into the first parallel chain a.
The main chain node B1 verifies whether there is no less than the first threshold number of the first block information recorded by the main chain B and generates a consensus result, and if it is not verified that there is no less than the first threshold number of the first block information, does not generate the consensus result; if the node B1 does not synchronize to the consensus within the preconfigured timeout period, then the first chunk is not written to the first parallel chain B.
The above embodiment describes in detail the application of the guessing game in the parallel chain consensus method by taking the first block to be consensus of the first parallel chain as the block with the block height H on the first parallel chain, the plurality of information as the state hash, the block height, the signature information of the first block, the state information of the packaged transactions, and the consensus result as the state hash, the block height, the state information of the packaged transactions, and the authentication identifier of the first block, in further embodiments, the parallel chain consensus method provided by the present invention is not limited to the above examples, and the plurality of information may be configured as one or more of the state hash of the first block, the block height, the signature information, and the state information of each packaged transaction, or may be configured as other information such as the block header hash according to actual requirements, and the same technical effect can be achieved.
In a preferred embodiment, the method illustrated in FIG. 11 is applied to parallel chained authentication nodes. Specifically, it is assumed that before the method shown in fig. 11, the first parallel chain node is divided into a verification node of the parallel chain and a non-verification node of the parallel chain, the verification node of the first parallel chain is used for processing the service logic of the transaction information of the first block to be identified, and the non-verification node of the first parallel chain is used for acquiring and executing the transaction information of the first block. The method and the device reduce the cost of parallel chain consensus, improve the performance of the parallel chain and optimize the user experience.
In a preferred embodiment, the number of the verification nodes of the first parallel chain is at least configured to be 3N +1, where N is a positive integer and N is the number of the verification nodes of the first block information that are allowed to generate errors. Specifically, after the verifying node executes the method shown in fig. 11, a BFT consensus algorithm is used to achieve consensus, and one condition of the BFT consensus algorithm is that the number of verifying nodes is at least configured to be 3N +1, where N is a positive integer, N is the number of verifying nodes of the first block information that are allowed to generate errors, and if N is 1, the number of verifying nodes is at least configured to be 4. If 4 verification nodes are configured, if the first block information generated by the verification nodes recorded by the main chain node verification main chain is the same as or more than 3 first block information, a consensus result is generated, the verification nodes of the first parallel chain synchronize the consensus result, and the first block passing the consensus is written into the first parallel chain. In this embodiment, the BFT consensus algorithm is used to achieve consensus, and the number of verification nodes of the first parallel chain is at least configured to be 3N +1, for example, in further embodiments, other consensus algorithms may be used to perform consensus, and the configuration method of the verification nodes may also be configured according to actual requirements.
In a preferred embodiment, the number of messages includes at least one of: the method comprises the steps of state hashing of a first block, block height, signature information and state information of packaged transactions, wherein the state information is used for identifying whether the packaged transactions of the first block are successful or not. Specifically, assuming that the state information is a key value table, each transaction is configured with a first index, and the first index is a key in the key value table; whether each transaction is packed successfully or not is configured with a binary value, the binary value is a value in the key value table, for example, if the transaction with the first index of 1 is packed successfully, the binary value of the transaction is configured as 1, and if the transaction with the first index of 1 is packed unsuccessfully, the binary value of the transaction is configured as 0; assuming that there are 4 transactions with index values of 1, 2, 3, and 4 in the current block, the packing status of these 4 transactions is: success, failure, the status information is: (1,1), (2,1), (3,1), (4, 0). In this embodiment, the state information is taken as an example of a key value table, and in further embodiments, the state information may be configured as other tables or other data types according to actual requirements, for example, configured as a bit map table, which can achieve the same technical effect.
In a preferred embodiment, the method shown in fig. 11 further includes: as a result of the synchronization consensus, the verified first block is written into the first parallel chain when each block preceding the first block passes verification.
In a preferred embodiment, the consensus result comprises: and the authentication identifier is configured for the verified first block.
In a preferred embodiment, the consensus result further comprises: determining the authentication height of the first parallel chain according to the authentication identifier; the certification height is recorded on the backbone. Specifically, assuming that a first block to be identified of the first parallel chain is a block with a block height H on the first parallel chain, the authentication height is a block height of the first block to be identified of the first parallel chain, the main chain node verifies whether the first block information recorded by the main chain has the same first block information which is not less than a first threshold number and generates an identification result, since the identification result includes the authentication identifier configured for the verified first block, the main chain updates the authentication height H-1 of the first parallel chain to H according to the authentication identifier, and the information with the authentication height H of the first parallel chain is recorded on the main chain.
Fig. 12 is a flowchart of an application of a guessing game in a parallel chain consensus method according to an embodiment of the present invention, where the method is applied to a main chain node corresponding to a first parallel chain link point, and includes:
receiving first block information sent by a corresponding first parallel link node, and recording the first block information to a main chain; the first block information is generated by packaging a plurality of pieces of information of a first block to be identified of the first parallel chain by the verification node of the first parallel chain;
and verifying whether the first block information with the quantity not less than a first threshold value is the same in all the first block information recorded by the main chain, generating a consensus result for the first parallel chain nodes to synchronize the consensus result, and writing the first block passing the consensus into the first parallel chain for the first parallel chain nodes to obtain and execute the first block information.
Specifically, taking the application scenario shown in fig. 10 as an example, it is assumed that the first block to be identified in the first parallel chain is a block with a block height H on the first parallel chain, the pieces of information are the state hash, the block height, the signature information of the first block, the state information of each packaged transaction, and the identification result is the state hash, the block height, the state information of each packaged transaction, and the authentication identifier of the first block.
The main chain node B1 receives the first block information sent by the corresponding parallel chain node A1, and records the first block information on the main chain 10; the first block information is generated by packaging a plurality of pieces of information of a first block to be identified in the first parallel chain by a parallel chain node A1; since the first block to be identified in the first parallel chain is a block with a block height H on the first parallel chain, and the plurality of pieces of information are the state hash, the block height, the signature information, and the state information of the packaged transactions of the first block, the first block information is generated by the parallel chain node a1 packing the state hash, the block height, the signature information, and the state information of the packaged transactions of the first block with the block height H of the first parallel chain;
the main chain node B1 verifies whether the first block information recorded by the main chain B has the same number of first block information not less than a first threshold value, generates a consensus result for the parallel chain node A1 to synchronize the consensus result, and writes the verified first block into the first parallel chain A; since the consensus result is the state hash of the first block, the block height, the state information of each packaged transaction, and the authentication identifier, the main chain node B1 verifies whether the first block information recorded by the main chain node B has the same number of first block information not less than the first threshold number, and generates the state hash of the first block, the block height, the state information of each packaged transaction, and the authentication identifier, so that the parallel chain node a1 synchronizes the state hash of the first block, the block height, the state information of each packaged transaction, and the authentication identifier, and writes the verified first block into the first parallel chain a.
In the above embodiment, the parallel chain common identification method provided by the present invention is described in detail by taking the first block to be common identified of the first parallel chain as the block with the block height H on the first parallel chain, and the plurality of information are the state hash, the block height, the signature information, and the state information of each packaged transaction, and the common identification result is the state hash, the block height, the state information of each packaged transaction, and the authentication identifier of the first block.
The main chain node B1 verifies whether there is no less than the first threshold number of the first block information recorded by the main chain B and generates a consensus result, and if it is not verified that there is no less than the first threshold number of the first block information, does not generate the consensus result; if the synchronization does not reach the consensus result within the preconfigured timeout period, parallel chain node a1 does not write the first chunk into the first parallel chain a.
In a preferred embodiment, the consensus result comprises: and the authentication identifier is configured for the verified first block.
In a preferred embodiment, the consensus result further comprises: and updating the authentication height of the first parallel chain according to the authentication identifier, and recording the updated authentication height to the main chain. Specifically, assuming that a first block to be identified in the first parallel chain is a block with a block height H on the first parallel chain, the authentication height is the block height of the first block to be identified in the first parallel chain; the main chain node verifies whether the first block information with the number not less than the first threshold number in each first block information recorded by the main chain is the same and generates a consensus result, and the consensus result comprises an authentication identifier configured for the verified first block, so that the main chain updates the authentication height H-1 of the first parallel chain to H according to the authentication identifier, and records the information of the authentication height H of the first parallel chain on the main chain.
In a preferred embodiment, the number of the verification nodes of the first parallel chain is at least configured to be 3N +1, where N is a positive integer, and N is the number of the verification nodes of the first parallel chain that allows the generation of the erroneous first block information. Specifically, after the verifying node executes the method shown in fig. 2, the verifying node uses a BFT consensus algorithm to achieve consensus, where one condition of the BFT consensus algorithm is that the number of verifying nodes of the first parallel chain is at least configured to be 3N +1, where N is a positive integer, N is the number of verifying nodes of the first parallel chain that allow the generation of the erroneous first chunk information, and if N is 1, the number of verifying nodes of the first parallel chain is at least configured to be 4. Assuming that 4 verification nodes of the first parallel chain are configured, if the first block information generated by the verification nodes recorded by the main chain node verification main chain is the same as or greater than 3 first block information, a consensus result is generated, the verification nodes of the first parallel chain synchronously agree with the consensus result, and the verified first block is written into the first parallel chain. In this embodiment, the BFT consensus algorithm is used to achieve consensus, and the number of verification nodes of the first parallel chain is at least configured to be 3N +1, for example, in further embodiments, other consensus algorithms may be used to perform consensus, and the configuration method of the verification nodes may also be configured according to actual requirements.
In a preferred embodiment, the number of messages includes at least one of: the method comprises the steps of state hashing of a first block, block height, signature information and state information of packaged transactions, wherein the state information is used for identifying whether the packaged transactions of the first block are successful or not. Specifically, assuming that the state information is a key value table, each transaction is configured with a first index, and the first index is a key in the key value table; whether each transaction is packed successfully or not is configured with a binary value, the binary value is a value in the key value table, for example, if the transaction with the first index of 1 is packed successfully, the binary value of the transaction is configured as 1, and if the transaction with the first index of 1 is packed unsuccessfully, the binary value of the transaction is configured as 0; assuming that there are 4 transactions with index values of 1, 2, 3, and 4 in the current block, the packing status of these 4 transactions is: success, failure, the status information is: (1,1), (2,1), (3,1), (4, 0). In this embodiment, the state information is taken as an example of a key value table, and in further embodiments, the state information may be configured as other tables or other data types according to actual requirements, for example, configured as a bit map table, which can achieve the same technical effect.
In a preferred embodiment, the method shown in fig. 12 further includes: a first block passing consensus is written to the first parallel chain only if blocks preceding the first block all pass consensus.
Fig. 1 is a schematic diagram of a parallel chain scenario according to an embodiment of the invention. As shown in fig. 1, several nodes (a, B, C, …, T, …) are configured for the main chain, 10 nodes (a1, B1, C1, …, T1) are configured for the first parallel chain, wherein the nodes a1, B1, C1, d1 are configured as verification nodes of the first parallel chain, and the nodes e1, f1, …, T1 are configured as non-verification nodes of the first parallel chain; the nodes a2, c2, e2, h2c1, d1 are configured as verification nodes of a second parallel chain, which elaborates on the game deployment scenario of the present invention.
As shown in fig. 2, in this embodiment, the present invention provides a method for deploying a guessing game, which is applied to nodes on a first parallel chain, and includes:
s101, deploying a first game contract (as shown in fig. 8) of a first game on a first parallel chain, so that a plurality of first game terminals can acquire and call game play interfaces of the first game contract to respectively create first games on the first parallel chain; a plurality of second game terminals acquire and call game participation interfaces of the first game contract to respectively participate in the first game on the first parallel chain;
s102, sending a first game contract of a first game to a corresponding main chain node, so that each node of a first parallel chain obtains and executes the first game contract of the first game from the corresponding main chain node, and each verification node of the first parallel chain packs first block information of a first block and sends the first block information to the corresponding main chain node so as to record the first block information to the main chain to identify the first block; wherein the first block information includes an execution result of a first game contract of the first game.
As shown in fig. 3, in this embodiment, the present invention further provides a method for deploying a guessing game, which is applicable to a main chain node corresponding to a node on a first parallel chain, and includes:
s201 and S202, receiving a first game contract of a first game, where the first game contract of the first game is deployed on a first parallel chain by nodes of the first parallel chain, so that each node of the first parallel chain obtains and executes a first game contract of the first game from a corresponding main chain node, and each verification node of the first parallel chain packages first block information of a first block and sends the first block information to a corresponding main chain node, so as to record the first block information onto the main chain to identify the first block; wherein the first block information includes an execution result of a first game contract of the first game;
the first block and its information are received, recorded and commonly identified.
The game starting interfaces are configured on the first game contract of the first game, so that a plurality of first game terminals can acquire and call the game starting interfaces to respectively create the first game;
the first game contract of the first game is also provided with game participation interfaces, so that a plurality of second game terminals can acquire and call the game participation interfaces to participate in the first game respectively.
Fig. 4 is a flowchart of a guessing game method according to an embodiment of the present invention. The gaming method illustrated in fig. 4 may be played by a game contract deployed by the method illustrated in fig. 2 and 3. As shown in fig. 4, in the present embodiment, the present invention provides a game method, including:
s301, receiving game opening transactions to create a first game on a first parallel chain, wherein the game opening transactions are acquired by a first game terminal, generated by calling a game opening interface of a first game contract deployed on the first parallel chain and sent to nodes of the first parallel chain;
s302, receiving a plurality of game participation transactions to determine the participant of the first game; the game participation transaction is generated and sent to the nodes of the first parallel chain by a second game terminal after acquiring the information of the first game through the first parallel chain and calling a game participation interface of the first game contract;
s303, generating a game result according to a plurality of preconfigured rules, and sending the game starting transaction, the game participation transaction and the game result of the first game to a corresponding main chain node, so that each node of the first parallel chain can respectively obtain and execute the game starting transaction, the game participation transaction and the game result of the first game from the corresponding main chain node, and each verification node of the first parallel chain respectively packages first block information of the first block and sends the first block information to the corresponding main chain node so as to record the first block information to the main chain to commonly identify the first block; wherein the first tile information comprises a game opening transaction, a plurality of game participation transactions and a game result of the first game.
Specifically, the methods shown in fig. 2, 3 and 4 are described below by taking as an example that a game developer deploys a game for guessing a value on a parallel chain I, and a number of players create or participate in the game on the chain.
The game developer can develop a guess number through the development language of the intelligent contract of the parallel chain IValue game contract SCnum1And configuring an externally provided interface in the game contract: game opening interface I1Game participation interface I2
In step S101, the game contract SC is contracted by initiating a transactionnum1Deployed onto parallel chain I, thereby generating the game contract SCnum1Address TAddGame.
After deployment is completed, the game terminal of the player A can acquire the address TAddGame through the data of the parallel chain I and acquire a game opening interface I by accessing the address TAddGame1Thereby opening the game by calling the game opening interface I1Configuring a plurality of opening related parameters, for example, designating the range of guessing numbers of the game in 108-129, the number of the full players of the game in 20, and the like, generating game opening transactions and sending the game opening transactions to the nodes of the parallel chain I;
in step S301, after receiving the game opening transaction sent by the game terminal of the player a, the node of the parallel chain I executes the contract code of the game opening transaction through the virtual machine, and if the execution is correct, the game opening transaction is sent to the main chain node corresponding to the node of the parallel chain I, so that each node of the parallel chain I respectively obtains and executes the game contract SC guessing the value from the corresponding main chain nodenum1The game opening transaction of (1), each verification node of the parallel chain I respectively packages first block information of a first block and sends the first block information to a corresponding main chain node so as to record the first block information on the main chain to identify the first block; wherein the first block information comprises the game contract SC of the guessing valuenum1The game opening transaction can be known, the game opening transaction is successfully established, and the game terminals of all players can acquire the information of the game through the data of the synchronous parallel chain I;
when the game terminal of player B acquires information of the game-guessing digital game created by player a and player B decides to join the game, the game terminal of player B also acquires the game participation interface I through the address TAddGame2Thereby through calling the game parametersAnd interface I2Configuring the number of guesses of the player B in the game according to the range specified by the player A, for example, configuring the number of guesses of the player B in the game B as 120, generating game participation transactions and sending the transactions to the nodes of the parallel chain I;
in step S302, after receiving the game participation transaction sent by the game terminal of the player B, the node of the parallel chain I executes the game participation transaction, and if the execution is successful, the game participation transaction is sent to the main chain node corresponding to the node of the parallel chain I, so that each node of the parallel chain I respectively obtains and executes the game contract SC for guessing the value from the corresponding main chain nodenum1The verification nodes of the parallel chain I respectively pack first block information of a first block and send the first block information to corresponding main chain nodes so as to record the first block information to the main chain to identify the first block; wherein the first block information comprises the game contract SC of the guessing valuenum1If the game participation transaction can be identified, the player B successfully participates in the game;
other players such as the player C, D can participate in the game by the player B, can participate in the game created by other players, and can create a new game by themselves by the player a;
in step S303, when the game run by the virtual machine triggers a game ending triggering rule, for example, 50 blocks have passed after the game created by player a guesses the digital game, or a certain time point specified in advance is reached, the virtual machine in the node of the parallel chain I automatically executes a pre-configured game result settlement code, generates a game result, and records the game result on the parallel chain I. For example, the number of guesses by the game is generated according to the seed determined when the game is created (for example, the block hash of a certain historical block, the transaction hash of a certain historical transaction, or the public key or address of the player a, etc.) and the pre-configured pseudo-random algorithm, and then whether any player guesses successfully is judged according to the number of guesses by each player participating in the game: if one or more players guess successfully, the one or more players win the game; if no player guesses successfully, player A who creates the game wins the game.
In a preferred embodiment, step S303 includes: monitoring a tile height or time of the first tile chain by running a virtual machine of the first game, and determining whether the tile height or time triggers a preconfigured game end triggering rule:
if yes, generating a game result according to a pre-configured game result judgment rule, and sending the game result to a main chain node corresponding to the node of the parallel chain I so that each node of the parallel chain I can respectively obtain and execute a game contract SC for guessing the value from the corresponding main chain nodenum1The verification nodes of the parallel chain I respectively pack first block information of a first block and send the first block information to corresponding main chain nodes so as to record the first block information on the main chain to identify the first block; wherein the first block information comprises the game contract SC of the guessing valuenum1The result of the game.
In particular, in the preferred embodiment, the game-ending trigger rules are configured in the game-initiating transaction by the player who created the game; in another preferred embodiment, the game ending triggering rule may also be configured directly in the game contract by the game developer (note that the game developer may be a player, or may also be a node operator on the first parallel chain, or an operator of the game terminal, etc., which is free to choose), and the same technical effect may be achieved.
Preferably, the opening player and the participating player may also wager an amount of game credits, coins, or cryptocurrency when sending the game opening transaction and the game participation transaction, respectively. The wagered game credits, coins or cryptocurrency may all be used to award a winning player after the game outcome is generated; it is also possible to award partly the winning player and partly the bonus game developer; and so on.
The above embodiments have exemplified the methods shown in fig. 2 and fig. 3 by taking as an example that a game developer configures a game contract for guessing a value on a parallel chain I, and each player acquires and calls an interface of the game contract to create or participate in a game for guessing a value on the parallel chain I, and in further embodiments, game contracts for different games can be configured on different parallel chains according to actual requirements, and different games can be created or participate in, as long as the parallel chain allows a user to develop and configure a contract by himself, and the game can be realized by developing a contract, so that the same technical effect can be achieved.
In the embodiment, the game contract configured with the game opening interface and the game participation interface is deployed on the parallel chain, so that the player can create the game on the parallel chain by calling the game opening interface and participate in the game created by other players by calling the game participation interface, and the lightweight decentralized parallel chain game can be realized by simple and convenient deployment and application, the excessive resources of the main chain are not occupied, the requirement on the performance of the main chain is not high, the pressure of the main chain can be relieved, and the expansibility of the game is improved.
The above embodiment encapsulates some rules of game ending in the game contract, and the degree of freedom of the game is relatively low, which may result in that the interest of the game is not strong enough. To address this problem, the present invention further allows a player creating a game to configure these rules themselves by configuring an interface provided to the player in a game contract:
in a preferred embodiment, the first game contract is further configured with a game ending interface for the first game terminal to acquire and invoke to generate a game ending transaction, the generated game ending transaction configured with at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule.
Correspondingly, in a preferred embodiment, the steps S202 and S303 further include: an end-of-game transaction is received. Wherein the game ending transaction is configured with at least one of the following for the first game: the game ending triggering rule, the game result judging rule and the reward issuing rule. The game end transaction is generated by the first game terminal obtaining and invoking a game end interface of the first game contract.
Step S102 includes: executing the game ending transaction by running a virtual machine of a first game to generate a game result, sending the game result to a corresponding main chain node, so that each node of a first parallel chain respectively obtains and executes the game result generated by the game ending transaction from the corresponding main chain node, and each verification node of the first parallel chain respectively packs first block information of a first block and sends the first block information to the corresponding main chain node so as to record the first block information on the main chain to identify the first block; wherein the first tile information comprises a game result generated by the game ending transaction.
Specifically, also take the case that a game developer deploys a game for guessing a value on the parallel chain I, and a plurality of players create or participate in the game on the parallel chain I as an example:
in this embodiment, a guess value game contract SC developed by a game developernum2Compared with the above game contract SCnum1And a game ending interface I provided externally3
In step S101, Player A removes the calling game contract SCnum2The game opening interface creates a game, and acquires and calls a game ending interface I3And configuring a game ending triggering rule, a game result judging rule and an award issuing rule of the game, generating a game ending transaction, and sending the game ending transaction to the node of the parallel chain I.
For example, via game-ending interface I3Configuring a game ending triggering rule as that a player A sends a transaction to trigger the game ending, or automatically triggering the game ending if the transaction triggering the game ending is not received within a specified time; the game result judgment rule is configured to take the block creation time of the last block as a random seed, and a linear congruence method is used as a pseudo-random algorithm to generate a guessed number of the game; the award issuance rules are configured such that earlier guessed players can receive more awards when there are multiple winners; and so on.
The above rules are merely examples, and in further embodiments, a player creating a game may end game interface I3Within the allowed rangeAny rule is configured automatically, and the same technical effect can be realized; the above method may equally be applied to configuring game contracts for different games on different parallel chains, and to creating or participating in different games.
In the embodiment, the player who configures the rules manually writes contract codes of all the rules to configure the rules;
in a preferred embodiment, the game contract is further configured with a plurality of rule templates, and the player can acquire and call the rule templates through the game terminal to realize the rapid configuration of any one or more rules, so that the rule configuration can be completed without writing contract codes.
After receiving the game ending transaction, the node of the parallel chain I executes the game ending transaction through the virtual machine, and accepts other players to participate in the game through step S302 when the parameters such as the block height of the current block or the current time do not trigger the game ending triggering rule;
after triggering a game ending triggering rule according to parameters such as the block height of the current block or the current time, ending the game, generating a game result according to the guessing number of each player participating in the game and a preconfigured game result judging rule, issuing the rewards according to the game result and the preconfigured reward issuing rule, and recording the game result and the reward issuing result on a parallel chain I.
The preferred embodiment further configures the game ending interface for the deployed game contract, so that a player creating the game can configure a plurality of rules related to game ending in advance by calling the game ending interface, thereby greatly improving the degree of freedom of the decentralized block chain game and further improving the interest of the game; and furthermore, a plurality of rule templates are provided for the player to assist the player in quickly configuring the rules, so that the user experience of the player is improved.
However, the game mode allowing the game end rule to be freely configured raises the degree of freedom of the game, and brings a problem of fairness, for example, if the player a creating the game may maliciously write game rules which are beneficial to the player and very unfavorable to other players participating in the game, the other players need to read the contract code disclosed by the game on the parallel chain to judge whether the rules configured by the player a are fair, which may result in time cost and threshold increase of the players participating in the game, and is not favorable for promotion of the game.
To address this problem, the present invention further optimizes the solution provided by the present invention by configuring rule configuration inspection contracts on parallel chains:
FIG. 5 is a flow diagram of a preferred embodiment of the method shown in FIG. 1. As shown in fig. 5, in a preferred embodiment, the game deployment method applied to the first parallel-link node further includes:
a rule configuration audit contract for a first game is deployed on a first parallel chain. The audit contract may be deployed by a player, the operator of a node of the first parallel chain or the operator of the gaming terminal, among other parties.
Wherein the rule configuration review contract is for reviewing at least one of: the game end triggering rule, the game result judging rule and the reward issuing rule generate examination result information and record the examination result information on the first block chain for the second game terminal to obtain for reference.
Accordingly, as shown in fig. 6, the game deployment method applied to the main chain node corresponding to the node of the first parallel chain further includes:
receiving review result information, so that each node of a first parallel chain respectively acquires review result information of a first game from a corresponding main chain node for reference by the second game terminal, and each verification node of the first parallel chain respectively packs first block information of a first block and sends the first block information to the corresponding main chain node for recording the first block information on the main chain to identify the first block; wherein the first tile information includes review result information of the first game;
wherein the review result information is used by a rule configuration review contract to review at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule are generated and sent to the main chain node; the rule configuration review contract is deployed on the first parallel chain by a node of the first parallel chain.
As shown in fig. 7, in a preferred embodiment, the game method further includes:
invoking a rule configuration review contract for the first game to review at least one of: and generating examination result information according to the game ending triggering rule, the game result judging rule and the reward issuing rule, and acquiring the examination result information through the main chain record and the consensus so as to be convenient for the nodes of the first parallel chain to be acquired by the second game terminal for reference.
Further preferably, the rule configuration examination contract may further perform risk prompt in an examination result when fairness of the rule cannot be judged;
further preferably, the rule configuration audit contract may also add risk prompt information sent by other players through transactions to the audit result information.
The above-described embodiment further enables players participating in a game to quickly know about rules configured by a creating player without confirming fairness of the rules by looking at a code by configuring a rule configuration audit contract that audits the rules configured by the player on the first parallel chain.
In fig. 1, a second parallel chain is also configured, and the method for deploying the game by each node on the second parallel chain is the same as that of the first parallel chain, and will not be described repeatedly here.
Fig. 9 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
As shown in fig. 9, as another aspect, the present application also provides an apparatus 500 including one or more Central Processing Units (CPUs) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the apparatus 500 are also stored. The CPU501, ROM502, and RAM503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to an embodiment of the present disclosure, the method described in any of the above embodiments may be implemented as a computer software program. For example, embodiments of the disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method described in any of the embodiments above. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described herein.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (12)

1. A method for deploying a guessing game is characterized in that nodes on a parallel chain comprise verification nodes and non-verification nodes, and the method comprises the following steps:
deploying a first game contract of a first game on a first parallel chain, so that a plurality of first game terminals can obtain and call game opening interfaces of the first game contract to respectively create first games on the first parallel chain; the first game contract is also used for a plurality of second game terminals to obtain and call a game participation interface of the first game contract so as to respectively participate in the first game on the first parallel chain;
sending a first game contract of a first game to a corresponding main chain node, so that each node of a first parallel chain obtains and executes the first game contract of the first game from the corresponding main chain node, respectively packaging first block information of a first block by each verification node of the first parallel chain, sending the first block information to the corresponding main chain node, so as to record the first block information to the main chain, and verifying whether block information which is not less than a first threshold number is the same in the first block information, if so, the first block is commonly identified by the main chain, and a commit identifier for authentication is configured for the first block of the first parallel chain; wherein the first block information includes an execution result of a first game contract of the first game.
2. The method of claim 1, wherein the first game contract is further configured with a game ending interface for the first game terminal to acquire and invoke to generate a game ending transaction configured with at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule.
3. The method of claim 2, wherein the first game contract is further configured with a number of rule templates for the first game terminal to retrieve and invoke to quickly configure at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule.
4. The method of claim 2 or 3, further comprising:
deploying a rule configuration review contract for the first game on the first parallel chain;
wherein the rule configuration review contract is for reviewing at least one of: the game end triggering rule, the game result judging rule and the reward issuing rule generate examination result information and send the examination result information to a corresponding main chain node, so that each node of a first parallel chain can respectively obtain and execute the examination result information from the corresponding main chain node, each verification node of the first parallel chain respectively packages first block information of a first block and sends the first block information to the corresponding main chain node for recording the first block information onto the main chain, and verifies whether block information which is not less than a first threshold number is the same in the first block information, if yes, the first block is commonly identified by the main chain, and a mit identifier for authentication is configured for the first block of the first parallel chain; for the second gaming terminal to obtain for reference; wherein the first block information includes the examination result information.
5. The method according to any one of claims 1-3, further comprising:
sending a first game creation transaction, a first game participation transaction, a game ending transaction and a rule configuration examination contract to corresponding main chain nodes, so that each node of a first parallel chain can respectively obtain and execute the first game creation transaction, the first game participation transaction, the game ending transaction and the rule configuration examination contract from the corresponding main chain node, each verification node of the first parallel chain respectively packages first block information of a first block and sends the first block information to the corresponding main chain node so as to record the first block information onto the main chain, and whether block information which is not less than a first threshold number is identical in the first block information is verified, if yes, the first block is commonly identified by the main chain, and a commit identifier for authentication is configured for the first block of the first parallel chain; wherein the first tile information comprises the first game creation transaction, a first game participation transaction, a game end transaction, and a rule configuration review contract; the first game creation transaction is generated when a plurality of first game terminals acquire and call game opening interfaces to respectively create first games; the first game participation transaction is generated when the plurality of second game terminals acquire and call the game participation interfaces to participate in the first game respectively.
6. A method for deploying a guessing game is characterized in that nodes on a parallel chain comprise verification nodes and non-verification nodes, and the method comprises the following steps:
receiving a first game contract of a first game, wherein the first game contract of the first game is deployed on a first parallel chain by nodes of the first parallel chain, so that each node of the first parallel chain acquires and executes a first game contract of the first game from a corresponding main chain node, each verification node of the first parallel chain packages first block information of a first block and sends the first block information to the corresponding main chain node, so that the first block information is recorded on the main chain, whether block information which is not less than a first threshold number is the same in the first block information is verified, if yes, the first block is identified by the main chain, and a commit mark for authentication is configured for the first block of the first parallel chain; wherein the first block information includes an execution result of a first game contract of the first game;
receiving, recording and commonly recognizing the first block and information thereof;
the game starting interfaces are configured on the first game contract of the first game, so that a plurality of first game terminals can acquire and call the game starting interfaces to respectively create the first game;
the first game contract of the first game is also provided with game participation interfaces, so that a plurality of second game terminals can acquire and call the game participation interfaces to participate in the first game respectively.
7. The method of claim 6, wherein the first game contract is configured with a number of rule templates for the first game terminal to retrieve and invoke to quickly configure at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule.
8. The method of claim 6, wherein the first game contract is configured with a game ending interface for retrieval and invocation by the first game terminal to generate a game ending transaction configured with at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule.
9. The method of claim 7 or 8, further comprising:
receiving audit result information, so that each node of a first parallel chain acquires the audit result information of a first game from a corresponding main chain node, each verification node of the first parallel chain packs first block information of a first block respectively and sends the first block information to the corresponding main chain node so as to record the first block information to the main chain, and verifying whether the block information with the number not less than a first threshold value is the same in the first block information, if so, the first block is identified by the main chain, and a commit identifier for authentication is configured for the first block of the first parallel chain; wherein the examination result information is also used for the second game terminal to obtain for reference; wherein the first tile information includes review result information of the first game;
wherein the review result information is used by a rule configuration review contract to review at least one of: the game ending triggering rule, the game result judging rule and the reward issuing rule are generated and sent to the main chain node; the rule configuration review contract is deployed on the first parallel chain by a node of the first parallel chain.
10. The method of claim 9, further comprising:
receiving a first game creation transaction, a first game participation transaction, a game ending transaction and a rule configuration examination contract to corresponding main chain nodes, so that each node of a first parallel chain can respectively obtain and execute the first game creation transaction, the first game participation transaction, the game ending transaction and the rule configuration examination contract from the corresponding main chain node, wherein each verification node of the first parallel chain respectively packages first block information of a first block and sends the first block information to the corresponding main chain node so as to record the first block information to the main chain, and verifies whether the block information not less than a first threshold number is the same in the first block information, if yes, the first block is commonly identified by the main chain, and a commit identifier for authentication is configured for the first block of the first parallel chain; wherein the first tile information comprises the first game creation transaction, a first game participation transaction, a game end transaction, and a rule review contract; the first game creating transaction is generated when a plurality of first game terminals acquire and call game opening interfaces to respectively create first games and is sent to nodes of a first parallel chain; the first game participation transaction is generated when the plurality of second game terminals acquire and call the game participation interfaces to participate in the first game respectively and is sent to the nodes of the first parallel chain.
11. A computer device, the device comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-10.
12. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-10.
CN201811151670.8A 2018-09-29 2018-09-29 Forecast guess game deployment method and game method, equipment and storage medium Active CN109395392B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811151670.8A CN109395392B (en) 2018-09-29 2018-09-29 Forecast guess game deployment method and game method, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811151670.8A CN109395392B (en) 2018-09-29 2018-09-29 Forecast guess game deployment method and game method, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109395392A CN109395392A (en) 2019-03-01
CN109395392B true CN109395392B (en) 2022-03-04

Family

ID=65465660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811151670.8A Active CN109395392B (en) 2018-09-29 2018-09-29 Forecast guess game deployment method and game method, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109395392B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111695991B (en) * 2019-03-14 2024-02-06 北京沃东天骏信息技术有限公司 Block-based contract processing method and device, block chain node and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107423962A (en) * 2017-07-11 2017-12-01 成都励睿德企业管理有限公司 Data block chain mandate based on rewards and punishments participates in the Byzantine failure tolerance method and its rewards and punishments method of common recognition
CN107563761A (en) * 2017-08-26 2018-01-09 复旦大学 Game account management method based on block chain
TW201803634A (en) * 2016-07-22 2018-02-01 碩網資訊股份有限公司 A virtual game currency system using blockchain and method thereof
CN107742210A (en) * 2017-10-13 2018-02-27 布比(北京)网络技术有限公司 Across the chain fund transfer system and method for a kind of different blocks interchain
CN108108487A (en) * 2018-01-10 2018-06-01 杭州复杂美科技有限公司 A kind of common recognition method of block chain
CN108434745A (en) * 2018-03-27 2018-08-24 北京知道创宇信息技术有限公司 Game data processing method and system
CN109395394A (en) * 2018-09-29 2019-03-01 杭州复杂美科技有限公司 Predict guessing game dispositions method and method for gaming, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10380842B2 (en) * 2016-10-26 2019-08-13 International Business Machines Corporation Blockchain gaming

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201803634A (en) * 2016-07-22 2018-02-01 碩網資訊股份有限公司 A virtual game currency system using blockchain and method thereof
CN107423962A (en) * 2017-07-11 2017-12-01 成都励睿德企业管理有限公司 Data block chain mandate based on rewards and punishments participates in the Byzantine failure tolerance method and its rewards and punishments method of common recognition
CN107563761A (en) * 2017-08-26 2018-01-09 复旦大学 Game account management method based on block chain
CN107742210A (en) * 2017-10-13 2018-02-27 布比(北京)网络技术有限公司 Across the chain fund transfer system and method for a kind of different blocks interchain
CN108108487A (en) * 2018-01-10 2018-06-01 杭州复杂美科技有限公司 A kind of common recognition method of block chain
CN108434745A (en) * 2018-03-27 2018-08-24 北京知道创宇信息技术有限公司 Game data processing method and system
CN109395394A (en) * 2018-09-29 2019-03-01 杭州复杂美科技有限公司 Predict guessing game dispositions method and method for gaming, equipment and storage medium

Also Published As

Publication number Publication date
CN109395392A (en) 2019-03-01

Similar Documents

Publication Publication Date Title
CN109395394B (en) Forecast guess game deployment method and game method, equipment and storage medium
CN109395393B (en) Game deployment method based on parallel chain, game method, game device and storage medium
Teutsch et al. A scalable verification solution for blockchains
CN110064202B (en) Game method, equipment and storage medium
CN109360091B (en) Random object selection method and device based on block chain
US9318001B2 (en) Methods and apparatus for a distributed bonus scheme using simulated scatter reactions
CN109481936A (en) A kind of block chain accounting nodes selection method, device and computer readable storage medium
CN110163590A (en) Payment based on block chain withholds method and device, electronic equipment, storage medium
CN108804706A (en) A kind of block chain data processing method, device, equipment and storage medium
CN110599179B (en) Risk control method and related equipment based on blockchain system
CN108831001B (en) Block chain-based node random selection method, system, node and electronic equipment
CN109499069A (en) Operating result method of calibration, device, storage medium and electronic device
CN112015822B (en) Block chain data deleting method and device
CN109395392B (en) Forecast guess game deployment method and game method, equipment and storage medium
US11495088B2 (en) System and method for authenticating storage media within an electronic gaming system
CN110460471A (en) A kind of super node polling method, device and storage medium
CN109432780B (en) Game deployment method based on parallel chain, game method, game device and storage medium
CN110941680B (en) Data processing method, device and storage medium
CN109598365A (en) Event prediction method and device, electronic equipment
CN113269543A (en) Multilayer mixed transaction capacity expansion system and method for block chain
CN112070503A (en) Contract execution method, device, equipment and storage medium based on block chain
US20170208132A1 (en) Dynamic endpoint resolution wagering system
CN115720227A (en) Election method and device for consensus nodes of block chain and electronic equipment
CN117009626A (en) Service processing method, device, equipment and storage medium of game scene
CN113592477A (en) Cross-chain asset transfer method, computer device, and storage medium

Legal Events

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