Data processing method, device and electronic device in chess and card games

By using blockchain contract algorithm to determine the initial card order in the chess and card game client, the problem of malicious interference in the reshuffle process caused by centralized servers is solved, and the decentralized and secure initial card order is achieved.

CN111282280BActive Publication Date: 2025-05-02TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010084139.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-02-10
Publication Date
2025-05-02
Estimated Expiration
2040-02-10

AI Technical Summary

Technical Problem

In the prior art, the shuffle process caused by the centralized server reshuffle according to the setting rules is maliciously interfered with.

Method used

By calling the contract algorithm in the blockchain in the client of the chess and card game, the initial card order in the game is determined based on the game credentials of each game player, and the decentralization and immutability of the blockchain are used to ensure the security of the shuffle process.

Benefits of technology

Decentralized determination of the initial card order is achieved, avoiding the problem of malicious interference in the reshuffle process, and enhancing the safety and fairness of the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111282280B_ABST
    Figure CN111282280B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a data processing method and device in a chess and card game, which is applied to a client, and the method includes: receiving game credentials broadcasted by other game players in the game, the game credentials are related to the player identification of the corresponding game player and the start time of the game; calling the contract algorithm in the blockchain; through the contract algorithm, determining the initial card order in the game according to the game credentials of the game player corresponding to the client in the game and the game credentials of the other game players. Since the game credentials are related to the start time of the game, and the initial card order is determined according to the game credentials by calling the contract algorithm in the blockchain, the situation of malicious interference in the determination process of the initial cards is avoided, and the initial card order is determined in a decentralized manner.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and more specifically, to a method, device and electronic device for processing game data in a chess and card game. Background Art

[0002] During the card game, after shuffling, the initial order of the cards in the deck is determined, that is, the initial card order is determined, so that the cards are dealt to the game players based on the determined initial card order.

[0003] In existing card game platforms, centralized servers are relied upon to provide services to various game clients. The services provided by centralized servers include shuffling cards according to set rules to determine the initial card order. Since shuffling cards depends on the rules set in the centralized server, if the rules set in the server are maliciously tampered with, the cards will be shuffled according to the tampered rules, resulting in malicious interference in the shuffling process.

[0004] Therefore, how to solve the problem in the prior art that the shuffling process is maliciously interfered with by a centralized server according to set rules is a technical problem that needs to be solved urgently in the prior art. Summary of the invention

[0005] The embodiments of the present application provide a data processing method, device and electronic device in a chess and card game, thereby solving the problem of malicious interference in the shuffling process existing in the prior art at least to a certain extent.

[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0007] According to one aspect of an embodiment of the present application, a data processing method in a chess and card game is provided, which is applied to a client, and the method includes: receiving game credentials broadcasted by other game players in the game round, wherein the game credentials are related to the player identification of the corresponding game player and the start time of the game round; calling the contract algorithm in the blockchain; and determining, through the contract algorithm, the initial card order in the game round according to the game credentials of the game player corresponding to the client in the game round and the game credentials of the other game players.

[0008] According to one embodiment of the present application, before receiving the game credentials broadcasted by other game players in the game round, the method also includes: after starting the game round, obtaining the start time of the game round; generating its own game credentials in the game round according to the player identifier of the game player corresponding to the client and the start time of the game round.

[0009] According to an embodiment of the present application, after generating the game credential of the client in the game according to the player identifier of the game player corresponding to the client and the start time of the game, the method further includes:

[0010] According to the game room where the client is located, the generated game credential is broadcasted to other game players in the game room.

[0011] According to one embodiment of the present application, generating the game credentials of the client in the game game based on the player identification of the game player corresponding to the client and the start time of the game game includes: performing a hash operation on the player identification of the game player corresponding to the client to obtain a first hash value; using the first hash value as a key, encrypting the start time of the game game, and using the encryption result as the game credentials of the client in the game game.

[0012] According to one embodiment of the present application, the initial card order in the game round is determined by the contract algorithm according to the game credentials of the game player corresponding to the client in the game round and the game credentials of the other game players, including: determining the target parameter according to the game credentials of the game player corresponding to the client and the game credentials of the other game players; performing a hash operation on the target parameter to obtain a second hash value; taking the second hash value as the dividend and the sequence number of the card as the divisor, performing a modulo operation according to the second hash value and the sequence number of the card to obtain the parameter value corresponding to each sequence number; determining the card corresponding to the sequence number according to the card information mapped by the parameter value.

