CN110795749A - Data processing method, device and storage medium - Google Patents

Data processing method, device and storage medium Download PDF

Info

Publication number
CN110795749A
CN110795749A CN201911025106.6A CN201911025106A CN110795749A CN 110795749 A CN110795749 A CN 110795749A CN 201911025106 A CN201911025106 A CN 201911025106A CN 110795749 A CN110795749 A CN 110795749A
Authority
CN
China
Prior art keywords
lottery
issued
tickets
ticket
key
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.)
Granted
Application number
CN201911025106.6A
Other languages
Chinese (zh)
Other versions
CN110795749B (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 CN201911025106.6A priority Critical patent/CN110795749B/en
Publication of CN110795749A publication Critical patent/CN110795749A/en
Application granted granted Critical
Publication of CN110795749B publication Critical patent/CN110795749B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C15/00Generating random numbers; Lottery apparatus

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

In a data processing method, an apparatus, and a storage medium according to embodiments of the present invention, for a lottery issuer, after determining a plurality of lottery tickets issued this time and lottery ticket information thereof, a key corresponding to each of the issued lottery tickets may be acquired, after obtaining corresponding lottery ticket ciphertexts by encrypting the key and the lottery ticket information of the same issued lottery ticket, the lottery ticket ciphertexts of the plurality of issued lottery tickets are synchronized to a blockchain network for any user to inquire and purchase, and when a lottery ticket purchase record of the plurality of issued lottery tickets satisfies a condition (e.g., issued lottery ticket sales), in response to a key publishing command generated therefrom, the keys of all the lottery ticket ciphertexts are published to the blockchain network for any user to acquire the keys of any one or more issued lottery tickets, the corresponding lottery ticket ciphertexts are decoded, the obtained lottery ticket information is verified, thereby ensuring a public disclosure, a disclosure, and a quality of an instant lottery ticket system, Fair and fair.

Description

Data processing method, device and storage medium
Technical Field
The present invention relates to the field of block chaining technologies, and in particular, to a data processing method, apparatus, and storage medium.
Background
In recent years, in public places such as malls and hotels, an instant lottery ticket (e.g. lottery ticket) terminal appears, which is different from a traditional lottery store, a purchaser can know whether a lottery is awarded or not immediately after purchasing a ticket, and can exchange the lottery immediately.
However, the instant lottery system is a black box and opaque to the purchaser, so that the purchaser cannot know whether the printed lottery ticket is genuine before purchase, and cannot verify whether the issued probability is genuine, thereby failing to ensure the fairness of the instant lottery system.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data storage method, apparatus, and storage medium, which synchronize a plurality of lottery cryptographs for issuing lottery tickets to a blockchain network for any user to inquire and purchase, and publish keys of all the lottery cryptographs to the blockchain network for any user to check after the lottery tickets are sold out, thereby ensuring the openness, justice, and fairness of an instant lottery system.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
in one aspect, an embodiment of the present invention provides a data processing method, where the method includes:
receiving lottery ciphertext of each of a plurality of issued lottery tickets sent by a client, and synchronizing the lottery ciphertext to a block chain network;
detecting that the lottery purchase records of the plurality of issued lottery satisfy conditions, and sending a key publishing instruction to the client;
and receiving the keys of the plurality of issued lottery tickets fed back by the client in response to the key publishing instruction, and synchronizing the received keys to the blockchain network.
In some embodiments, the method further comprises:
obtaining a lottery purchase request for a first lottery ciphertext of a first issuance lottery, the first issuance lottery being any one of the plurality of issuance lottery;
sending the lottery purchase request to any node in the block chain network, responding to the lottery purchase request by the node, generating a lottery purchase record aiming at the first issuing lottery, and acquiring a first key of the first lottery ciphertext;
receiving the first key fed back by the node, and decrypting the first key and the first lottery ciphertext to obtain first lottery information of the first issuing lottery;
and outputting the first lottery ticket information.
In some embodiments, the method further comprises:
obtaining lottery ticket checking requests aiming at the plurality of issued lottery tickets;
sending the lottery ticket checking request to any node in the block chain network, and responding the lottery ticket checking request by the node to obtain the respective keys and cipher texts of the multiple issued lottery tickets and a lottery ticket issuing record, wherein the lottery ticket issuing record comprises the total number of the multiple issued lottery tickets and reward mechanism information;
receiving the keys and cipher texts of the multiple issued lottery tickets fed back by the node, and the lottery ticket issuing records;
decrypting the key and cipher text of the same issued lottery ticket to obtain lottery ticket information of the corresponding issued lottery ticket;
and performing fairness check on the lottery ticket information of each of the plurality of issued lottery tickets by using the lottery ticket issuance record.
In another aspect, an embodiment of the present invention provides a data processing method, where the method includes:
receiving lottery ciphertext of each of a plurality of issued lottery tickets sent by a client, and synchronizing the lottery ciphertext to a block chain network;
detecting that the lottery purchase records of the plurality of issued lottery satisfy conditions, and sending a key publishing instruction to the client;
and receiving the keys of the plurality of issued lottery tickets fed back by the client in response to the key publishing instruction, and synchronizing the received keys to the blockchain network.
In another aspect, an embodiment of the present invention provides a data processing apparatus, where the apparatus includes:
a first obtaining module, configured to obtain respective lottery information and keys of a plurality of issued lottery;
the encryption module is used for encrypting the lottery ticket information and the key of the same issued lottery ticket to obtain a corresponding lottery ticket ciphertext of the issued lottery ticket;
the first synchronization module is used for synchronizing the lottery ciphertext to a block chain network;
a key publishing module, configured to synchronize keys of the plurality of issued tickets to the blockchain network in response to a key publishing instruction, where the key publishing instruction is generated when ticket purchase records of the plurality of issued tickets satisfy a condition, and the ticket purchase records are generated after the issued tickets are purchased.
In another aspect, an embodiment of the present invention provides a data processing apparatus, where the apparatus includes:
the lottery ciphertext receiving module is used for receiving lottery ciphertext of each of a plurality of issued lotteries sent by the client and synchronizing the lottery ciphertext to the block chain network;
the detection module is used for detecting that the lottery purchase records of the plurality of issued lottery meet the conditions and sending a key publishing instruction to the client;
and the key publishing module is used for receiving the keys of the plurality of issued lottery tickets fed back by the client in response to the key publishing instruction and synchronizing the received keys to the block chain network.
In another aspect, an embodiment of the present invention provides a storage medium having a program stored thereon, where the program is called by a processor to implement the data processing method described above.
Based on the above technical solution, embodiments of the present invention provide a data processing method, an apparatus, and a storage medium, where for a lottery issuer, after determining multiple issued lottery tickets issued this time and lottery ticket information thereof, a key corresponding to each issued lottery ticket may be obtained, after obtaining corresponding lottery ticket ciphertext by encrypting the key and the lottery ticket information of the same issued lottery ticket, the lottery ticket ciphertext of the multiple issued lottery tickets is synchronized to a block chain network for any user to query and purchase, and when a lottery ticket purchase record of the multiple issued lottery tickets meets a condition (e.g., issued lottery ticket is sold out), in response to a key publishing instruction generated thereby, the keys of all the lottery ticket ciphertexts are published to the block chain network for any user to obtain the keys of any one or more issued lottery tickets, decode the corresponding lottery ticket ciphertext, and check the obtained lottery ticket information, thereby ensuring that the lottery ticket system is open, and open, Fair and fair.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a data sharing system that implements a data processing method proposed by an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a block chain for implementing the data processing method proposed by the embodiment of the present invention;
fig. 3 is a schematic diagram illustrating a new block generation process in a block chain for implementing the data processing method according to the embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a scenario of a blockchain network implementing the data processing method proposed by the embodiment of the present invention;
fig. 5 is a signaling flow diagram illustrating an alternative example of a data processing method proposed by an embodiment of the present invention;
fig. 6 shows a signaling flow diagram of yet another alternative example of the data processing method proposed by the embodiment of the present invention;
fig. 7 shows a signaling flow diagram of yet another alternative example of a data processing method proposed by an embodiment of the present invention;
FIG. 8 is a schematic diagram illustrating a scene flow of a data processing method according to an embodiment of the present invention;
fig. 9 is a block diagram showing an alternative example of a data processing apparatus proposed by the embodiment of the present invention;
fig. 10 is a block diagram showing still another alternative example of a data processing apparatus proposed by the embodiment of the present invention;
fig. 11 is a block diagram showing still another alternative example of a data processing apparatus proposed by the embodiment of the present invention;
fig. 12 is a block diagram showing still another alternative example of a data processing apparatus proposed by the embodiment of the present invention;
fig. 13 is a schematic diagram illustrating a hardware structure of a terminal device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings. The embodiments and features of the embodiments of the present invention may be combined with each other without conflict. Also, it should be understood that "system", "apparatus", "device", "unit" and/or "module" as used herein is a method for distinguishing different components, elements, parts or assemblies at different levels. However, other words may be substituted by other expressions if they accomplish the same purpose.
In addition, the terms "a," "an," "the," and/or "the" are not intended to refer to the singular, but may include the plural unless the context clearly dictates otherwise. In general, the terms "comprises" and "comprising" merely indicate that steps and elements are included which are explicitly identified, that the steps and elements do not form an exclusive list, and that a method or apparatus may include other steps or elements. An element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method or apparatus that comprises the element.
In the description of the embodiments of the present invention, where "/" denotes an or meaning, for example, a/B may denote a or B; "and/or" herein is merely an association describing an associated object, and means that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of the present invention, "a plurality" means two or more than two. The terms "first", "second" and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
Flow charts are used in the present invention to illustrate the operations performed by a system according to embodiments of the present invention. It should be understood that the preceding or following operations are not necessarily performed in the exact order in which they are performed. Rather, the various steps may be processed in reverse order or simultaneously. Meanwhile, other operations may be added to the processes, or a certain step or several steps of operations may be removed from the processes.
Aiming at the problems brought forward by the background technology, the invention provides that after being encrypted, the instant lottery (hereinafter, simply referred to as lottery) is pre-stored in a sharing system, so that all users can check the ciphertext before purchasing, know the relevant information such as the reward rule and the content of the lottery and the ciphertext of all the lottery; after the lottery tickets are sold out, the sharing system can publish the keys of all the lottery tickets, so that all users can check whether the lottery ticket information is consistent with the published information at any time, and the effects of openness and fairness are achieved.
For example, referring to the data sharing system shown in fig. 1, the data sharing system 100 refers to a system for performing data sharing between nodes, the data sharing system may include a plurality of nodes 101, and the plurality of nodes 101 may refer to respective clients in the data sharing system. Each node 101 may receive input information while operating normally and maintain shared data within the data sharing system based on the received input information.
In order to ensure information intercommunication in the data sharing system, information connection can exist between each node in the data sharing system, and information transmission can be carried out between the nodes through the information connection. For example, when an arbitrary node in the data sharing system receives input information, other nodes in the data sharing system acquire the input information according to a consensus algorithm, and store the input information as data in shared data, so that the data stored on all the nodes in the data sharing system are consistent.
Each node in the data sharing system has a node identifier corresponding thereto, and each node in the data sharing system may store a node identifier of another node in the data sharing system, so that the generated block is broadcast to the another node in the data sharing system according to the node identifier of the another node.
In practical application, each node may maintain a node identifier list as shown in the following table, and store the node name and the node identifier in the node identifier list correspondingly. The node identifier may be an IP (Internet Protocol) address and any other information that can be used to identify the node, and table 1 only illustrates the IP address as an example.
TABLE 1
Node name Node identification
Node
1 117.114.151.174
Node 2 117.116.189.145
Node N 119.123.789.258
Each node in the data sharing system stores one identical blockchain. The Block chain is composed of a plurality of blocks (blocks), each Block can record all transactions and state structures within a period of time, one-time consensus on the current account book state is achieved, the transactions can be one-time operation on the account book, the state of the account book can be changed once, if a transfer record is added, the blocks can be connected in series according to the occurrence sequence to form the Block chain, and the Block chain is a log record of the state change of the whole account book.
Referring to fig. 2, a block chain is composed of a plurality of blocks, a starting block includes a block header and a block main body, the block header stores an input information characteristic value, a version number, a timestamp and a difficulty value, and the block main body stores input information; the next block of the starting block takes the starting block as a parent block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the parent block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, and the safety of the input information in the block is ensured.
When each block in the block chain is generated, referring to fig. 3, when the node where the block chain is located receives the input information, the input information is verified, after the verification is completed, the input information is stored in the memory pool, and the hash tree for recording the input information is updated; and then, updating the updating time stamp to the time when the input information is received, trying different random numbers, and calculating the characteristic value for multiple times, so that the calculated characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET;
wherein, SHA256 is a characteristic value algorithm used for calculating a characteristic value; version is version information of the relevant block protocol in the block chain; prev _ hash is a block head characteristic value of a parent block of the current block; merkle _ root is a characteristic value of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, is a fixed value within a period of time, and is determined again after exceeding a fixed time period; x is a random number; TARGET is a feature threshold, which can be determined from nbits.
Therefore, when the random number meeting the formula is obtained through calculation, the information can be correspondingly stored, and the block head and the block main body are generated to obtain the current block. And then, the node where the block chain is located respectively sends the newly generated blocks to other nodes in the data sharing system where the newly generated blocks are located according to the node identifications of the other nodes in the data sharing system, the newly generated blocks are verified by the other nodes, and the newly generated blocks are added to the block chain stored in the newly generated blocks after the verification is completed.
Therefore, the block chain can be regarded as a distributed data record book, only information is allowed to be added, information is not allowed to be deleted, and the distributed data record book has the characteristics of openness and tamper resistance.
In order to describe the technical solution of the present invention more clearly, the following introduces a data processing method proposed in the embodiment of the present invention in combination with an application scenario.
Fig. 4 is a diagram illustrating a system architecture for implementing the data processing method of the present invention, and as shown in fig. 4, the system may include: the first client 100, the second client 200, and the nodes 1 to N, where N is a positive integer, and the first client 100, the second client 200, and the nodes 1 to N are all located in a blockchain network, that is, all belong to network nodes of the blockchain network, where the first client 100 may operate on a first terminal device, the second client 200 may operate on a second terminal device, and the nodes 1 to N may all be computer devices.
In this embodiment, the first terminal device may be a terminal device used by an issuer of a lottery ticket (e.g., a lottery ticket, a physical ticket such as a table tennis ticket, etc.), and the issuer may encrypt, by the first client 100, data related to the batch of lottery tickets to be issued, such as set award types and contents, and number of lottery tickets of each type, before issuing the lottery tickets, enter the obtained ciphertext into the blockchain network, and synchronize to each network node in the blockchain network through a consensus mechanism.
The second terminal device may be a user who purchases or views an issued lottery, and electronic equipment used for purchasing or querying the lottery is performed, after the lottery is issued, any user initiates a lottery purchase/query request to any network node of the blockchain network through the second client 200 running on the second terminal device, obtains currently issued lottery content (such as the number of the lottery) and a corresponding reward mechanism thereof, such as reward types, reward content of each type of reward, winning number and other mechanism content, and the user may select which lottery to purchase this time from the currently issued lottery content, so as to obtain a key corresponding to the lottery, so as to decrypt a ciphertext corresponding to the lottery by using the key, and obtain information about the lottery, such as whether the currently purchased lottery wins, whether the rewards are included, and what the reward content is.
After the above analysis, after the batch of lottery tickets is sold out, the block chain network may publish keys of all the lottery tickets in the whole network, specifically, the issuer may broadcast the keys of all the lottery tickets to the block chain network through the first client 100, or may store the keys in the block chain network in advance, and when a preset decryption condition is met (for example, all the lottery tickets are sold out), automatically decrypt the ciphertext of each lottery ticket for any user to check, at this time, any user may obtain information of all the lottery tickets, and compare the information with the lottery ticket description published by the issuer in advance, so as to verify whether the activity of the instant lottery tickets is fair.
The nodes 1 to N may all be used as any network node in the blockchain network, may receive various requests initiated by any user, such as a payment request, an inquiry request, an issue request, and the like, and may also perform verification on information carried by the request, such as verification by using a hash value, to improve security of the request response, and specifically verify that the content may be determined by the request type and the content, which is not described in detail herein.
It should be understood that the first terminal device and the second terminal device may be computer devices having data processing capability, and the corresponding first client or second client is installed to implement application requirements of issuance, purchase, and check of lottery tickets, and the specific implementation process may refer to the description of the corresponding embodiment below, and the first client and the second client may be independent application programs or functional modules integrated on other application programs. In some embodiments, the terminal device and the second terminal device may specifically be Computer devices such as a smart phone, a tablet Computer, a Personal Computer (PC), or a workstation, and the device types of the first terminal device and the second terminal device may be determined according to specific application scenario requirements.
Accordingly, the nodes 1 to N may be specifically terminal devices as exemplified above, or may also be data processing devices with computing capability such as a server, and the specific device types of the nodes 1 to N are not limited in the present invention. Moreover, the blockchain network shown in fig. 4 is only an example, and does not limit the number and types of network nodes in the blockchain network.
Referring to fig. 5, a signaling flow diagram of an alternative example of the data processing method proposed by the present invention is shown, which may be applied to a network node in a blockchain network, and as for the structure of the blockchain network, reference may be made to the description of the corresponding parts above, as shown in fig. 5, the method may include, but is not limited to, the following steps:
step S11, the first client acquires lottery information of a plurality of issued lotteries;
the issuer of the lottery ticket can determine the lottery ticket information of the lottery ticket (marked as issued lottery ticket) to be issued at this time, such as the number, type, award data, award content and other information of the lottery ticket.
In some embodiments, these issued tickets may be randomly scrambled to ensure the randomness of the subsequent encryption of the issued tickets. That is, the ticket information of the plurality of issued tickets acquired at step S11 does not have any rule therebetween.
Step S12, the first client acquires the keys of the plurality of issued tickets;
since the lottery information obtained by the first client is usually plaintext information, in order to improve the security of the lottery information, in this embodiment, before broadcasting the lottery information to synchronize to each network node of the blockchain network, encryption processing may be performed on the lottery information to obtain corresponding ciphertext information.
It should be understood that, in general, different issued lottery tickets are purchased by different users, and if a plurality of lottery ticket information are encrypted by using a unified key, a user can obtain the key of one issued lottery ticket, and then can obtain the lottery ticket information of all issued lottery tickets by using the key, and the security of the lottery ticket information of different issued lottery tickets cannot be guaranteed.
In practical applications, the lottery issuer may set a unique key for each issued lottery in advance, for example, each key may be a randomly generated character string, such as a character string with a length of 32 bytes, but is not limited to this generation manner.
Step S13, the first client encrypts the key and the corresponding lottery information to obtain the lottery ciphertext of the corresponding issued lottery;
in some embodiments, the present invention may employ a secure and reliable symmetric encryption algorithm to encrypt the lottery information of each issued lottery. The symmetric encryption algorithm is an encryption algorithm with the same encryption key and decryption key, namely the encryption key can be deduced from the decryption key, and meanwhile, the decryption key can also be deduced from the encryption key.
In practical application of this embodiment, after the first client performs special encryption algorithm processing on the encryption key and the lottery information corresponding to any issued lottery, the first client outputs an obtained complex encryption ciphertext, that is, a lottery ciphertext. After the user obtains the lottery ciphertext of a certain issued lottery from the blockchain network through the second client, the user can decrypt the corresponding lottery ciphertext by using the encryption key of the issued lottery and the encryption algorithm used in encryption to obtain the information content of the lottery. For the symmetric encryption algorithm proposed in this embodiment, the ticket information can be encrypted and decrypted by using the same key, which can be obtained after the user pays for the issued ticket, and the specific process can refer to the description of the corresponding part of the following embodiment.
In some embodiment implementations, for the lottery information of different issued lottery tickets, the encryption algorithm used in the encryption process may also be an asymmetric encryption algorithm, that is, the encryption key and the decryption key may also be different, and after the encryption key is used to encrypt the lottery information of the corresponding issued lottery ticket, the obtained lottery ciphertext and the obtained decryption key are simultaneously entered into the block chain network, so that after a certain user purchases the issued lottery ticket, the user may be informed of the corresponding decryption key, so that the second client of the user can decrypt the lottery ciphertext by using the decryption key to obtain corresponding plaintext information. It should be understood that the decryption keys for different issued lottery tickets are often different, and the method for obtaining the encryption key and the decryption key in the encryption and decryption implementation is not limited by the present invention.
In practical application, after obtaining lottery ciphertext of all issued lotteries, the first client can generate corresponding lottery issuance records, and synchronize the lottery issuance records to the whole block chain network, so that a subsequent user can conveniently know issuance conditions of the lottery in a batch by inquiring the lottery issuance records, and further select a certain issued lottery to be purchased at this time; of course, the user may use the lottery ticket issue record to quickly check the relevant information of each issued lottery ticket after all issued lottery tickets sold out.
In this case, the lottery ticket issuance record may include the award mechanism content, issuance time, issuance amount, issuer information, and the like of each issued lottery ticket, and the information content included in the lottery ticket issuance record may be determined according to actual needs without limitation.
In some embodiments, after the lottery information is encrypted according to any one of the above encryption methods, the obtained lottery ciphertext may have a format shown in table 2 below, but is not limited to this information format:
TABLE 2
Figure BDA0002248394410000111
In table 2 above, the content corresponding to the field pre-tx-HASH may indicate a check HASH value (HASH value) of all contents of a previous Transaction (e.g., a cipher text of a issued ticket), and in this embodiment, an SHA-256 algorithm (a HASH function) may be used to compress the ticket information of the issued ticket, so that the data amount thereof becomes smaller, and a HASH value in a certain format is generated, where the HASH value may be a character string composed of random letters and numbers, which is equivalent to an array having a length of 32 bytes, but the present invention is not limited to this processing manner, and table 2 only exemplifies this processing manner.
The check value obtained by performing HASH calculation on the content of each field in table 2 of the current Transaction by using the SHA-256 algorithm may be recorded in the field of the "check HASH value of the current Transaction", and as described above in the analysis of the SHA-256 algorithm, the check value is a 32-byte character string, and the specific content is not limited. It should be understood that the hash calculation performed by other hash algorithms may result in a hash value having a byte size of 32 bytes, or other sizes.
The content of the field serial (code) may be the code of the issued lottery ticket itself, and the corresponding codes are different for different issued lottery tickets, that is, the code has unique characteristics.
The content of the field type may be a type of the record of the current transaction, and specifically may include lottery information of the issued lottery, a purchase record of the user purchasing the issued lottery, and the like.
The content of the field info may be a lottery ciphertext corresponding to the issued lottery, and if a purchase record exists, the field info may include information such as a purchase lottery number corresponding to the purchase record. In some embodiments, for the content of the record in the field of type, the transaction type of lottery information may be represented by 0, and the transaction type of purchasing the record may be represented by 1, but the representation is not limited to 0 and 1. Therefore, the present invention can intuitively know whether the issued lottery ticket is purchased by the user through the content of the type field.
Step S14, the first client broadcasts the respective lottery ciphertext of the plurality of issued lottery in the blockchain network;
step S15, all broadcast lottery ciphertext is recorded by the nodes 1 to N;
in this embodiment, after obtaining the lottery ciphertext of each issued lottery, the first client may submit the lottery ciphertext to any node from the node 1 to the node N in the block chain network, that is, any network node in the block chain network, and synchronize all the received lottery ciphertexts to other network nodes in the block chain network according to a consensus mechanism by the node, that is, issue all the issued lottery ciphertexts to the whole block chain network, so that a subsequent user can conveniently query any lottery ciphertext of an issued lottery through the second client.
Therefore, in this embodiment, for the lottery ticket issuer, the first client encrypts the lottery ticket information of all issued lottery tickets to be issued, synchronizes the obtained lottery ticket ciphertext into the whole blockchain network, and facilitates the purchaser or the inspector (any user) to access any node of the blockchain network to obtain information such as the lottery ticket ciphertext and the lottery ticket issuance record of each issued lottery ticket, so that the purchaser can select any issued lottery ticket to purchase, thereby avoiding the situation that the issuer withholds or issues the jackpot lottery ticket with pertinence, and realizing the disclosure and fairness of issuing the lottery tickets.
Step S16, the first client broadcasts the keys of the plurality of issuance tickets in the blockchain network in response to the key publishing command;
in step S17, nodes 1 to N record the respective keys of all broadcast distribution tickets.
In this embodiment, after obtaining the keys of all the issued lottery tickets to be issued this time, the first client may store the keys, so that, when determining that the lottery ticket purchase records of a plurality of issued lottery tickets satisfy the condition, if all the issued lottery tickets issued this time are sold out, a key publishing instruction may be generated, and the first client may synchronize the pre-stored keys of the issued lottery tickets to each node in the block chain network, that is, publish the keys of all the issued lottery tickets all over the network in response to the key publishing instruction. How each node in the blockchain network realizes information synchronization in a consensus mode is not described in detail.
Then, if any user can access any node in the block chain network to obtain any one or more keys for issuing lottery tickets, the keys are used for decrypting the corresponding cipher texts of the lottery tickets to obtain the information of the lottery tickets issued correspondingly, and the information can be compared with the lottery ticket issuing records published by the issuer to verify the fairness of the instant lottery ticket system.
In the present invention, the specific content of the condition that the ticket purchase records of the plurality of issued tickets satisfy the condition, that is, the specific content of the condition is not limited, and may be a condition indicating that all issued tickets issued this time are sold out, for example, the number of ticket purchase records reaches the number of all issued tickets issued.
As can be seen, in the embodiment, after the issued lottery tickets are sold out, the keys of all the issued lottery tickets are published in the whole block chain network, so that any user can check the information of the purchased lottery tickets of all the issued lottery tickets, thereby realizing the transparentization of the whole lottery ticket issuing process, improving the traversability of the purchase and inquiry of the lottery tickets, and ensuring the fairness of the lottery ticket system.
A data processing method proposed by the present invention will be described below from the perspective of a second client, and fig. 6 is a signaling flowchart showing yet another optional example of the data processing method proposed by the present invention, where the method may be applied to a network node in a block chain network, and this embodiment mainly takes a scenario where a user purchases a certain issued lottery ticket as an example, and regarding a process of issuing related information of the issued lottery ticket, reference may be made to the description of corresponding parts in the above embodiment, and this embodiment is not described again. As shown in fig. 6, the data processing method proposed in this embodiment may include, but is not limited to, the following steps:
step S21, the second client acquires a lottery purchase request for the first lottery ciphertext of the first issue lottery;
following the above description of the embodiments, the lottery issuer issues all lottery ciphertext issued with lottery to the whole blockchain network in advance, and any user can obtain all lottery ciphertext by accessing the blockchain network. Based on this, when a user needs to purchase a release lottery, any node in the block chain network may be accessed to obtain a lottery ciphertext of each release lottery that is not currently sold, for the user to select the release lottery to be purchased from, and then, the second client may generate a lottery purchase request for the selected lottery ciphertext of the release lottery in response to the selection operation of the user.
In some embodiments, when the second client displays the cipher text of each issued lottery, the second client may also display the virtual resource (e.g. amount) required for purchasing the corresponding issued lottery, and the user may complete the payment operation while selecting the issued lottery to be purchased, in which case, the above-mentioned lottery purchase request may further include whether the user pays the virtual resource required for the selected issued lottery. The content included in the acquired lottery purchase request is not limited by the present invention.
Step S22, the second client end sends the lottery purchasing request to any node in the block chain network;
step S23, the node responds to the lottery purchase request, determines that the second client payment is successful, and generates a lottery purchase record aiming at the first lottery ciphertext;
step S24, the node synchronizes the lottery purchase record to the whole block chain network;
after the user determines the issued lottery tickets to be purchased at this time through the second client, the user can synchronize the relevant information of the issued lottery tickets purchased at this time to the whole blockchain network, and after the blockchain network determines that the user completes the payment operation of the issued lottery tickets selected to be purchased, and determines that the payment is successful, a lottery ticket purchase record aiming at the first lottery ticket cryptograph can be generated, so that the subsequent user can know which issued lottery tickets are sold through the lottery ticket purchase record.
In some embodiments, in response to the lottery purchase request, the node in the blockchain network may transfer the virtual resource of the first issued lottery from the purchasing user account to the lottery issuing user account successfully, and determine that the second client payment is successful.
It should be noted that, the present invention does not limit the specific content included in the lottery purchase record, and may include the relevant information of the issued lottery purchased by the user, the purchase time, the issue time of the issued lottery, payment amount, payment time, and the like.
It should be understood that, for a node in the direct-connection block link network that directly receives a lottery purchase request, verifies whether payment is successful, and generates a lottery purchase record, the lottery purchase record may be synchronized to other nodes in a consensus manner, so that a subsequent query request is initiated to any node in the block link network, and the required information can be obtained.
Step S25, the node detects the invalidation of the lottery purchasing record, updates the lottery purchasing record recorded by each node of the block chain network, and refunds to the second client;
in this embodiment, if there is a lottery purchase record that another purchaser has successfully purchased the same issued lottery before the current user purchases the issued lottery, the generated lottery purchase record for the purchase operation of the user may be considered invalid, and at this time, a refund may be performed to the second client of the current user, for example, the virtual resource spent on purchasing the issued lottery this time is transferred to the user account of the current user from the account of the lottery issuer, and a specific implementation process is not described in detail.
As can be seen, the invalidity of the lottery purchase record can indicate that the lottery purchase record of the first issued lottery exists in the existing lottery purchase records of the blockchain network, namely the first issued lottery is purchased by other users; accordingly, the validity of the lottery purchase record may indicate that there is no lottery purchase record of the first issue lottery among the existing lottery purchase records of the blockchain network, i.e., the first issue lottery is first purchased.
In some embodiments, after the purchaser buys the issued lottery and initiates a request to any node of the block chain network, the node may select a lottery ciphertext of the issued lottery that is not currently purchased, and feed the lottery ciphertext back to the second client, so that the purchaser can select the issued lottery to be purchased this time only from the issued lottery that is not currently sold, in which case, the validity verification of the generated lottery purchase record may not be required subsequently.
It should be understood that, in this embodiment, the blockchain network needs to update the lottery purchase records recorded in the blockchain network in time after generating a new lottery purchase record, so that the latest lottery purchase record can be queried to obtain the lottery ciphertext of each unsold issue lottery when responding to the request of a certain purchasing user later, and the specific implementation process is not described in detail.
Step S26, the node detects that the lottery ticket purchase record is valid, and acquires a first key corresponding to the first lottery ticket ciphertext;
step S27, the node feeds back the first key to the second client;
step S28, the second client decrypts the first key and the first lottery ciphertext to obtain first lottery information;
in step S29, the second client outputs the first lottery information.
As described above, if the lottery purchase record is valid, it can be considered that the user successfully purchases the issued lottery selected by the user, in this case, the blockchain network may acquire the first key (i.e., the decryption key) corresponding to the issued lottery purchased by the user, and thus decrypt the obtained first lottery ciphertext. Corresponding first lottery ticket information (namely, the lottery ticket plaintext of the first issuing lottery ticket) is obtained, so that whether the lottery ticket is won or not is known.
The decryption process of the first lottery ciphertext may be a reverse process of the encryption process of the corresponding first lottery information described above, and the specific decryption process is not described in detail, and the method for generating the decryption key may refer to the description of the encryption key section above.
As can be seen from this, in the present embodiment, since the lottery system issues all lottery ciphertext issued with lottery to the blockchain network in advance, the user can select any unsold issued lottery from the lottery system at any time for purchase, which is not limited by time and region, thereby improving convenience of purchase of lottery, avoiding the situation that an issuer deducts some issued lottery (such as issued lottery corresponding to jackpot) to not issue, and ensuring disclosure and fairness of the lottery system.
Referring to fig. 7, a signaling flowchart illustrating still another optional example of the data processing method provided by the present invention is shown, where the method may be applied to a network node in a block chain network, and this embodiment mainly takes as an example a scenario where a user checks all issued lottery ticket information, and regarding an issuing process and a purchasing process of relevant information of the issued lottery ticket, reference may be made to descriptions of corresponding parts in the foregoing embodiments, and details are not repeated in this embodiment. It should be understood that the examining user may be a purchasing user who issues a lottery, or an issuing user who issues another lottery, or any user such as another user, in which case, the first client may be different from the second client, and for a user who issues a lottery this time, the user may also be an examining user, and fairness verification is performed according to the method described in this embodiment, in which case, the second client may be the first client.
As shown in fig. 7, the data processing method proposed in this embodiment may include, but is not limited to, the following steps:
step S31, the second client sends lottery ticket checking request to any node in the block chain network;
after all issued lottery tickets sold out, if a user doubts the issued lottery tickets, a second client can send a lottery ticket checking request to any node in the block chain network, such as any node from node 1 to node N, wherein the lottery ticket checking request can include second client identification information, lottery ticket type identification of the issued lottery tickets requested to be checked and the like, so that the node can know which issued lottery ticket information is inquired according to the information, and the obtained information is fed back to which client.
Step S32, the node responds to the lottery ticket checking request, and obtains the respective keys, cipher text information and issuing records of all issued lottery tickets;
in this embodiment, the ticket issuance record may contain information about all issued tickets issued by the issuer in advance, such as the total number of issued tickets, the award type, the number of issued tickets of each award type, and the award content.
It should be understood that, since any node may synchronize to the whole block chain network in a consensus manner when acquiring the keys, the ciphertext information, and the issuance records of all issued tickets, the node in step S32 may acquire the keys, the ciphertext information, and the issuance records of all issued tickets requested to be inspected by querying its memory or the memories of other nodes when responding to the reward inspection request, and may also acquire other information that needs to be inspected according to actual needs.
Step S33, the node sends the keys of all issued lottery tickets, the cipher text information of the lottery tickets and the lottery ticket issuance records to the second client;
step S34, the second client decrypts the key and cipher text of the same issued lottery to obtain corresponding lottery information;
step S35, the second client uses the lottery ticket issuing record to check the fairness of all lottery ticket information;
in step S36, the second ue synchronizes the fairness check result to the blockchain network.
In practical applications, after the second client requests the keys, ciphertext information, and issuance records of all issued tickets to be checked, the second client may perform automatic comparison in the manner described in this embodiment to determine whether the ticket information of each issued ticket published in the block chain network matches the ticket information of each issued ticket obtained by decryption, thereby verifying whether the current ticket campaign of the ticket system is open and fair. It should be noted that the fairness check process executed in step S35 is not limited to the method described in this paragraph, and can be adjusted flexibly according to the actual inspection requirement, which is not described in detail in the present invention.
The fairness check result obtained through the fairness check may be a result of whether the comparison is consistent, and may indicate whether the current lottery activity of the lottery system is fair, and the content of the lottery verification report includes a direct result of whether the current lottery activity of the lottery system is fair, and may further include lottery information of all issued lotteries issued this time, and the like.
In some embodiments, the second client may also directly display the obtained keys, ciphertext information, and issuance records of all issued tickets, and manually compare them by a user to implement fairness check.
In summary, in this embodiment, since the relevant information of all issued lottery ticket information, lottery ticket purchase records, lottery ticket issue records, and the like published this time is published to the blockchain network, thereby realizing the transparency of the issuing and purchasing processes of the issued lottery tickets, after the issued lottery tickets are sold out, the blockchain network will publish the keys of the lottery ticket ciphertexts of each issued lottery ticket, and any user can acquire the keys to decrypt the corresponding lottery ticket ciphertexts of the issued lottery tickets, and verify whether the published lottery ticket relevant information is met, thereby avoiding the occurrence of the issuer's black box operation, ensuring the openness, justice, and fairness of the lottery ticket system, and improving the feeling of the user purchasing the lottery tickets.
In the above description of the data processing method according to the present invention, the lottery ticket is taken as an example to briefly describe the process of issuing, purchasing and checking the lottery ticket, and the process of issuing, purchasing and checking other types of lottery tickets is similar, and the detailed description of the invention is omitted.
Referring to fig. 8, after determining the lottery issued this time, the lottery issuing user may obtain lottery information of each lottery, such as lottery award type, amount, award content, and the like, and may also obtain a key corresponding to each lottery information, and after obtaining a lottery ciphertext of each lottery through encryption processing, synchronize the lottery ciphertext into the blockchain network, so that each node in the blockchain network may obtain lottery ciphertexts of all the lotteries issued this time.
Then, when any user needs to buy lottery, the user is marked as a buying user, any node of the block chain network can be accessed to obtain the lottery cryptograph of each issued unsold lottery, one or more lottery is selected as a first lottery, a lottery buying request aiming at the first lottery cryptograph of the first lottery is generated and sent to the block chain network, any node in the block chain network responds to the lottery buying request, after the successful payment of the buying user is determined, a lottery buying record is generated and synchronized to the whole block chain network, then the first key of the first lottery cryptograph is fed back to the client of the buying user, so that the client decrypts the first key and the first lottery cryptograph (if a plurality of lotteries are bought, a plurality of first keys are obtained, and the corresponding first lottery cryptographs are respectively decrypted by the plurality of first keys), and obtaining lottery information of each purchased lottery, and determining whether the purchased lottery wins by checking lottery numbers after lottery winning information is published.
After the lottery issued this time is sold out, the keys of all lottery issued this time are published to the block chain network, so that any user can perform fairness check, specifically, an examining user (i.e. any user) initiates a lottery examination request to the block chain network through a client, any node of the block chain network can respond to the lottery examination request to obtain information such as cipher texts, keys and lottery issuing records of all lottery issued this time, the information is fed back to the client of the examining user, the client decrypts the corresponding lottery cipher texts by using the obtained keys, and performs fairness check on each lottery information obtained by decryption by using the content of the lottery issuing records, such as whether the two information are consistent or not, and then, the obtained fairness check result can be synchronized to the block chain network, and subsequent users can directly access any node of the block chain network, the fairness check result of the lottery issued this time can be obtained, and the open, fair and fair effects of the lottery system are realized.
Referring to fig. 9, there is shown a block diagram of an alternative example of the data processing apparatus proposed by the present invention, which may be applied to a network node in a blockchain network, as shown in fig. 9, the apparatus may include:
a first acquiring module 11 configured to acquire ticket information and a key of each of a plurality of issued tickets;
an encryption module 12, configured to encrypt the lottery information and the key of the same issued lottery to obtain a lottery ciphertext of a corresponding issued lottery;
a first synchronization module 13, configured to synchronize the lottery ciphertext to a blockchain network;
a key publishing module 14, configured to synchronize keys of the plurality of issued lottery tickets to the blockchain network in response to a key publishing instruction, where the key publishing instruction is generated when a lottery ticket purchase record of the plurality of issued lottery tickets satisfies a condition, and the lottery ticket purchase record is generated after the issued lottery tickets are purchased.
In practical applications, the first obtaining module 11, the encrypting module 12, the first synchronizing module 13, and the key publishing module 14 may be deployed in a first terminal device issuing a lottery ticket, and may specifically be program function modules of a first client, and as to specific processes of the program function modules for implementing corresponding functions, reference may be made to the description of corresponding parts of the above method embodiment.
In some embodiments, as shown in fig. 10, the apparatus may further include:
a second obtaining module 15, configured to obtain a lottery purchase request for a first lottery ciphertext of a first issuance lottery, where the first issuance lottery is any issuance lottery of the plurality of issuance lotteries;
a first request sending module 16, configured to send the lottery purchase request to any node in the blockchain network, where the node responds to the lottery purchase request, generates a lottery purchase record for the first issue lottery, and obtains a first key of the first lottery ciphertext;
a first decryption module 17, configured to receive the first key fed back by the node, and decrypt the first key and the first lottery ciphertext to obtain first lottery information of the first issue lottery;
and an information output module 18, configured to output the first lottery information.
In practical applications, the second obtaining module 15, the first request sending module 16, the decrypting module 17, and the information output module 18 may be deployed on a second terminal device used by the user who purchases and issues the lottery ticket, and may specifically be program function modules of a second client, and as to specific processes of the program function modules for implementing corresponding functions, reference may be made to the description of corresponding parts of the above method embodiment.
Since the issuing user may be a purchasing user, the second acquiring module 15, the first request sending module 16, the decrypting module 17, and the information outputting module 18 may be deployed in the first terminal device, and may specifically be program function modules of the first client.
In some embodiments, as shown in fig. 11, the apparatus may further include:
a third obtaining module 19, configured to obtain lottery ticket checking requests for the plurality of issued lottery tickets;
a second request sending module 110, configured to send the lottery ticket checking request to any node in the blockchain network, where the node responds to the lottery ticket checking request to obtain a key and a cipher text of each of the multiple issued lottery tickets, and a lottery ticket issuance record, where the lottery ticket issuance record includes a total number of the multiple issued lottery tickets and reward mechanism information;
an information receiving module 111, configured to receive keys and ciphertext of the multiple issued lottery tickets fed back by the node, and a lottery ticket issuance record;
a second decryption module 112, configured to decrypt the key and the lottery ciphertext of the same issued lottery to obtain lottery information of a corresponding issued lottery;
a verification module 113, configured to perform fairness verification on the lottery information of each of the plurality of issued lottery tickets by using the lottery ticket issuance record.
In practical applications, the third obtaining module 19, the second request sending module 110, the information receiving module 111, the second decrypting module 112, and the verifying module 113 may be deployed on a second terminal device used by a user who purchases and issues lottery tickets/a non-purchasing user, and may specifically be program function modules of a second client, and regarding specific processes of the program function modules for implementing corresponding functions, reference may be made to the description of corresponding parts of the above method embodiments.
It should be noted that, since the issuing user may also be a purchasing user or an inquiring user, the third acquiring module 19, the second request sending module 110, the information receiving module 111, the second decrypting module 112, and the verifying module 113 may be deployed on the first terminal device, and specifically may also be a program function module of the first client.
Referring to fig. 12, a block diagram of an alternative example of the data processing apparatus according to the present invention is shown, where the apparatus may be applied to a network node in a blockchain network, and specifically may be any node from node 1 to node N, as shown in fig. 12, the apparatus may include:
a lottery ciphertext receiving module 21, configured to receive a lottery ciphertext of each of multiple issued lottery sent by a client, and synchronize the lottery ciphertext to a block chain network;
a detection module 22, configured to detect that the lottery purchase records of the multiple issued lottery tickets meet a condition, and send a key publishing instruction to the client;
a key receiving module 23, configured to receive a key of each of the plurality of issuance tickets fed back by the client in response to the key publishing instruction, and synchronize the received key to the blockchain network.
In some embodiments, the apparatus may further comprise:
a lottery purchase request acquisition module configured to acquire a lottery purchase request for a first lottery ciphertext of a first issue lottery, where the first issue lottery is any issue lottery of the plurality of issue lotteries;
a lottery purchase request response module, configured to generate a lottery purchase record for the first issued lottery in response to the lottery purchase request, and synchronize the lottery purchase record to the blockchain network;
and the key feedback module is used for acquiring a first key of the first lottery ciphertext, and feeding the first key back to a target client initiating the lottery purchase request, so that the target client decrypts the first key and the first lottery ciphertext to obtain first lottery information of the first issuing lottery.
In some implementations, the lottery purchase request response module may include:
a lottery purchase request responding unit, configured to transfer the virtual resource of the first issuance lottery from the purchasing user account to the lottery issuance user account in response to the lottery purchase request;
a lottery purchase record generation unit configured to generate a lottery purchase record for the first issue lottery;
correspondingly, the above apparatus may further include:
a transfer module, configured to detect that the lottery purchase record is invalid, update the lottery purchase record recorded in the blockchain network, and transfer the virtual resource of the issued lottery from the lottery issue user account to the purchasing user account, where the lottery purchase record is invalid, indicating that the lottery purchase record of the first issued lottery exists in existing lottery purchase records in the blockchain network;
and the validity detection module is used for detecting that the lottery purchase record is valid and triggering the key feedback module to acquire the first key of the first lottery ciphertext.
In some embodiments, the apparatus may further include:
a lottery ticket checking request response module, configured to respond to a lottery ticket checking request for the multiple issued lottery tickets, and obtain keys and cipher texts of the multiple issued lottery tickets, and a lottery ticket issuance record, where the lottery ticket issuance record includes a total number of the multiple issued lottery tickets and reward mechanism information;
and the information feedback module is used for sending the keys and the cipher texts of the multiple issued lottery tickets and the lottery ticket issuing records to a target client initiating the lottery ticket checking request, decrypting the keys and the cipher texts of the same issued lottery tickets by the target client, and performing fairness check on the decrypted lottery ticket information of the multiple issued lottery tickets by using the lottery ticket issuing records.
It should be noted that, regarding various modules, units, and the like in the above device embodiment applied to any one of the nodes 1 to N, the various modules, units, and the like may be stored in a memory of the node (i.e., a computer device) as program modules, and the processor executes the program modules stored in the memory to implement corresponding functions, and regarding functions implemented by the program modules and combinations thereof and achieved technical effects, reference may be made to the description of corresponding parts of the above method embodiment, which is not described in detail in this embodiment.
The present invention also provides a storage medium, on which a program may be stored, where the program may be called and loaded by a processor to implement the steps of the data processing method described in the foregoing embodiments, and the specific implementation process may refer to the description of the foregoing corresponding embodiments.
Referring to fig. 13, a schematic diagram of a hardware structure of a terminal device according to an embodiment of the present invention is shown, where the present invention does not limit a product type of the terminal device, and may be combined with the description of the corresponding part of the foregoing system embodiment, as shown in fig. 13, the terminal device may include: an input device 31, at least one communication interface 32, at least one memory 33, and at least one processor 34, wherein:
the input device 31, the at least one communication interface 32, the at least one memory 33 and the at least one processor 34 may interact with each other via a communication bus.
The input device 31 may include at least one of a touch sensing unit sensing a touch event on the touch display panel, a keyboard, a mouse, a camera, a microphone, and the like, and may be determined according to factors such as a product type of the terminal device and a usage habit of a user inputting information using the terminal device.
In this embodiment, the user may obtain information such as lottery information, a lottery purchase request, a lottery inspection request, and the like through the input device, and the specific implementation process is not described in detail.
The communication interface 32 may be an interface of a communication module, such as an interface of a GSM module, and may implement data interaction with other devices, and may further include interfaces such as a USB interface and a serial/parallel interface, which are used to implement data interaction between internal components of a terminal device, and may be determined according to a product type of the terminal device, which is not described in detail herein.
The memory 33 may be used to store a program that implements the above-described data processing method.
In some embodiments, the memory 33 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device or other volatile solid state storage device.
The processor 34 may be configured to load and execute the program stored in the storage to implement the steps of the data processing method described in the above-mentioned corresponding method embodiment, and the specific implementation process may refer to the description of the above-mentioned corresponding method embodiment.
In some embodiments, the processor 34 may be a Central Processing Unit (CPU), an application-specific integrated circuit (ASIC), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, and so on.
It should be understood that the structure of the terminal device shown in fig. 13 is not limited to the terminal device in the embodiment of the present invention, and in practical applications, the terminal device may include more or less components than those shown in fig. 13, or may combine some components, such as an output device, various sensors, a power supply device, an antenna, and the like, and the present invention is not limited thereto.
The embodiment of the invention also provides computer equipment which can comprise at least one communication interface, at least one memory and at least one processor, wherein the at least one communication interface, the at least one memory and the at least one processor can realize mutual data interaction through a communication bus. The types of the communication interface, the memory and the processor are similar to the types of the corresponding components of the terminal device, and reference may be made to the description of the corresponding parts of the terminal device embodiment.
Different from the terminal device embodiment, the memory in the computer device stores a program of the data processing method described from the computer device perspective, and the processor calls the program to implement the steps of the data processing method described from the computer device perspective, and the specific implementation process can refer to the description of the method embodiment described from the computer device perspective.
In addition, the computer device may be a terminal device or a server, the product type of the computer device is not limited in the present invention, and the composition structure of the computer device is not limited to the above listed components, and may be determined according to the specific product type, and the present invention is not described in detail.
Finally, it should be noted that, in the present specification, the embodiments are described in a progressive or parallel manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. The device, the terminal device and the computer device disclosed by the embodiment correspond to the method disclosed by the embodiment, so that the description is relatively simple, and the relevant points can be referred to the description of the method part.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of data processing, the method comprising:
obtaining lottery ticket information and a key of each of a plurality of issued lottery tickets;
encrypting the lottery ticket information and the key of the same issued lottery ticket to obtain a lottery ticket ciphertext of the corresponding issued lottery ticket;
synchronizing the lottery ciphertext to a blockchain network;
synchronizing keys of the plurality of issued lottery tickets to the blockchain network in response to a key publishing instruction generated when lottery purchase records of the plurality of issued lottery tickets satisfy a condition, the lottery purchase records being generated after the issued lottery tickets are purchased.
2. The method of claim 1, further comprising:
obtaining a lottery purchase request for a first lottery ciphertext of a first issuance lottery, the first issuance lottery being any one of the plurality of issuance lottery;
sending the lottery purchase request to any node in the block chain network, responding to the lottery purchase request by the node, generating a lottery purchase record aiming at the first issuing lottery, and acquiring a first key of the first lottery ciphertext;
receiving the first key fed back by the node, and decrypting the first key and the first lottery ciphertext to obtain first lottery information of the first issuing lottery;
and outputting the first lottery ticket information.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
obtaining lottery ticket checking requests aiming at the plurality of issued lottery tickets;
sending the lottery ticket checking request to any node in the block chain network, and responding the lottery ticket checking request by the node to obtain the respective keys and cipher texts of the multiple issued lottery tickets and a lottery ticket issuing record, wherein the lottery ticket issuing record comprises the total number of the multiple issued lottery tickets and reward mechanism information;
receiving the keys and cipher texts of the multiple issued lottery tickets fed back by the node, and the lottery ticket issuing records;
decrypting the key and cipher text of the same issued lottery ticket to obtain lottery ticket information of the corresponding issued lottery ticket;
and performing fairness check on the lottery ticket information of each of the plurality of issued lottery tickets by using the lottery ticket issuance record.
4. A method of data processing, the method comprising:
receiving lottery ciphertext of each of a plurality of issued lottery tickets sent by a client, and synchronizing the lottery ciphertext to a block chain network;
detecting that the lottery purchase records of the plurality of issued lottery satisfy conditions, and sending a key publishing instruction to the client;
and receiving the keys of the plurality of issued lottery tickets fed back by the client in response to the key publishing instruction, and synchronizing the received keys to the blockchain network.
5. The method of claim 4, further comprising:
obtaining a lottery purchase request for a first lottery ciphertext of a first issuance lottery, the first issuance lottery being any one of the plurality of issuance lottery;
generating a lottery purchase record for the first issue lottery in response to the lottery purchase request, synchronizing the lottery purchase record to the blockchain network;
and obtaining a first key of the first lottery ciphertext, and feeding the first key back to a target client initiating the lottery purchase request, so that the target client decrypts the first key and the first lottery ciphertext to obtain first lottery information of the first issuing lottery.
6. The method of claim 5, wherein said generating a lottery purchase record for said first issued lottery in response to said lottery purchase request comprises:
transferring the virtual resource of the first issuance lottery from the purchasing user account to the lottery issuing user account in response to the lottery purchase request;
generating a lottery purchase record for the first issue lottery;
the method further comprises the following steps:
detecting that the lottery purchase record is invalid, updating the lottery purchase record recorded by the blockchain network, and transferring the virtual resource of the issued lottery from the lottery issue user account to the purchasing user account, wherein the lottery purchase record is invalid and indicates that the lottery purchase record of the first issued lottery exists in the existing lottery purchase records of the blockchain network;
and detecting that the lottery purchase record is valid, and executing the step of obtaining the first key of the first lottery ciphertext.
7. The method according to any one of claims 4 to 6, further comprising:
responding to lottery ticket checking requests aiming at the plurality of issued lottery tickets, and acquiring keys and cipher texts of the plurality of issued lottery tickets and a lottery ticket issuing record, wherein the lottery ticket issuing record comprises the total number of the plurality of issued lottery tickets and reward mechanism information;
and sending the keys and cipher texts of the multiple issued lottery tickets and the lottery ticket issuing records to a target client initiating the lottery ticket checking request, decrypting the keys and cipher texts of the same issued lottery tickets by the target client, and performing fairness check on the decrypted lottery ticket information of the multiple issued lottery tickets by using the lottery ticket issuing records.
8. A data processing apparatus, characterized in that the apparatus comprises:
a first obtaining module, configured to obtain respective lottery information and keys of a plurality of issued lottery;
the encryption module is used for encrypting the lottery ticket information and the key of the same issued lottery ticket to obtain a corresponding lottery ticket ciphertext of the issued lottery ticket;
the first synchronization module is used for synchronizing the lottery ciphertext to a block chain network;
a key publishing module, configured to synchronize keys of the plurality of issued tickets to the blockchain network in response to a key publishing instruction, where the key publishing instruction is generated when ticket purchase records of the plurality of issued tickets satisfy a condition, and the ticket purchase records are generated after the issued tickets are purchased.
9. A data processing apparatus, characterized in that the apparatus comprises:
the lottery ciphertext receiving module is used for receiving lottery ciphertext of each of a plurality of issued lotteries sent by the client and synchronizing the lottery ciphertext to the block chain network;
the detection module is used for detecting that the lottery purchase records of the plurality of issued lottery meet the conditions and sending a key publishing instruction to the client;
and the key publishing module is used for receiving the keys of the plurality of issued lottery tickets fed back by the client in response to the key publishing instruction and synchronizing the received keys to the block chain network.
10. A storage medium having a program stored thereon, wherein the program is called by a processor to implement a data processing method according to any one of claims 1 to 3, or to implement a data processing method according to any one of claims 4 to 7.
CN201911025106.6A 2019-10-25 2019-10-25 Data processing method, device and storage medium Active CN110795749B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911025106.6A CN110795749B (en) 2019-10-25 2019-10-25 Data processing method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911025106.6A CN110795749B (en) 2019-10-25 2019-10-25 Data processing method, device and storage medium

Publications (2)

Publication Number Publication Date
CN110795749A true CN110795749A (en) 2020-02-14
CN110795749B CN110795749B (en) 2024-04-05

Family

ID=69441369

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911025106.6A Active CN110795749B (en) 2019-10-25 2019-10-25 Data processing method, device and storage medium

Country Status (1)

Country Link
CN (1) CN110795749B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112950281A (en) * 2021-03-23 2021-06-11 函谷数巢品牌管理(广州)有限公司 Block chain-based event handling method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106980488A (en) * 2017-03-14 2017-07-25 腾讯科技(深圳)有限公司 Random digit generation method and device
CN108831002A (en) * 2018-07-06 2018-11-16 电子科技大学 A kind of welfare lottery ticket justice based on block chain is announced the winners in a lottery method
CN109905379A (en) * 2019-02-02 2019-06-18 江苏通付盾科技有限公司 Lottery rewarding method and device based on block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106980488A (en) * 2017-03-14 2017-07-25 腾讯科技(深圳)有限公司 Random digit generation method and device
CN108831002A (en) * 2018-07-06 2018-11-16 电子科技大学 A kind of welfare lottery ticket justice based on block chain is announced the winners in a lottery method
CN109905379A (en) * 2019-02-02 2019-06-18 江苏通付盾科技有限公司 Lottery rewarding method and device based on block chain

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112950281A (en) * 2021-03-23 2021-06-11 函谷数巢品牌管理(广州)有限公司 Block chain-based event handling method and device

Also Published As

Publication number Publication date
CN110795749B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
US20210314313A1 (en) Certificate issuing system based on block chain
US20160267493A1 (en) Product anti-counterfeiting method, apparatus and system
CA2711243C (en) System and method for secure voting
JP6608256B2 (en) Electronic data existence certification program and existence certification server
US20190066439A1 (en) Encrypted electronic gaming ticket
CN107481140B (en) Voucher identification code processing method and system, server and storage medium
CN110599342B (en) Block chain-based identity information authorization method and device
CN108769057B (en) Identity recognition method and device based on block chain
CN111260398A (en) Advertisement putting control method and device, electronic equipment and storage medium
JP6259536B1 (en) Authentication system, authentication method and program
US11381392B2 (en) Device for off-line storage and usage of digital assets
CN107465728B (en) Information processing method, central server and storage medium for identification code
CN111241196A (en) Advertisement frequency control method and system
JP2004171544A (en) Content browsing system with time restriction
US11176548B2 (en) Systems and methods for cold payment solution
CN111461799B (en) Data processing method, data processing device, computer equipment and medium
JP6669609B2 (en) Data trading system and program
CN110795749B (en) Data processing method, device and storage medium
JP4239066B2 (en) Cloning prevention method
CN114417377B (en) Data interaction method based on block chain
CN110942292B (en) User information processing method and device, electronic equipment and storage medium
CN111461706A (en) User information binding method and device based on block chain
CN114026585A (en) Communication system, communication method, and sensor unit
JP2024007650A (en) Electronic signature system, electronic signature method, and electronic signature program
CN114066546A (en) Data processing method, network system and electronic equipment

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