CN110519375B - Information synchronization method and related device - Google Patents

Information synchronization method and related device Download PDF

Info

Publication number
CN110519375B
CN110519375B CN201910806497.9A CN201910806497A CN110519375B CN 110519375 B CN110519375 B CN 110519375B CN 201910806497 A CN201910806497 A CN 201910806497A CN 110519375 B CN110519375 B CN 110519375B
Authority
CN
China
Prior art keywords
random sequence
sequence information
information
service request
target
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
CN201910806497.9A
Other languages
Chinese (zh)
Other versions
CN110519375A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910806497.9A priority Critical patent/CN110519375B/en
Publication of CN110519375A publication Critical patent/CN110519375A/en
Application granted granted Critical
Publication of CN110519375B publication Critical patent/CN110519375B/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
    • A63F1/00Card games
    • 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/30Interconnection arrangements between game servers and game devices; Interconnection arrangements between game devices; Interconnection arrangements between game servers
    • A63F13/35Details of game servers
    • 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/45Controlling the progress of the video game
    • 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/45Controlling the progress of the video game
    • A63F13/49Saving the game status; Pausing or ending the game
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/131Protocols for games, networked simulations or virtual reality

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application provides an information synchronization method and a related device, which can provide public and transparent information and can be used for backtracking and checking at any time afterwards. The method comprises the following steps: first, a first amount of service request information and a second amount of random sequence information are obtained through a block chain. Then, in the first amount of service request information, determining target service request information of a target client, and then in the second amount of random sequence information, determining target random sequence information corresponding to the target service request information, wherein the ordering of the target service request information in the first amount of service request corresponds to the ordering of the target random sequence information in the second amount of random sequence information. And finally, recording the target random sequence information to the block chain for synchronous storage, so that the target client side can acquire the target random sequence information through the block chain.

Description