[0013] According to one embodiment of the present application, determining the target parameter based on the game credentials of the game player corresponding to the client and the game credentials of the other game players includes: performing an XOR operation on the game credentials of each game player in the game round, and using the XOR result as the target parameter.

[0014] According to one embodiment of the present application, determining the target parameters based on the game credentials of the game player corresponding to the client and the game credentials of the other game players includes: obtaining the hash value of the latest generated block in the blockchain; performing an XOR operation on the game credentials of each game player in the game game and the hash value of the latest generated block, and using the XOR result as the target parameter.

[0015] According to one embodiment of the present application, the method further includes: after the game round ends, the game result of the game round, the game credentials of each game player in the game round, and the data indicating the initial card order are associated and stored in the blockchain.

[0016] According to one aspect of an embodiment of the present application, a data processing device in a chess and card game is provided, which is applied to a client, and the device includes:

[0017] A game credential acquisition module, used to receive game credentials broadcasted by other game players in the game session, wherein the game credentials are related to the player identification of the corresponding game player and the start time of the game session;

[0018] A calling module, used to call the contract algorithm in the blockchain;

[0019] The determination module is used to determine the initial card order in the game game according to the game credentials of the game player corresponding to the client in the game game and the game credentials of the other game players through the contract algorithm.

[0020] According to one aspect of an embodiment of the present application, there is provided an electronic device, including:

[0021] Processor; and

[0022] A memory having computer-readable instructions stored therein, wherein the computer-readable instructions, when executed by the processor, implement the method as described above.

[0023] In the technical solutions provided in some embodiments of the present application, the client where the game players are located determines the initial card order in the game round by calling the contract algorithm in the blockchain and the game credentials of each game player in the game round. On the one hand, based on the decentralization and immutability of the blockchain, the contract algorithm in the blockchain is guaranteed to be tamper-proof, and the game credentials of each game player in the game round are related to the player identification and the time of entering the game round, which is equivalent to the game credentials of the game players being generated in real time. The security of the process of determining the initial card order is guaranteed by the tamper-proof contract algorithm and the real-time generated game credentials, avoiding the problem of malicious interference.

[0024] On the other hand, since the initial card order in the game is determined by the client where the game players are located, decentralized determination of the initial card order is achieved, thus avoiding the problem of malicious interference in the shuffling process in the existing technology from the source.

[0025] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0027] Figure 1 A schematic diagram of a blockchain system to which the technical solution of the embodiments of the present application can be applied is shown;

[0028] Figure 2 A schematic diagram of a blockchain according to an embodiment is shown;

[0029] Figure 3 is a schematic diagram of an implementation environment of the present disclosure shown in an embodiment;

[0030] Figure 4 is a flow chart of a data processing method in a chess and card game according to an embodiment;

[0031] Figure 5 yes Figure 4 The flowchart of the steps before step 410 in the corresponding embodiment in an embodiment;

[0032] Figure 6 yes Figure 5 A flowchart of step 530 of the corresponding embodiment in one embodiment;

[0033] Figure 7 yes Figure 5 A flowchart of the steps after step 530 of the corresponding embodiment in one embodiment;

[0034] Figure 8 yes Figure 4 A flowchart of step 450 of the corresponding embodiment in one embodiment;

[0035] Fig. 9 yes Figure 8 A flowchart of step 810 of the corresponding embodiment in one embodiment;

[0036] Fig.10 is a flow chart of a data processing method in a chess and card game according to a specific embodiment;

[0037] Fig.11 is a block diagram of a data processing device in a chess and card game according to an embodiment;

[0038] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0039] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.

[0040] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0041] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0042] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0043] See also Figure 1 , Figure 1 It is an optional structural diagram of the blockchain system 100 provided in an embodiment of the present invention. The blockchain system 100 includes a distributed system formed by connecting multiple nodes 110 in the form of network communication, wherein the node 110 can be any form of computing device (such as a server, user terminals such as smart phones, and other electronic devices) connected to the network.

[0044] The nodes 110 form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP). In this system, any machine such as a server or a terminal can join and become a node. The node includes a hardware layer, an intermediate layer, an operating system layer, and an application layer. Each node 110 includes the same blockchain.

[0045] See also Figure 1The functions of each node in the blockchain system 100 shown include:

[0046] 1) Routing: a basic function of a node, used to support communication between nodes.

[0047] In addition to the routing function, the node can also have the following functions:

[0048] 2) Applications, which are deployed in the blockchain to implement specific businesses according to actual business needs, record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system. The record data, such as game player's game credentials, game results, etc., are used by other nodes to add the record data to the block when the source and integrity of the record data are successfully verified.

[0049] The services implemented by the application may include:

[0050] 1) Contract algorithm, a computerized protocol that can execute the terms of a contract, is implemented by code deployed on a node for execution when certain conditions are met. The smart contract can also be a contract that processes received information, such as generating data indicating the initial card order based on the game credentials of each game player, which is not specifically limited here.

[0051] 2) Blockchain, including a series of blocks that are connected to each other in the order of their generation. Once a new block is added to the blockchain, it will not be removed. The block records the data submitted by the nodes in the blockchain system. The record data can be the game credentials of game players, the game results in the game, etc.

[0052] See also Figure 2 , Figure 2 This is an optional schematic diagram of a blockchain provided by an embodiment of the present invention. Each block includes data, a hash value of the current block (the hash value of the current block), and a hash value of the previous block. Each block is connected by a hash value to form a blockchain. In addition, the block may also include information such as a timestamp when the block was generated. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains relevant information for verifying the validity of its information (anti-counterfeiting) and generating the next block.

[0053] Figure 3 FIG. 1 is a schematic diagram of an implementation environment of the present disclosure according to an embodiment. Figure 3As shown, the environment of this embodiment includes a game platform 310 and a blockchain system 100. The game platform 310 can be a chess game platform or a card game platform. The game platform 310 includes a server 310 that provides services for the game client and a terminal 311 where the game client is located.

[0054] The terminal 311 may be a smart phone, tablet computer, laptop computer, desktop computer, or the like that can communicate with the server and run the client program in the game platform.

[0055] The terminal 311 where the game client is located implements the method of the present disclosure by interacting with the server 312 in the game platform and the node 110 in the blockchain system 100. It is worth mentioning that the service provided by the server in the game platform of the present disclosure to the game client does not include the service of determining the initial card order for the client.

[0056] The implementation details of the technical solution of the embodiment of the present application are described in detail below:

[0057] Figure 4 1 is a flow chart of a data processing method in a chess and card game according to an embodiment, and the method is applied to a client in the chess and card game. Figure 4 As shown, the data processing method in the chess and card game at least includes steps 410 to 450, which are described in detail as follows:

[0058] Step 410, receiving game credentials broadcasted by other game players in the game session, where the game credentials are related to the player ID of the corresponding game player and the start time of the game session.

[0059] Chess and card games are a general term for board games and card games. Card games include poker, Landlord, Mahjong, etc., and chess games include Chinese chess, military chess, etc.

[0060] The client used to execute the method disclosed herein is a terminal corresponding to a game client of a chess and card game, for example Figure 3 The terminal 311 in. For example, if the chess and card game is a Landlord game, then the client is a client of the Landlord game application.

[0061] In chess and card games, before players officially play against each other in each game, they need to determine the initial card order in the game. The initial card order indicates the order of each card involved in the game.

[0062] Simply put, in card games, the process of determining the initial card order in the game is the process of shuffling. Then, based on the determined initial card order, cards are dealt to each player, and the corresponding players can know the cards (or chess pieces) they hold.

[0063] The game round of the present disclosure refers to a game round in a chess and card game. Each game round involves at least two game players, so there are at least two game players in the game round. In chess and card games, players interact with other players' clients through a client. It can be understood that each game player interacts with other players' game clients or servers through his own client.

[0064] The player identification of a game player is used to identify the game player. The player identification may be the game player's account number in the game application, the ID number of the corresponding registered player, a random number generated for the game player, or the device identification number of the computer device where the client is located, such as the SN code (Serial Number) and the IMEI number (International Mobile Equipment Identity). Of course, the above examples of player identification are only illustrative examples, and other identification information that can identify game players may also be used, which is not specifically limited here.

[0065] The start time of a game session is used to indicate the time when the game session starts. It is understandable that the start time of a game session is different in multiple game sessions participated by the same game player.