Information synchronization method and related device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and a related apparatus for synchronizing information.
Background
With the rapid development of computer technology, the services available to users for entertainment on terminal devices, such as chess and card games, have increased.
After receiving the dealing request information sent by the client, the server of the chess and card game shuffles the cards by a random algorithm, specifically, the server randomly extracts a first card from 52 cards, then extracts a second card from the remaining 51 cards, and so on until all cards are extracted, at this time, the server can obtain random dealing sequence information (i.e. a dealing sequence consisting of 52 cards), and returns the dealing sequence information to the client to complete dealing.
However, in the above-mentioned dealing process, since the server generates the dealing sequence information based on the random algorithm, the dealing sequence information is not publicly transparent, and when the dealing sequence is tampered due to malicious attack on the server, the dealing sequence information cannot be traced back.
Disclosure of Invention
The embodiment of the application provides an information synchronization method and a related device, which can provide public and transparent information and can be used for backtracking and checking at any time afterwards.
A first aspect of the embodiments of the present application provides a method for information synchronization, including:
acquiring a first quantity of service request information and a second quantity of random sequence information through a block chain;
determining target service request information of a target client in the first quantity of service request information;
determining target random sequence information corresponding to the target service request information in the second number of random sequence information, wherein the ordering of the target service request information in the first number of service requests corresponds to the ordering of the target random sequence information in the second number of random sequence information;
and recording the target random sequence information to the block chain for synchronous storage, so that the target client side obtains the target random sequence information through the block chain.
A second aspect of the embodiments of the present application provides an information synchronization apparatus, including:
the first acquisition module is used for acquiring a first quantity of service request information and a second quantity of random sequence information through a block chain;
a first determining module, configured to determine, in the first number of pieces of service request information, target service request information of a target client;
a second determining module, configured to determine, in the second number of random sequence information, target random sequence information corresponding to the target service request information, where an ordering of the target service request information in the first number of service requests corresponds to an ordering of the target random sequence information in the second number of random sequence information;
and the first recording module is used for recording the target random sequence information to the block chain for synchronous storage so that the target client side can acquire the target random sequence information through the block chain.
Based on the second aspect, in a first implementation manner of the second aspect in the embodiment of the present application, the apparatus further includes:
a generating module, configured to generate a third amount of random sequence information;
a second recording module, configured to record the third amount of random sequence information to the block chain for synchronous storage, so that the other servers obtain the third amount of random sequence information through the block chain;
a second obtaining module, configured to obtain, through the blockchain, a fourth amount of random sequence information, where the fourth amount of random sequence information is random sequence information generated by the other servers;
a merging module, configured to merge the third amount of random sequence information and the fourth amount of random sequence information to obtain the second amount of random sequence information;
and the third recording module is used for recording the second amount of random sequence information to the block chain for synchronous storage so as to perform information consensus.
Based on the first implementation manner of the second aspect, in a second implementation manner of the second aspect in this embodiment of the application, the merging module is further configured to:
de-duplicating the third number of random sequence information and the fourth number of random sequence information;
and sequencing the rest of the de-duplicated random sequence information according to the time stamps to obtain the second number of random sequence information.
Based on the second aspect, in a third implementation manner of the second aspect in the embodiment of the present application, the apparatus further includes:
a third obtaining module, configured to obtain service request information of each client through the blockchain;
the sequencing module is used for sequencing the service request information of each client according to the time stamp to obtain the first quantity of service request information;
and the fourth recording module is used for recording the first quantity of service request information to the block chain for synchronous storage so as to perform information consensus.
Based on the third implementation manner of the second aspect, in a fourth implementation manner of the second aspect in this embodiment of the application, the service request information carries a service identifier, where the service identifier corresponds to the client that generates the service request information, and the first determining module is further configured to:
acquiring the service identifier corresponding to the target client;
and determining target service request information in the first quantity of service request information according to the service identifier corresponding to the target client.
Based on the second aspect, or any one of the first implementation manner to the fourth implementation manner of the second aspect, in a fifth implementation manner of the second aspect in this embodiment of the application, an ordering of the target service request information in the first number of service request information is the same as an ordering of the target random sequence information in the second number of random sequence information.
A third aspect of the embodiments of the present application provides a network device, including: a memory, a transceiver, a processor, and a bus system;
wherein the memory is used for storing programs;
the processor is used for executing the program in the memory and comprises the following steps:
acquiring a first quantity of service request information and a second quantity of random sequence information through a block chain;
determining target service request information of a target client in the first quantity of service request information;
determining target random sequence information corresponding to the target service request information in the second number of random sequence information, wherein the ordering of the target service request information in the first number of service requests corresponds to the ordering of the target random sequence information in the second number of random sequence information;
recording the target random sequence information to the block chain for synchronous storage, so that the target client side obtains the target random sequence information through the block chain;
the bus system is used for connecting the memory and the processor so as to enable the memory and the processor to communicate.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, cause the computer to perform the method according to the first aspect.
According to the technical scheme, the embodiment of the application has the following advantages:
the embodiment of the application provides an information synchronization method, which comprises the following steps: first, a first amount of service request information and a second amount of random sequence information are obtained through a block chain. Then, in the first amount of service request information, determining target service request information of a target client, and then in the second amount of random sequence information, determining target random sequence information corresponding to the target service request information, wherein the ordering of the target service request information in the first amount of service request corresponds to the ordering of the target random sequence information in the second amount of random sequence information. And finally, recording the target random sequence information to the block chain for synchronous storage, so that the target client side can acquire the target random sequence information through the block chain. In the above process, after the server determines the target service request information in the plurality of service request information, it may determine corresponding target random sequence information in the plurality of random sequence information according to the ordering of the target service request information, and synchronously store the target random sequence information on the block chain, so that the target client may obtain the target random sequence information.
Drawings
FIG. 1 is a block diagram of an embodiment of an information synchronization system;
FIG. 2 is a schematic illustration of decentralized distributed data logging in an embodiment of the present application;
FIG. 3 is a block chain diagram according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a method for synchronizing information according to an embodiment of the present application;
FIG. 5 is a diagram illustrating random sequence information generated by server A in an embodiment of the present application;
FIG. 6 is a diagram illustrating random sequence information incorporated by server A in an embodiment of the present application;
FIG. 7 is a diagram illustrating an application of the method for information synchronization in the embodiment of the present application;
FIG. 8 is a schematic structural diagram of an apparatus for information synchronization in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a network device according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides an information synchronization method and a related device, which can provide public and transparent information and can be used for backtracking and checking at any time afterwards.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "corresponding" and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that the information synchronization method provided by the present application is applied to a scenario of randomly generating data, for example, in a chess game, when a client starts a card game, a server returns random sequence information (card dealing sequence) to the client after receiving card dealing request information sent by the client, and in order to prevent cheating by a user, it is necessary to ensure that the random sequence information is transparent and public. Based on the above scenario, the present application utilizes a mechanism of a block chain to implement a trusted and reliable data processing system, which may be a chess and card game dealing system.
For convenience of understanding, the present application provides an information synchronization method, which is applied to an information synchronization system shown in fig. 1, please refer to fig. 1, fig. 1 is an architecture schematic diagram of the information synchronization system in an embodiment of the present application, and as shown in fig. 1, the information synchronization system includes a terminal device a, a terminal device B, a terminal device C, a server a, and a server B, where the terminal device a, the terminal device B, the terminal device C, the server a, and the server B are connected through a network. Assuming that each server is a service server, the service server may be a chess and card game server. Each server in this embodiment of the present application may perform a card dealing service for a terminal device in a certain area, for example, when the terminal device a and the terminal device B perform an area (e.g., a certain chess and card game room) served by the server a and the terminal device B start a chess and card game, the server a provides a card dealing service for the terminal device a and the terminal device B. After receiving the card dealing request information sent by the terminal device a and/or the terminal device B, the server a may determine a random sequence information (i.e., a card dealing sequence) and synchronize to the block chain, so that the terminal device a and/or the terminal device B obtains the random sequence information.
It should be noted that the terminal device includes, but is not limited to, a tablet computer, a notebook computer, a palm computer, a mobile phone, a voice interaction device, and a Personal Computer (PC), and is not limited herein. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
It should be understood that fig. 1 only schematically illustrates the number of two servers and three terminal devices, and does not limit the number of servers and terminal devices in the information synchronization system provided in the embodiment of the present application.
For convenience of understanding, please refer to fig. 2, where fig. 2 is a schematic diagram of decentralized distributed data recording in an embodiment of the present application, and as shown in the figure, a BlockChain (BlockChain) may be regarded as a distributed data recording account, which has a decentralized distributed data recording manner, and data recorded on the BlockChain can not be deleted or tampered, regardless of a terminal device, a server, or a cloud server, and participates in data recording. The block chain technology mainly enables any plurality of nodes participating in a system to generate a series of data blocks (blocks) through correlation by using a cryptography method, wherein each data block contains all information exchange data of the system within a certain time, and a data fingerprint is generated for verifying the validity of the information and linking (chain) the next data block.
Based on the above description, please refer to fig. 3, and fig. 3 is a schematic diagram of a block chain in the embodiment of the present application, as shown in the figure, a block T +1, and a block T +2 are connected in series on the same chain (Chian) according to the occurrence order, and are log records of state changes of the whole ledger. The block records all transaction and status results over a period of time, which is a consensus on the current ledger status. The leading chunk hash value of a chunk is used to correlate the previous chunk, such as the leading chunk hash value of chunk T +1 is used to correlate chunk T. The transaction in the block represents an operation on the ledger, resulting in a change in the state of the ledger, such as adding a transfer record. The metadata is used to record specific transaction contents, such as a transaction timestamp, ciphertext information of the transaction, block length, and the like.
In implementation, it is assumed that there is a distributed data record ledger, and the ledger is only allowed to be added, but not to be deleted. The basic structure of the account book bottom layer is a linear linked list, the linked list is formed by connecting blocks in series, as shown in fig. 3, and the subsequent block records the hash value of the leading block. New data must be added to a new block. Whether the block (and the transaction within the block) is legitimate can be quickly verified by calculating the hash value. Any maintenance node has a record of all blocks and can propose a new legal block, but must go through a certain consensus mechanism to reach agreement on the finally selected block.
In this application, the dealing sequence (i.e. the card spectrum) after random shuffling can be recorded in the transaction of blocks, and a reliable and reliable card game dealing system can be realized by using a block chain mechanism.
With the above description, the method for synchronizing information in the present application will be described below from the perspective of a certain server in the information synchronization system. Fig. 4 is a schematic flowchart of a method for information synchronization in an embodiment of the present application, referring to fig. 4, an embodiment of the method for information synchronization in the embodiment of the present application includes:
401. acquiring a first quantity of service request information and a second quantity of random sequence information through a block chain;
in this embodiment, the server first obtains a first amount of service request information and a second amount of random sequence information from the blockchain, where it should be noted that the first amount of service request information and the second amount of random sequence information are both information obtained after information consensus is performed on all nodes (including all servers and all clients) in the blockchain.
The service request information may be a service request sent by the client within a certain period of time, for example, a card dealing request sent by the client in a chess and card game, and correspondingly, the random sequence information is generated by the server within the certain period of time and is used for responding to the service request, for example, a card dealing sequence randomly generated by the server in the chess and card game. The server can generate the random sequence information in the period of time by using a random algorithm, and the code of the algorithm is public, so that the information is ensured to be transparent and traceable. It should be noted that the service request information and the random sequence information in this embodiment refer to information generated at the same time and used for responding to each other in the service, and in this period of time, the random sequence information generated by each server and the service request information generated by each client are both recorded to the blockchain for synchronous storage, so that the blockchain stores the first number of service request information and the second number of random sequence information.
It should be understood that, in this embodiment, the number of the service request messages is a first number, and the number of the random sequence messages is a second number, where both the first number and the second number are greater than or equal to 1, and the first number and the second number may be the same or different, and are not limited herein.
402. Determining target service request information of a target client in the first quantity of service request information;
after obtaining the first amount of service request information, the server may determine target service request information of the target client from the first amount of service request information. Since one server can serve a business for a client in a specific area, the client served by the server can be regarded as a target client.
The first amount of service request information recorded by the blockchain is a set of service request information generated by each client, so that the server can determine, in the first amount of service request information, service request information sent by a target client served by the server, that is, target service request information. For example, server a may determine the service request information sent by client a that it serves from the first number of service request information, server B may determine the service request information sent by client C that it serves from the first number of service request information, and so on.
403. Determining target random sequence information corresponding to the target service request information in the second amount of random sequence information, wherein the sequence of the target service request information in the first amount of service requests corresponds to the sequence of the target random sequence information in the second amount of random sequence information;
after obtaining the second amount of random sequence information, the server may determine target random sequence information corresponding to the target service request information from the second amount of random sequence information. Specifically, the server may determine corresponding target random sequence information from the second number of random sequence information according to the ordering of the target service request information in the first number of service requests. Optionally, the ordering of the target service request information in the first number of service requests is the same as the ordering of the target random sequence information in the second number of random sequence information. Still in the above example, if 50 pieces of service request information and 80 pieces of random sequence information are stored in the blockchain, and if the server a determines that the card dealing request generated by the client a is ranked at the 12 th position among the 50 sorted card dealing requests, the card dealing sequence ranked at the 12 th position is selected from the 80 sorted card dealing sequences as the card dealing sequence to be returned to the client a.
404. And recording the target random sequence information to the block chain for synchronous storage so that the target client side can acquire the target random sequence information through the block chain.
After determining the target random sequence information, the server records the target random sequence information to the block chain for synchronous storage, so that the target client side can acquire the target random sequence information through the block chain. After the target client side is able to mutually blow the target random sequence information, the target random sequence information can be applied to corresponding services, for example, the client side A applies the dealing sequence returned by the server A to the card game to be executed.
In this embodiment, after determining the target service request information in the plurality of service request information, the server may determine corresponding target random sequence information in the plurality of random sequence information according to the ordering of the target service request information, and synchronously store the target random sequence information on the block chain, so that the target client may obtain the target random sequence information.
Optionally, based on the embodiment corresponding to fig. 4, in an optional embodiment of the information synchronization method in the embodiment of the present application, before the first quantity of service request information and the second quantity of random sequence information are acquired through the block chain, the method further includes:
generating a third amount of random sequence information;
recording a third amount of random sequence information to the block chain for synchronous storage, so that the rest servers acquire the third amount of random sequence information through the block chain;
acquiring a fourth amount of random sequence information through the block chain, wherein the fourth amount of random sequence information is random sequence information generated by the other servers;
combining the third amount of random sequence information with the fourth amount of random sequence information to obtain a second amount of random sequence information;
and recording a second amount of random sequence information to the block chain for synchronous storage so as to perform information consensus.
In this embodiment, the servers in the blockchain generate a random card dealing sequence (hereinafter referred to as random sequence information) at intervals, and each server may generate at least one piece of random sequence information during the interval, where the information represents a card dealing sequence. For convenience of description, one of the servers (i.e., the server executing the embodiment of the present application) will be described as an example, where the server generates a third amount of random sequence information within a certain time period, where the third amount is smaller than the first amount, and then records the third amount of random sequence information into the block chain for synchronous storage, so that the other servers acquire the third amount of random sequence information through the block chain, where it should be noted that the other servers are servers other than the server executing the embodiment of the present application, each of the other servers also generates a certain amount of random sequence information, the sum of which is the fourth amount of random sequence information, and records the generated random sequence information into the block chain for synchronous storage, so that the server can acquire the fourth amount of random sequence information through the block chain, by analogy, each server can acquire random sequence information generated by other servers through the blockchain.
The server obtains the fourth amount of random sequence information, and then the third amount of random sequence information and the fourth amount of random sequence information generated by the server can be merged to obtain the second amount of random sequence information, and then the second amount of random sequence information is recorded to the block chain for synchronous storage, so as to perform information consensus. It should be noted that, the other servers also execute the steps similar to the merging process described above, and similarly can obtain the second amount of random sequence information, and after all servers and all clients quickly achieve information consensus on the second amount of random sequence information, the second amount of random sequence information may be recorded on the block chain for all nodes to make public and transparent access.
Optionally, based on each embodiment corresponding to fig. 4, in an optional embodiment of the information synchronization method in the embodiment of the present application, the combining the third number of random sequence information and the fourth number of random sequence information to obtain the second number of random sequence information includes:
de-duplicating the third amount of random sequence information and the fourth amount of random sequence information;
and sequencing the residual random sequence information after the duplication removal according to the time stamp to obtain a second amount of random sequence information.
In this embodiment, a manner of merging the third number of random sequence information and the fourth number of random sequence information by the server according to the embodiment of the present application may be: the server locally stores a third amount of random sequence information, and gradually acquires random sequence information generated by the other servers from the block chain. Since the fourth amount of random sequence information is random sequence information generated by the remaining servers, in the time period, the server may obtain part of the fourth amount of random sequence information in batches (for example, obtain random sequence information generated by another server in the time period, then obtain random sequence information generated by another server in the time period until obtaining random sequence information generated by all the remaining servers), then compare each part of the obtained random sequence information with the locally stored random sequence information, remove and sort the same information, then update the set of random sequence information locally stored by the server until all the information of the fourth amount of random sequence information is obtained and combined, and then obtain the second amount of random sequence information.
For ease of understanding, the above process is further described below in conjunction with fig. 5 and 6. Fig. 5 is a schematic diagram of random sequence information generated by the server a in the embodiment of the present application, and fig. 6 is a schematic diagram of random sequence information merged by the server a in the embodiment of the present application. As shown in fig. 5, within a certain minute, server a generates 5 random sequence information, which server a records to the blockchain. The server B generates 8 random sequences within the one minute, the server can continuously acquire random sequence information on the block chain during the operation process, after the 8 random sequence information generated by the server B is acquired, the locally stored 5 random sequence information and the 8 random sequence information generated by the server B are deduplicated to determine that 3 pieces of identical information exist, 10 pieces of random sequence information are obtained after combination, and the 10 pieces of random sequence information are sorted according to a timestamp (the timestamp is the time generated by each piece of random sequence information). Similarly, if in the one minute, the server a also acquires 6 random sequence information generated by the server C, and may compare the 6 random sequence information with the locally stored 10 random sequence information, and perform deduplication and sorting to acquire 15 random sequence information. By analogy, as shown in fig. 6, until the server a finishes acquiring the random sequence information of all other servers, and finishes deduplication and sorting, a complete random sequence information set, that is, the random sequence information of the second number, is finally obtained and recorded to the block chain for information consensus. It should be noted that the other servers, such as server B, server C, etc., also perform the same operation as server a, and are not described herein again.
Optionally, based on each embodiment corresponding to fig. 4, in an optional embodiment of the information synchronization method in the embodiment of the present application, before acquiring, by using a block chain, a first amount of service request information and a second amount of random sequence information, the method further includes:
acquiring service request information of each client through a block chain;
sequencing the service request information of each client according to the time stamp to obtain a first amount of service request information;
and recording a first amount of service request information to the block chain for synchronous storage so as to perform information consensus.
In this embodiment, the service request information sent by multiple clients located in the same area may be regarded as the same service request information, for example, if two target clients (client a and client B, respectively) start a card game in a certain room (or a certain game partition, etc.) served by server a, it may be regarded that the two clients send the same card dealing request. Therefore, because a plurality of servers exist in the block chain, each server corresponds to at least one target client, and after the branding is started by all the clients in sequence within a certain period of time, the service request information corresponding to each branding is generated and recorded into the block chain.
After the server of the embodiment of the application acquires the service request information generated by all the clients, the server can sort the part of the service request information according to the time stamps to obtain a first amount of service request information, and then records the first amount of service request information to the block chain for synchronous storage so as to perform information consensus. Similarly, the other servers will perform the same operation, and after all the nodes complete the information consensus on the first number of service request information, the first number of service request information may be recorded on the blockchain for all the nodes to have public and transparent access.
Optionally, based on each embodiment corresponding to fig. 4, in an optional embodiment of the information synchronization method in the embodiment of the present application, the service request information carries a service identifier, the service identifier corresponds to a client that generates the service request information, and in the first amount of service request information, determining target service request information of a target client includes:
acquiring a service identifier corresponding to a target client;
and determining target service request information in the first quantity of service request information according to the service identifier corresponding to the target client.
In this embodiment, each service request message carries a service identifier, such as a card game identifier, so that the card game identifier corresponds to the client in the card game. After the server obtains the first number of service request information, the server may first obtain the service identifier corresponding to the target client, and then determine which service request information has the service identifier corresponding to the target client in the first number of service request information, and then determine that the service request information has the service identifier corresponding to the target client, so that the service request information can be determined as the target service request information.
For example, in a certain room (or a certain game partition, etc.) served by the server a, two target clients (client a and client B, respectively) open a card hand, and at this time, a card dealing request issued by the client a and/or the client B may carry a card hand identifier a. Generally, the server a is preset with a plurality of card game identifiers, so that the server a can determine a card dealing request carrying the card game identifier a in a plurality of card dealing requests according to the card game identifier a. Similarly, once the dealing sequence corresponding to the dealing request carrying the card hand identifier a is determined, the dealing request may be determined as the sequence sent to the client a and the client B.
For further understanding, the following describes the method for synchronizing information in the embodiment of the present application with reference to a specific application example, and fig. 7 is a schematic view of an application example of the method for synchronizing information in the embodiment of the present application, please refer to fig. 7, where the application example includes:
701. each server generates a random sequence;
in this application example, the random sequence is a random dealing sequence.
702. Sequencing all random sequences according to the time stamps, and synchronizing to a block chain to perform information consensus;
703. each card game sends out a card dealing request, and the card dealing request is synchronized to the block chain;
in the application example, the client in the card game generates and sends out the card request.
704. All nodes collect the dealing requests, sort the dealing requests according to the time stamps and synchronize the dealing requests to a block chain so as to perform information consensus;
705. each server acquires the sorted random sequence and the dealing request;
706. each server determines a random sequence corresponding to the target card-dealing request, and synchronizes the sequence to the blockchain.
In this application example, each server may determine a target client of its server, and further determine a target card dealing request, and synchronize a card dealing sequence corresponding to the target card dealing request to the blockchain, so that the target client acquires the corresponding card dealing request from the blockchain for executing a card deal.
The above is a specific description of the method for information synchronization in the embodiment of the present application, and the following will describe a structure and a connection relationship of a device for information synchronization in the embodiment of the present application, fig. 8 is a schematic structural diagram of the device for information synchronization in the embodiment of the present application, and please refer to fig. 8, an embodiment of the device for information synchronization in the embodiment of the present application includes:
a first obtaining module 801, configured to obtain, through a block chain, a first number of pieces of service request information and a second number of pieces of random sequence information;
a first determining module 802, configured to determine target service request information of a target client in a first number of service request information;
a second determining module 803, configured to determine, in a second number of random sequence information, target random sequence information corresponding to the target service request information, where an ordering of the target service request information in the first number of service requests corresponds to an ordering of the target random sequence information in the second number of random sequence information;
the first recording module 804 is configured to record the target random sequence information to the block chain for synchronous storage, so that the target client obtains the target random sequence information through the block chain.
Optionally, based on the embodiment corresponding to fig. 8, in an optional embodiment of the apparatus for information synchronization in the embodiment of the present application, the apparatus further includes:
a generating module, configured to generate a third amount of random sequence information;
the second recording module is used for recording the random sequence information of the third quantity to the block chain for synchronous storage, so that the other servers can obtain the random sequence information of the third quantity through the block chain;
the second obtaining module is configured to obtain a fourth amount of random sequence information through the blockchain, where the fourth amount of random sequence information is random sequence information generated by the other servers;
the merging module is used for merging the third quantity of random sequence information and the fourth quantity of random sequence information to obtain a second quantity of random sequence information;
and the third recording module is used for recording a second number of random sequence information to the block chain for synchronous storage so as to perform information consensus.
Optionally, based on each embodiment corresponding to fig. 8, in an optional embodiment of the apparatus for information synchronization in the embodiment of the present application, the merging module is further configured to:
de-duplicating the third amount of random sequence information and the fourth amount of random sequence information;
and sequencing the residual random sequence information after the duplication removal according to the time stamp to obtain a second amount of random sequence information.
Optionally, based on each embodiment corresponding to fig. 8, in an optional embodiment of the apparatus for information synchronization in the embodiment of the present application, the apparatus further includes:
the third acquisition module is used for acquiring the service request information of each client through the block chain;
the sequencing module is used for sequencing the service request information of each client according to the time stamp to obtain a first amount of service request information;
and the fourth recording module is used for recording the first quantity of service request information to the block chain for synchronous storage so as to perform information consensus.
Optionally, based on each embodiment corresponding to fig. 8, in an optional embodiment of the apparatus for synchronizing information in the embodiment of the present application, the service request information carries a service identifier, the service identifier corresponds to a client that generates the service request information, and the first determining module 802 is further configured to:
acquiring a service identifier corresponding to a target client;
and determining target service request information in the first quantity of service request information according to the service identifier corresponding to the target client.
Optionally, based on each embodiment corresponding to fig. 8, in an optional embodiment of the apparatus for information synchronization in the embodiment of the present application, an ordering of the target service request information in the first number of service request information is the same as an ordering of the target random sequence information in the second number of random sequence information.
It should be noted that, because the contents of information interaction, execution process, and the like between the modules/units of the apparatus are based on the same concept as the method embodiment of the present application, the technical effect brought by the contents is the same as the method embodiment of the present application, and specific contents may refer to the description in the foregoing method embodiment of the present application, and are not described herein again.
Fig. 9 is a schematic structural diagram of a network device according to an embodiment of the present invention, and the network device 900 may have a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 922 (e.g., one or more processors) and a memory 932, and one or more storage media 930 (e.g., one or more mass storage devices) storing an application 942 or data 944. Memory 932 and storage media 930 can be, among other things, transient storage or persistent storage. The program stored on storage medium 930 may include one or more modules (not shown), each of which may include a sequence of instructions operating on the network device. Still further, central processor 922 may be disposed in communication with storage medium 930 to execute a series of instruction operations in storage medium 930 on network device 900.
The network device 900 may also include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input-output interfaces 958, and/or one or more operating systems 941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
Based on the network device shown in fig. 9, the following steps can be implemented:
acquiring a first quantity of service request information and a second quantity of random sequence information through a block chain;
determining target service request information of a target client in the first quantity of service request information;
determining target random sequence information corresponding to the target service request information in the second amount of random sequence information, wherein the sequence of the target service request information in the first amount of service requests corresponds to the sequence of the target random sequence information in the second amount of random sequence information;
and recording the target random sequence information to the block chain for synchronous storage so that the target client side can acquire the target random sequence information through the block chain.
Embodiments of the present application also provide a computer-readable storage medium, which includes instructions, when executed on a computer, cause the computer to execute the method for information synchronization as described above.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (7)