[0066] Game credentials refer to credential data used to indicate that a game player participates in a game round. In the solution disclosed herein, the game credentials of a game player are related to the player ID of the game player and the start time of the game round in which the game player is located. That is, changes in the player ID and / or changes in the start time will result in changes in the game credentials. Therefore, in this solution, the game credentials of the game player change correspondingly with changes in the game round in which the game player is located, thereby achieving real-time generation of the game credentials of the game player according to the game round in which the game player joins.

[0067] Each game player can participate in the next game round after a game round ends. Therefore, the game round that the game player joins can be accurately indicated by the game credentials related to the player's player identification and the start time of the game round.

[0068] It is understandable that, before step 410, the client of each game player participating in the game session generates its own game credentials according to the player ID of the corresponding game player and the start time of the game session, and broadcasts the generated game credentials to other game players in the game session, so that any game player in the game session can obtain the game credentials of other game players in the game session. Through this process, the game players in the game session can exchange game credentials.

[0069] Step 430, calling the contract algorithm in the blockchain.

[0070] Step 450, through the contract algorithm, determine the initial card order in the game game according to the game credentials of the game player corresponding to the client in the game game and the game credentials of the other game players.

[0071] For card games, the initial card order refers to the order of the cards before they are dealt, and the process of determining the initial card order implemented by steps 410-450 is equivalent to the process of shuffling. For chess games, the initial card order refers to the order of the chess pieces before they are distributed to the players.

[0072] The contract algorithm is an algorithm configured for the order of the cards in the game. In a specific embodiment, a blockchain interface is integrated in the client, so that the client calls the contract algorithm from the blockchain of any node in the blockchain system through its own integrated blockchain interface.

[0073] It is understandable that the input parameters of the contract algorithm at least include the game credentials of each game player in the game. Therefore, on this basis, through the contract algorithm, the initial card order in the game is determined according to the game credentials of each game player in the game.

[0074] Furthermore, since the number of chess pieces or cards in different types of chess and card games is different, the initial card order is related to the number of chess pieces (or the number of cards). Therefore, the input parameters of the contract algorithm may also include the number of chess pieces (or the number of cards). In the scheme disclosed herein, after obtaining the game credentials of other game players in the game and its own game credentials, the client corresponding to the game player participating in the game game determines the initial card order in the game game by calling the contract algorithm in the blockchain according to the game credentials of each game player in the game game. On the one hand, the contract algorithm is stored in the cross-chain to ensure the immutability of the contract algorithm. On the other hand, the game credentials of the game player are related to the player identification of the game player and the start time of the game game, which is equivalent to the game credentials being generated in real time. Based on the above two reasons, the security of the process of determining the initial card order in the game game is guaranteed, and the process of determining the initial card order can be effectively prevented from being maliciously interfered with. If this method is applied to card games, the problem of malicious interference in the shuffling process in the prior art can be solved.

[0075] Furthermore, in the disclosed solution, the initial card order is determined by any client in the game round, thereby achieving decentralization to determine the initial card order. Since it does not rely on a centralized server to determine the initial card order in the game round according to set rules, it can avoid the problem of malicious tampering of the shuffling process in the prior art, and further avoid the occurrence of game cheating by tampering with the rules in the centralized server to change the initial card order in the game round.

[0076] In one embodiment, if Figure 5 As shown, before step 410, the method further includes:

[0077] Step 510, after starting the game round, obtain the start time of the game round.

[0078] Step 530, generating a game credential for the client in the game according to the player ID of the game player corresponding to the client and the start time of the game.

[0079] After generating the game credential of the current game round of the game player according to the player ID of the game player corresponding to the client and the start time of the game round, the correlation between the game credential and the player ID and the start time of the game round can be ensured.

[0080] It is understandable that other game players in the game round also generate their own game credentials in the game round through the above steps 510-530, so that the client executing the method disclosed in the present invention can correspondingly receive the game credentials broadcasted by other game players.

[0081] If the game player enters the next game, the start time of the game will change. Therefore, the game credentials need to be generated again according to the game player's player ID and the start time of the new game, and stored in the blockchain accordingly, so that the game player's game credentials change with the changes in the game game the game player joins.

[0082] In one embodiment, if Figure 6 As shown, step 530 includes:

[0083] Step 610: Perform a hash operation on the player identifier of the game player corresponding to the client to obtain a first hash value.

[0084] Step 630, using the first hash value as a key, encrypting the start time of the game round, and using the encryption result as the game credential in the game round.

[0085] The hash operation in step 610 is performed by a hash function, such as MD5, MD4, SHA256, etc. The first hash value obtained by performing the hash operation on the player identification is used as the unique identification code of the game player.

[0086] The generation of game credentials is achieved through the above process.

[0087] In another embodiment, a node in the blockchain system generates an encryption key for the game player, so that the game player encrypts the player identification and the start time of the game round through the key generated by the node, and uses the encryption result as the game credential of the corresponding game player in this game round.

[0088] In another embodiment, if Figure 7 As shown, after step 530, the method further includes:

[0089] Step 550, broadcast the generated game credentials to other game players in the game room according to the game room where the client is located. The game room is a virtual room for playing games provided by the server corresponding to the chess and card game. After receiving game requests from multiple game players, the server allocates an idle game room to the multiple game players after the number of game players meets the set requirements. After joining a game room, the game player can play one or more games in the game room.

[0090] Since the game players can start the game round only after entering the game room, the game players in the game round can be determined according to the game room where the client is located.

[0091] It is worth mentioning that in the solution disclosed herein, the server corresponding to the game application does not provide the client with a service for determining the initial card order. Instead, the client of the game application determines the initial card order based on the game credentials of each game player in the blockchain and the contract algorithm.

[0092] The game players participating in the game are determined according to the game room, so that the game players in the game room are used as broadcast objects to broadcast the generated game credentials. Correspondingly, each game player in the game room can receive the game credentials broadcasted by other game players, thus realizing the exchange of game credentials among the game players in the game.

[0093] Since the game credentials of a game player are related to the player identification and the start time of the game round, if a game player participates in multiple game rounds, the game credentials in each game round are different.

[0094] In one embodiment, if Figure 8As shown, step 450 includes:

[0095] Step 810: Determine target parameters based on the game credentials of the game player corresponding to the client and the game credentials of other game players. In the solution disclosed in the present invention, the determination of the target parameters is related to the game credentials of each game player in the game.

[0096] After obtaining the game credentials of each game player in the current game session, numerical or logical operations may be performed on the game credentials of each game player to determine the target parameter.

[0097] In one embodiment, an XOR operation is performed on the game credentials of each game player in the game round, and the XOR result is used as the target parameter.

[0098] For example, if the game players participating in the game round include A, B, C, and D, where the game credential of game player A in the game round is T1, the game credential of B in the game round is T2, the game credential of C in the game round is T3, and the game credential of D in the game round is T4, then the target parameter = T1 XOR T2 XOR T3 XOR T4, where XOR represents an exclusive OR operation.

[0099] Step 830: Perform a hash operation on the target parameter to obtain a second hash value.

[0100] Step 850, using the second Hash value as the dividend and the serial number of the card as the divisor, performing a modulo operation based on the second Hash value and the serial number of the card to obtain parameter values ​​corresponding to each serial number.

[0101] In chess and card games, multiple chess pieces or cards are involved, and the initial card serial number is used to indicate the order of the multiple chess pieces or cards.

[0102] For example, in the Landlord game, there are 54 cards in total, and the initial card sequence is used to indicate the sequence of the 54 cards. Therefore, the initial card sequence includes 54 sequence numbers, namely 1-54.

[0103] For another example, in a simplified version of Mahjong game, a total of 136 cards are included, and the initial card sequence is used to indicate the sequence of the 136 cards. Correspondingly, the initial card sequence includes 136 sequence numbers, namely 1-136.

[0104] Therefore, in step 850, the serial number is taken according to the number of cards or chess pieces involved in the game, and each serial number is used as a divisor, and the divisor is modulo operated with the dividend, and the result of the modulo operation is used as the parameter value of the corresponding serial number.

[0105] Specifically, assuming the target parameter is Q and the parameter value is K, then K = Q mod N, where N = 1, 2, 3, 4, ... n, and n is the total number of cards or pieces in the game. Calculate each value corresponding to N according to this formula to get the parameter value of the corresponding sequence number.

[0106] Step 870, determine the card face corresponding to the sequence number according to the card face information mapped by the parameter value.