1. A method of information synchronization, comprising:
acquiring service request information of each client through a block chain;
sequencing the service request information of each client according to the time stamp to obtain a first amount of service request information;
recording the first quantity of service request information to the block chain for synchronous storage so as to perform information consensus;
generating a third amount of random sequence information;
recording the third amount of random sequence information to the block chain for synchronous storage, so that the rest servers acquire the third amount of random sequence information through the block chain;
acquiring a fourth amount of random sequence information through the block chain, wherein the fourth amount of random sequence information is the random sequence information generated by the other servers;
combining the third amount of random sequence information with the fourth amount of random sequence information to obtain a second amount of random sequence information;
recording the second amount of random sequence information to the block chain for synchronous storage so as to perform information consensus;
acquiring the first quantity of service request information and the second quantity of random sequence information through the block chain;
determining target service request information of a target client in the first quantity of service request information;
determining target random sequence information corresponding to the target service request information in the second number of random sequence information, wherein the ordering of the target service request information in the first number of service requests corresponds to the ordering of the target random sequence information in the second number of random sequence information;
and recording the target random sequence information to the block chain for synchronous storage, so that the target client side obtains the target random sequence information through the block chain.
2. The method of claim 1, wherein the combining the third number of random sequence information and the fourth number of random sequence information to obtain the second number of random sequence information comprises:
de-duplicating the third number of random sequence information and the fourth number of random sequence information;
and sequencing the rest of the de-duplicated random sequence information according to the time stamps to obtain the second number of random sequence information.
3. The information synchronization method according to claim 1, wherein the service request information carries a service identifier, the service identifier corresponds to the client that generates the service request information, and determining the target service request information of the target client in the first number of service request information comprises:
acquiring the service identifier corresponding to the target client;
and determining target service request information in the first quantity of service request information according to the service identifier corresponding to the target client.
4. The method according to any of claims 1 to 3, wherein the target service request information has the same ordering in the first number of service request information as the target random sequence information in the second number of random sequence information.
5. An apparatus for synchronizing information, comprising:
the third acquisition module is used for acquiring the service request information of each client through the block chain;
the sequencing module is used for sequencing the service request information of each client according to the time stamp to obtain a first amount of service request information;
a fourth recording module, configured to record the first number of service request messages to the blockchain for synchronous storage, so as to perform message consensus;
a generating module, configured to generate a third amount of random sequence information;
a second recording module, configured to record the third amount of random sequence information to the block chain for synchronous storage, so that the other servers obtain the third amount of random sequence information through the block chain;
a second obtaining module, configured to obtain, through the blockchain, a fourth amount of random sequence information, where the fourth amount of random sequence information is random sequence information generated by the other servers;
a merging module, configured to merge the third amount of random sequence information with the fourth amount of random sequence information to obtain a second amount of random sequence information;
a third recording module, configured to record the second number of random sequence information to the block chain for synchronous storage, so as to perform information consensus;
a first obtaining module, configured to obtain, through the blockchain, the first number of pieces of service request information and the second number of pieces of random sequence information;
a first determining module, configured to determine, in the first number of pieces of service request information, target service request information of a target client;
a second determining module, configured to determine, in the second number of random sequence information, target random sequence information corresponding to the target service request information, where an ordering of the target service request information in the first number of service requests corresponds to an ordering of the target random sequence information in the second number of random sequence information;
and the first recording module is used for recording the target random sequence information to the block chain for synchronous storage so that the target client side can acquire the target random sequence information through the block chain.
6. A network device, comprising: a memory, a transceiver, a processor, and a bus system;
wherein the memory is used for storing programs;
the processor is used for executing the program in the memory and comprises the following steps:
acquiring service request information of each client through a block chain;
sequencing the service request information of each client according to the time stamp to obtain a first amount of service request information;
recording the first quantity of service request information to the block chain for synchronous storage so as to perform information consensus;
generating a third amount of random sequence information;
recording the third amount of random sequence information to the block chain for synchronous storage, so that the rest servers acquire the third amount of random sequence information through the block chain;
acquiring a fourth amount of random sequence information through the block chain, wherein the fourth amount of random sequence information is the random sequence information generated by the other servers;
combining the third amount of random sequence information with the fourth amount of random sequence information to obtain a second amount of random sequence information;
recording the second amount of random sequence information to the block chain for synchronous storage so as to perform information consensus;
acquiring the first quantity of service request information and the second quantity of random sequence information through the block chain;
determining target service request information of a target client in the first quantity of service request information;
determining target random sequence information corresponding to the target service request information in the second number of random sequence information, wherein the ordering of the target service request information in the first number of service requests corresponds to the ordering of the target random sequence information in the second number of random sequence information;
recording the target random sequence information to the block chain for synchronous storage, so that the target client side obtains the target random sequence information through the block chain;
the bus system is used for connecting the memory and the processor so as to enable the memory and the processor to communicate.
7. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method of any of claims 1 to 5.
CN201910806497.9A 2019-08-27 2019-08-27 Information synchronization method and related device Active CN110519375B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910806497.9A CN110519375B (en) 2019-08-27 2019-08-27 Information synchronization method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910806497.9A CN110519375B (en) 2019-08-27 2019-08-27 Information synchronization method and related device