[0107] In order to determine the initial card order, a mapping relationship between parameter values ​​and card information is constructed, so that, based on the mapping relationship, the card information mapped to the parameter value corresponding to each sequence number is determined, and the card information is used to indicate the corresponding card. Correspondingly, the card of the sequence number is determined based on the card information.

[0108] Continuing the above example, the game is a simplified version of Mahjong, then n = 136. Based on K = Q mod N:

[0109] If N=1, K=4 is calculated, wherein the card face information mapped by parameter value 4 indicates that the card face is 10,000, and the card face of the card with sequence number 1 is 10,000.

[0110] If N=3, K=6 is calculated, wherein the card face information mapped by the parameter value 6 indicates that the card face is three of a kind, and the card face of the card with the sequence number 3 is three of a kind.

[0111] In a specific embodiment, in order to realize the mapping between parameter value and card information, the card information is stored in an array, and the parameter value is used to indicate the address of the element in the array. Therefore, after determining the parameter value, the element in the array is determined according to the address corresponding to the parameter value, so that the card information stored in the element is the card information mapped by the parameter value. In other words, the mapping process of parameter value→address→element in the array→card information is realized.

[0112] In another embodiment, if Fig. 9 As shown, step 810 includes:

[0113] Step 910, obtain the hash value of the latest generated block in the blockchain.

[0114] Step 930, perform an XOR operation on the game credentials of each game player in the game and the hash value of the latest generated block, and use the XOR result as the target parameter.

[0115] As described above, each block in the blockchain not only stores the hash value of the previous block it is linked to, but also stores the hash value of the current block. Therefore, the hash value of the latest generated block can be obtained from the blockchain.

[0116] For example, if the game players participating in the game include A, B, C, and D, where the game credential of game player A in the game is T1, the game credential of B in the game is T2, the game credential of C in the game is T3, and the game credential of D in the game is T4, and the hash value of the latest generated block in the blockchain is P, then the target parameter = T1 XOR T2XOR T3 XOR T4 XOR P, where XOR represents an exclusive OR operation. In this embodiment, an exclusive OR operation is performed by adding the hash value of the latest generated block, and the hash value of the latest generated block and the game data of each game player in the game are used as influencing factors of the target parameter, which increases the influencing factors for determining the target parameter and further ensures the uniqueness of the target parameter.

[0117] In other embodiments, the random number may be XORed with the game credentials of each game player to determine the target parameter, which is not specifically limited here.

[0118] In one embodiment, the method further comprises:

[0119] After the game is over, the game results of the game, the game credentials of each player in the game, and the data indicating the initial card order are associated and stored in the blockchain.

[0120] It is understood that the game result of a game session at least indicates the winning game players and the losing game players in the game session.

[0121] In a game, when the victory condition is met, the game ends. At this time, the game result of the game, the game credentials of each player in the game, and the data indicating the initial card order are reported to the node in the blockchain system, and the node stores these three data in association in the blockchain.

[0122] By associating and storing the game results of a game round, the game credentials of each player in the game round, and the data indicating the initial card order in the blockchain, it is convenient to review and trace the game process in the game round.

[0123] For ease of description, the game results in a game round, the game credentials of each game player in the game round, and the data used to indicate the initial card sequence are referred to as game data in the corresponding game round.

[0124] In one embodiment, during the replay tracing process, if it is necessary to trace the game credentials of a game player in a target game round, the game player's player ID and the target time in the corresponding target game round can be used as the boundary to determine the latest game data of the game player before the target time. The determined latest game data is the game data of the game player in the target game round that needs to be obtained.

[0125] In one embodiment, while the above three types of data are stored in the blockchain, the three types of data are also stored locally on the client corresponding to the game player, thereby facilitating the timely acquisition of game data.

[0126] In one embodiment, the game records in the game can also be stored in the blockchain. The game records are used to indicate the game situation of the game players in the game, such as indicating the cards held by each game player and the cards played by the game player in each game. The game record is stored in the blockchain as a component of the game data, in association with the game results in the game, the game credentials of each game player in the game, and the data indicating the initial card sequence, so as to facilitate the tracing and replay of the game process. Furthermore, the above four types of data can also be stored in association in the local client where the game player is located.

[0127] The method of the present disclosure is further described below with reference to a specific embodiment.

[0128] Fig.10 is a flow chart of a data processing method in a chess and card game according to a specific embodiment. Fig.10 As shown, the method includes:

[0129] Step 1010: The client generates an encryption key according to the player identifier, which may be an account number, SN number, random number, IMEI number, etc.

[0130] Step 1020, encrypt the start time of the game according to the encryption key, obtain the game credentials, and broadcast the game credentials to other game players.

[0131] Step 1030, obtaining the game credentials of each game player in the game game, and obtaining the hash value of the latest generated block from the blockchain.

[0132] Step 1040, generating target data for the current game round according to the game credentials of each game player and the hash value of the latest generated block, wherein the target data is used to indicate the initial card order in the current game round.

[0133] Step 1050, during the game, monitor whether any game player has reached the victory condition, if so, execute step 1060, if not, continue monitoring.

[0134] Step 1060, the game results, target data, and game credentials of each game player in the game session are associated and stored in the game player's client and blockchain to ensure the traceability of the game process.

[0135] The following describes an apparatus embodiment of the present application, which can be used to execute the method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned method embodiment of the present application.

[0136] The present disclosure provides a data processing device 1100 in a chess and card game, which is applied to a chess and card game client, such as Fig.11 As shown, the device comprises:

[0137] The game credential acquisition module 1110 is used to receive game credentials broadcasted by other game players in the game round, where the game credentials are related to the player identification of the corresponding game player and the start time of the game round.

[0138] The calling module 1130 is used to call the contract algorithm in the blockchain.

[0139] The determination module 1150 is used to determine the initial card order in the game game according to the game credentials of the game player corresponding to the client in the game game and the game credentials of the other game players through a contract algorithm.

[0140] In one embodiment, the device further comprises:

[0141] The start time acquisition module is used to obtain the start time of the game after the game is started.

[0142] The game credential generation module is used to generate its own game credential in the game game according to the player identification of the game player corresponding to the client and the start time of the game game.

[0143] In one embodiment, the device further comprises:

[0144] The broadcast module is used to broadcast the generated game credentials to other game players in the game room according to the game room where the client is located.

[0145] In one embodiment, the game credential generation module includes:

[0146] The first hash value obtaining unit is used to perform a hash operation on the player identification of the game player corresponding to the client to obtain a first hash value.

[0147] The game credential generating unit is used to encrypt the start time of the game round by using the first hash value as a key, and use the encryption result as the game credential of the game round.

[0148] In one embodiment, the determination module includes:

[0149] The target parameter determination unit is used to determine the target parameter according to the game credentials of the game player corresponding to the client and the game credentials of other game players.

[0150] The hash operation unit is used to perform a hash operation on the target parameter to obtain a second hash value.

[0151] The modulo operation unit is used to use the second Hash value as the dividend and the serial number of the card as the divisor, perform a modulo operation according to the second Hash value and the serial number of the card, and obtain the parameter value corresponding to each serial number.

[0152] The card face determination unit is used to determine the card face of the corresponding sequence number according to the card face information mapped by the parameter value.

[0153] In one embodiment, the target parameter determination unit includes:

[0154] The first XOR calculation unit is used to perform XOR operation on the game credentials of each game player in the game game, and use the XOR result as the target parameter.

[0155] In one embodiment, the target parameter determination unit includes:

[0156] A second hash value acquisition unit, used to obtain the hash value of the latest generated block in the blockchain;

[0157] The second XOR calculation unit is used to perform an XOR operation on the game credentials of each game player in the game and the hash value of the latest generated block, and use the XOR result as the target parameter.

[0158] In one embodiment, the device further comprises:

[0159] The second storage module is used to associate and store the game result of the game, the game credentials of each game player in the game, and the data indicating the initial card order in the blockchain after the game is over.

[0160] The implementation process of the functions and effects of each module / unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0161] It is understood that these modules can be implemented by hardware, software, or a combination of the two. When implemented in hardware, these modules can be implemented as one or more hardware modules, such as one or more application specific integrated circuits. When implemented in software, these modules can be implemented as one or more computer programs executed on one or more processors.

[0162] Fig.12 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.

[0163] It should be noted that Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0164] like Fig.12 As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM) 1203, such as executing the method in the above embodiment. In the RAM 1203, various programs and data required for system operation are also stored. The CPU 1201, the ROM 1202 and the RAM 1203 are connected to each other through the bus 1204. The input / output (I / O) interface 1205 is also connected to the bus 1204.