Publications (2)

Publication Number Publication Date
CN110519375A CN110519375A (en) 2019-11-29
CN110519375B true CN110519375B (en) 2021-08-31

Family

ID=68627892

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910806497.9A Active CN110519375B (en) 2019-08-27 2019-08-27 Information synchronization method and related device

Country Status (1)

Country Link
CN (1) CN110519375B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109033316A (en) * 2018-07-18 2018-12-18 上海源啟信息科技有限公司 Data processing method, device, system, equipment and storage medium
CN109345238A (en) * 2018-08-31 2019-02-15 杭州复杂美科技有限公司 A kind of card game method and system, equipment and storage medium
CN109726984A (en) * 2018-12-20 2019-05-07 深圳智乾区块链科技有限公司 A kind of processing result generation method and its equipment, storage medium, electronic equipment
KR101996675B1 (en) * 2018-09-06 2019-07-04 강진호 Method for providing sports block chain service
CN109985389A (en) * 2019-04-04 2019-07-09 南京邮电大学 Cards game anti-cheating method and its system based on block chain intelligence contract

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109033316A (en) * 2018-07-18 2018-12-18 上海源啟信息科技有限公司 Data processing method, device, system, equipment and storage medium
CN109345238A (en) * 2018-08-31 2019-02-15 杭州复杂美科技有限公司 A kind of card game method and system, equipment and storage medium
KR101996675B1 (en) * 2018-09-06 2019-07-04 강진호 Method for providing sports block chain service
CN109726984A (en) * 2018-12-20 2019-05-07 深圳智乾区块链科技有限公司 A kind of processing result generation method and its equipment, storage medium, electronic equipment
CN109985389A (en) * 2019-04-04 2019-07-09 南京邮电大学 Cards game anti-cheating method and its system based on block chain intelligence contract