[0165] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.

[0166] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1209, and / or installed from a removable medium 1211. When the computer program is executed by a central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.

[0167] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it. In the present application, a computer-readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, wherein a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0168] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0169] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0170] As another aspect, the present application further provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or may exist independently without being assembled into the electronic device. The above computer-readable medium stores computer-readable instructions, and when the above computer-readable instructions are executed by a processor, such as a processor in the above electronic device, the method in any of the above embodiments is implemented.

[0171] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0172] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0173] The term "multiple" as used herein refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0174] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0175] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A data processing method in a chess and card game, applied to a client, characterized in that: The method comprises: Receiving game credentials broadcasted by other game players in the game session, wherein the game credentials are generated according to a player identifier of the corresponding game player and a start time of the game session; Call the contract algorithm in the blockchain; The following steps are performed by the contract algorithm: determining target parameters according to the game credentials of the game player corresponding to the client and the game credentials of the other game players; Performing a hash operation on the target parameter to obtain a second hash value; Taking the second Hash value as the dividend and the serial number of the card as the divisor, performing a modulo operation according to the second Hash value and the serial number of the card to obtain a parameter value corresponding to each serial number; The card face corresponding to the sequence number is determined according to the card face information mapped by the parameter value.

2. The method according to claim 1, characterized in that: Before receiving the game credentials broadcasted by other game players in the game session, the method further includes: After starting the game, obtaining the start time of the game; The game credential of the client in the game round is generated according to the player identification of the game player corresponding to the client and the start time of the game round.

3. The method according to claim 2, characterized in that After generating the game credential of the client in the game according to the player identification of the game player corresponding to the client and the start time of the game, the method further includes: According to the game room where the client is located, the generated game credential is broadcasted to other game players in the game room.

4. The method according to claim 2, characterized in that: The step of generating the game credential of the client in the game according to the player identification of the game player corresponding to the client and the start time of the game game includes: Performing a hash operation on the player identifier of the game player corresponding to the client to obtain a first hash value; The first hash value is used as a key to encrypt the start time of the game round, and the encryption result is used as the game credential of the player in the game round.

5. The method according to claim 1, characterized in that The determining of the target parameter according to the game credentials of the game player corresponding to the client and the game credentials of the other game players includes: An XOR operation is performed on the game credentials of each game player in the game round, and the XOR result is used as the target parameter.

6. The method according to claim 1, characterized in that The determining of the target parameter according to the game credentials of the game player corresponding to the client and the game credentials of the other game players includes: Obtaining the hash value of the latest generated block in the blockchain; An XOR operation is performed on the game credentials of each game player in the game game and the hash value of the latest generated block, and the XOR result is used as the target parameter.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: After the game round is over, the game result of the game round, the game credentials of each game player in the game round, and the data indicating the initial card order are associated and stored in the blockchain.

8. A data processing device in a chess and card game, applied to a client, characterized in that: The device comprises: A game credential acquisition module, used to receive game credentials broadcasted by other game players in the game session, wherein the game credentials are generated according to the player identification of the corresponding game player and the start time of the game session; The calling module is used to call the contract algorithm in the blockchain; A determination module is used to execute the following steps through the contract algorithm: determine the target parameters according to the game credentials of the game player corresponding to the client and the game credentials of the other game players; perform a hash operation on the target parameters to obtain a second hash value; use the second hash value as the dividend and the serial number of the card face as the divisor, perform a modulus operation according to the second hash value and the serial number of the card face, and obtain the parameter value corresponding to each serial number; determine the card face corresponding to the serial number according to the card face information mapped by the parameter value.

9. An electronic device, characterized in that: include: processor; as well as A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the data processing method in the chess and card game as described in any one of claims 1-7 is implemented.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data processing method in the chess and card game described in any one of claims 1 to 7 is implemented.

11. A computer program product, characterized in that The computer program product includes computer instructions stored in a computer-readable storage medium; The processor of the computer device reads and executes the computer instructions from the computer-readable storage medium, so that the computer device executes the data processing method in the chess and card game described in any one of claims 1-7.

Citation Information

Patent Citations

  • Game server system and method for generating revenue therewith

    CN101231732A

  • Assigning tables and order of play in a poker game

    CN102811778A