Also Published As

Publication number Publication date
CN110519375A (en) 2019-11-29

Similar Documents

Publication Publication Date Title
US20210027289A1 (en) Asset transaction method, storage medium, and computer device
US10079882B2 (en) Method and system for synchronizing information to contacts on cloud platform
CN107172169A (en) Method of data synchronization, device, server and storage medium
CN110502310B (en) Time synchronization method and device of virtual machine
CN112650730B (en) Game data migration method and device, storage medium and computer equipment
CN113687964B (en) Data processing method, device, electronic equipment, storage medium and program product
CN113505354B (en) Data processing method, device and storage medium
CN111858751A (en) Data storage method and device based on block chain
CN110769024B (en) Synchronous storage method and system of electronic test data
CN114153822A (en) Data migration method and device, electronic equipment and storage medium
CN113254424B (en) Data service migration method, device and equipment
CN111639132A (en) Log synchronization method and device
CN110519375B (en) Information synchronization method and related device
CN111176827B (en) Data preheating method and related device
CN109885555B (en) User information management method and device
CN112138372B (en) Data synchronization method in distributed system and related equipment
CN107172165B (en) Data synchronization method and device
CN115205046A (en) Data processing method and device, electronic equipment and storage medium
CN111209597B (en) Data verification method and application system
CN111506646B (en) Data synchronization method, device, system, storage medium and processor
CN110677497B (en) Network medium distribution method and device
CN117010889A (en) Data processing method, device, equipment, medium and product
CN105791350B (en) Project data processing method and system
CN112541825A (en) Transaction processing method and device based on block chain and electronic equipment
CN114501082B (en) Live broadcast room distribution method and device

Legal Events

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