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

Data processing method, device and storage medium Download PDF

Info

Publication number
CN110795749B
CN110795749B CN201911025106.6A CN201911025106A CN110795749B CN 110795749 B CN110795749 B CN 110795749B CN 201911025106 A CN201911025106 A CN 201911025106A CN 110795749 B CN110795749 B CN 110795749B
Authority
CN
China
Prior art keywords
lottery
issued
ticket
ciphertext
information
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
CN201911025106.6A
Other languages
Chinese (zh)
Other versions
CN110795749A (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

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 the data processing method, the device and the storage medium provided by the embodiment of the invention, for a lottery issuer, after determining a plurality of issued lottery and lottery information thereof issued at this time, keys corresponding to each issued lottery can be obtained, after corresponding lottery ciphertext is obtained by encrypting the keys and the lottery information of the same issued lottery, the lottery ciphertext of the plurality of issued lottery is synchronized to a blockchain network for any user to inquire and purchase, and when the lottery purchase records of the plurality of issued lottery meet the condition (such as the sale of the issued lottery is exhausted), the keys of all the lottery ciphertext are published to the blockchain network in response to a key publishing instruction generated by the key publishing instruction, so that any user can obtain the keys of any one or a plurality of issued lottery, decode the corresponding lottery ciphertext, and check the obtained lottery information, thereby ensuring the disclosure, fairness and fairness of the instant lottery system.

Description

Data processing method, device and storage medium
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a data processing method, apparatus, and storage medium.
Background
In recent years, in public places such as shops and hotels, an instant lottery (e.g., lottery) terminal has appeared, which is different from the conventional lottery, so that a purchaser can immediately know whether to pay a prize or not after buying a ticket and can pay a prize instantly.
However, the instant lottery system is a black box for the purchaser, and is opaque, so that the purchaser cannot know whether the lottery ticket printed with the jackpot prize is really printed before the purchase, and cannot verify whether the probability of the publication is real, and the fairness of the instant lottery system cannot be ensured.
Disclosure of Invention
In view of the above, the embodiments of the present invention provide a data storage method, apparatus, and storage medium, by synchronizing ticket ciphertext of a plurality of issued tickets to a blockchain network for any user to inquire and purchase, and publishing keys of all ticket ciphertext to the blockchain network for any user to check after the issued ticket is sold out, thereby ensuring disclosure, fairness, and fairness of the instant ticket system.
In order to achieve the above object, the embodiment of the present invention provides the following technical solutions:
in one aspect, an embodiment of the present invention provides a data processing method, where the method includes:
receiving a lottery ciphertext of each of a plurality of issued lottery sent by a client, and synchronizing the lottery ciphertext to a blockchain network;
detecting that the lottery ticket purchase records of the plurality of issued lottery tickets meet the condition, and sending a key publishing instruction to the client;
and receiving the keys of the plurality of issued coupons 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 ticket purchase request for a first ticket ciphertext for a first issued ticket that is any of the plurality of issued tickets;
transmitting the lottery purchase request to any node in the blockchain network, responding to the lottery purchase request by the node, generating a lottery purchase record for the first issued 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 information.
In some embodiments, the method further comprises:
acquiring ticket validation requests for the plurality of issued tickets;
transmitting the lottery validation request to any node in the blockchain network, and responding the lottery validation request by the node to obtain respective keys and lottery ciphers of the plurality of issued lottery tickets and a lottery issuing record, wherein the lottery issuing record comprises total quantity and rewarding mechanism information of the plurality of issued lottery tickets;
Receiving the respective secret keys and the ciphertext of the lottery tickets and the lottery ticket issuing records fed back by the nodes;
decrypting the secret key and the cipher text of the lottery ticket issued by the same lottery ticket to obtain the lottery ticket information of the corresponding issued lottery ticket;
and performing fairness verification on the lottery information of each of the plurality of issued lottery tickets by using the lottery issuing record.
In yet another aspect, an embodiment of the present invention provides a data processing method, where the method includes:
receiving a lottery ciphertext of each of a plurality of issued lottery sent by a client, and synchronizing the lottery ciphertext to a blockchain network;
detecting that the lottery ticket purchase records of the plurality of issued lottery tickets meet the condition, and sending a key publishing instruction to the client;
and receiving the keys of the plurality of issued coupons fed back by the client in response to the key publishing instruction, and synchronizing the received keys to the blockchain network.
In yet another aspect, an embodiment of the present invention provides a data processing apparatus, including:
the first acquisition module is used for acquiring lottery information and keys of each of a plurality of issued lottery;
the encryption module is used for carrying out encryption processing on the lottery information and the secret key of the same issued lottery to obtain a lottery ciphertext of the corresponding issued lottery;
The first synchronization module is used for synchronizing the lottery ciphertext to a blockchain network;
and a key publishing module for synchronizing keys of each of the plurality of issued coupons to the blockchain network in response to a key publishing instruction, the key publishing instruction being generated if a coupon purchase record of the plurality of issued coupons meets a condition, the coupon purchase record being generated after the issued coupon is purchased.
In yet another aspect, an embodiment of the present invention provides a data processing apparatus, including:
the lottery ciphertext receiving module is used for receiving the lottery ciphertext of each of a plurality of issued lottery sent by the client and synchronizing the lottery ciphertext to the blockchain network;
the detection module is used for detecting that the lottery ticket purchase records of the plurality of issued lottery tickets 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 coupons fed back by the client in response to the key publishing instruction and synchronizing the received keys to the blockchain network.
In yet another aspect, an embodiment of the present invention provides a storage medium having a program stored thereon, wherein the program is called by a processor to implement the data processing method described above.
Based on the above technical solution, the embodiments of the present invention provide a data processing method, apparatus and storage medium, for a lottery issuer, after determining a plurality of issued certificates and their certificate information of the present issue, the issuer may obtain keys corresponding to each issued certificate, and after obtaining corresponding certificate ciphers by encrypting the keys and certificate information of the same issued certificate, synchronize the certificate ciphers of the plurality of issued certificates to a blockchain network for any user to inquire and purchase, and when the certificate purchase records of the plurality of issued certificates satisfy the conditions (such as the issued certificate is sold out), in response to the key publishing instruction generated thereby, publish the keys of all the certificate ciphers to the blockchain network, so that any user can obtain any one or more of the keys of the issued certificates, decode the corresponding certificate ciphers, and verify the obtained certificate information, thereby ensuring the disclosure, fairness and fairness of the instant-open type lottery system.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a data sharing system for implementing a data processing method according to an embodiment of the present invention;
FIG. 2 is a block chain architecture diagram illustrating a data processing method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a new block generation process in a blockchain implementing a data processing method in accordance with an embodiment of the present invention;
FIG. 4 is a schematic diagram of a block chain network for implementing a data processing method according to an embodiment of the present invention;
fig. 5 shows a signaling flow diagram of an alternative example of a data processing method according to an embodiment of the present invention;
fig. 6 shows a signaling flow diagram of a further alternative example of a data processing method proposed by an embodiment of the present invention;
fig. 7 shows a signaling flow diagram of a further alternative example of a data processing method proposed by an embodiment of the present invention;
FIG. 8 is a schematic diagram of a scenario 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 according to an embodiment of the present invention;
FIG. 10 is a block diagram showing still another alternative example of a data processing apparatus according to an embodiment of the present invention;
FIG. 11 is a block diagram showing still another alternative example of a data processing apparatus according to an embodiment of the present invention;
FIG. 12 is a block diagram showing still another alternative example of a data processing apparatus according to an embodiment of the present invention;
fig. 13 shows a schematic hardware structure of a terminal device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
For convenience of description, only a portion related to the present invention is shown in the drawings. Embodiments of the invention and features of the embodiments may be combined with each other without conflict. Moreover, it should be appreciated that the terms "system," "apparatus," "device," "unit," and/or "module" as used herein are intended to be one way to distinguish between different components, elements, components, portions, or assemblies at different levels. However, if other words can achieve the same purpose, the word can be replaced by other expressions.
In addition, the terms "a," "an," "the," and/or "the" are not specific to the singular, but may also include the plural, unless the context clearly indicates otherwise. In general, the terms "comprises" and "comprising" merely indicate that the steps and elements are explicitly identified, and they do not constitute an exclusive list, as other steps or elements may be included in a method or apparatus. The inclusion of an element defined by the phrase "comprising one … …" does not exclude the presence of additional identical elements in a process, method or apparatus comprising the element.
Wherein, in the description of the embodiments of the present invention, unless otherwise indicated, "/" means or, for example, a/B may represent a or B; "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In addition, in the description of the embodiments of the present invention, "plurality" means two or more than two. The following terms "first", "second" 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 defining "a first" or "a second" may explicitly or implicitly include one or more such feature.
A flowchart is used in the present invention to describe the operations performed by a system according to embodiments of the present invention. It should be appreciated that the preceding or following operations are not necessarily performed in order precisely. Rather, the steps may be processed in reverse order or simultaneously. Also, other operations may be added to or removed from these processes.
Aiming at the problems raised by the background technology, the invention provides that after the instant lottery (hereinafter called the lottery for short) is encrypted, the instant lottery is prestored in a sharing system, so that all users can check ciphertext before buying, and know the relevant information such as the rewarding rule, the content and the like of the lottery and the ciphertext of all the lottery; after the lottery is sold out, the sharing system can publish the keys of all the lottery, so that all users can check whether the lottery information is consistent with the published lottery information at any time, and the effects of disclosure 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, where the data sharing system may include a plurality of nodes 101, and the plurality of nodes 101 may be 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 the information intercommunication in the data sharing system, information connection can exist between each node in the data sharing system, and the nodes can transmit information through the information connection. For example, when any 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 the shared data, so that the data stored on all nodes in the data sharing system are consistent.
Each node in the data sharing system has a node identifier corresponding to the node, and each node in the data sharing system can store the node identifiers of other nodes in the data sharing system, so that the generated block can be broadcast to other nodes in the data sharing system according to the node identifiers of other nodes.
In practical application, each node may maintain a node identifier list as shown in the following table, and the node name and the node identifier are correspondingly stored in the node identifier list. The node identifier may be an IP (Internet Protocol, protocol of interconnection between networks) address, and any other information that can be used to identify the node, and the IP address is only illustrated in table 1.
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 and the same blockchain. The blockchain consists of a plurality of blocks (blocks), each Block can record all transactions and state structures within a period of time, the transactions are a common knowledge of the current account book state, the transactions can be an account book operation, the account book state can be changed once, for example, a transfer record is added, the blocks can be connected in series according to the occurrence sequence to form the blockchain, and the blockchain is a log record of the state change of the whole account book.
Referring to fig. 2, the blockchain is composed of a plurality of blocks, the starting block includes a block header and a block body, the block header stores an input information characteristic value, a version number, a time stamp and a difficulty value, and the block body stores input information; the next block of the starting block takes the starting block as a father 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 father 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 are associated with the block data stored in the father block, and the safety of the input information in the block is ensured.
When each block in the blockchain is generated, referring to fig. 3, when the node where the blockchain is located receives input information, checking the input information, after the checking is completed, storing the input information into a memory pool, and updating a hash tree used for recording the input information; then, updating the update time stamp to the time of receiving the input information, trying different random numbers, and calculating the characteristic value for a plurality of 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 eigenvalue algorithm used to calculate eigenvalues; version (version number) is version information of the related block protocol in the block chain; the prev_hash is the block header characteristic value of the parent block of the current block; the merkle_root is a characteristic value of input information; ntime is the update time of the update timestamp; the nbits is the current difficulty, is a fixed value in a period of time, and is determined again after exceeding a fixed period of time; x is a random number; TARGET is a eigenvalue threshold that can be determined from nbits.
Thus, when the random number meeting the formula is calculated, the information can be correspondingly stored to generate the block head and the block main body, and the current block is obtained. And then, the node where the blockchain is located sends the newly generated blocks to other nodes in the data sharing system where the newly generated blocks are located according to the node identification of other nodes in the data sharing system, the other nodes verify the newly generated blocks, and the newly generated blocks are added into the blockchain stored in the newly generated blocks after the verification is completed.
Therefore, the blockchain can be regarded as a distributed data record account book, only information is allowed to be added, the information is not allowed to be deleted, and the system has the characteristics of disclosure and tamper resistance.
In order to more clearly describe the technical scheme of the invention, the data processing method provided by the embodiment of the invention is introduced below in combination with an application scene.
Fig. 4 shows a system architecture diagram for implementing the data processing method proposed by the present invention, as shown in fig. 4, the system may comprise: the first client 100, the second client 200, and the nodes 1 to N, N are positive integers, 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 network nodes belonging to the blockchain network, where the first client 100 may be operated on a first terminal device, the second client 200 may be operated on a second terminal device, and the nodes 1 to N may be computer devices.
In this embodiment, the first terminal device may be a terminal device used by an issuer of a lottery ticket (such as a lottery ticket, a rocking ball, etc.), and before issuing the lottery ticket, the issuer may encrypt, by the first client 100, relevant data of the batch of lottery tickets to be issued, such as the set prize type and content, the number of lottery tickets of each type, etc., and the obtained ciphertext is entered into the blockchain network, and is synchronized to each network node in the blockchain network through a consensus mechanism.
The second terminal device may be a user who purchases or checks the issued lottery, performs the electronic device used for the lottery purchase or inquiry, after the lottery is issued, any user initiates a lottery purchase/inquiry request to any network node of the blockchain network through the second client 200 running on the second terminal device, obtains the currently issued lottery content (such as the number of the lottery) and the corresponding reward mechanism thereof, such as the reward type, the reward content of each type of reward, the winning number and other mechanism content, and the user can select which lottery to purchase this time from to obtain the key corresponding to the lottery, so as to decrypt the ciphertext corresponding to the lottery by using the key, and obtain the information of the lottery, such as whether the lottery purchased this time wins, wins a number of rewards, what the reward content is.
After the above analysis is performed, after the present batch of the lottery is sold out, the blockchain network may publish the keys of all the lottery in the whole network, specifically, the issuer may broadcast the keys of all the lottery to the blockchain network through the first client 100, or may store the keys in the blockchain network in advance, and when a preset decryption condition (such as that all the lottery is sold out) is met, the ciphertext of each of the lottery is automatically decrypted for any user to check, and at this time, any user may acquire all the information of the lottery and compare with the lottery description published in advance by the issuer to verify whether the present instant-opening lottery activity is fair.
The above nodes 1 to N may be any network node in a blockchain network, and may receive various requests initiated by any user, such as a payment request, a query request, a release request, etc., and may also perform verification on information carried by the request, for example, by using a hash value to implement verification, so as to improve security of a request response, and specific verification content may be determined by using a request type and content.
It should be understood that, the first terminal device and the second terminal device may be computer devices with data processing capability, and install a corresponding first client or second client, so as to implement application requirements such as issuing, purchasing, checking, etc. of the lottery ticket, and specific implementation processes may refer to the description of the corresponding embodiments below, and the first client and the second client may be independent application programs, or may be functional modules integrated on other application programs. In some embodiments, the terminal device and the second terminal device may be specifically a computer device such as a smart phone, a tablet computer, a personal computer (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 the specific application scenario requirements.
Accordingly, the above nodes 1 to N may be specifically terminal devices as illustrated above, or may be data processing devices with computing capabilities, such as servers, where 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 merely an example and is not intended to limit the number and types of network nodes in the blockchain network in any way.
The data processing method according to the present invention will be described with reference to the system architecture shown in fig. 4, and referring to fig. 5, a signaling flow chart illustrating an alternative example of the data processing method according to the present invention may be applied to a network node in a blockchain network, and with reference to the description of the corresponding parts above regarding the structure of the blockchain network, as shown in fig. 5, the method may include, but is not limited to, the following steps:
step S11, a first client acquires lottery information of a plurality of issued lottery;
the issuer of the lottery ticket can determine the lottery ticket information of the lottery ticket (marked as the issued lottery ticket) which needs to be issued at the present time, such as the number, type, rewarding data, rewarding content and the like of the lottery ticket.
In some embodiments, the issued coupons may be randomly scrambled to ensure the subsequent irregularity of the encryption sequence of the issued coupons. That is, the lottery ticket information of the plurality of issued lottery tickets acquired in step S11 does not have any rule with respect to each other.
Step S12, the first client acquires the keys of a plurality of issued coupons;
since the lottery information acquired 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 certificates will be purchased by different users, and if a plurality of certificate information is encrypted by a uniform key, a certain user will obtain a key of a certain issued certificate, and then the key can be used to obtain the certificate information of all issued certificates, so that the security of the certificate information of different issued certificates cannot be ensured.
In practice, 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, for example, a character string having a length of 32 bytes, etc., but the present invention is not limited to this generation method.
Step S13, the first client encrypts the secret key and the corresponding lottery information to obtain a lottery ciphertext of the corresponding issued lottery;
in some implementations of embodiments, the present invention may employ a secure and reliable symmetric encryption algorithm to encrypt the ticket information for each issued ticket. 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 be deduced from the encryption key.
In practical application of the embodiment, after the first client performs special encryption algorithm processing on the encryption key and the lottery information corresponding to any one of the issued lottery, a complex encryption ciphertext, namely, a lottery ciphertext is obtained and output. After the user obtains the ciphertext of a lottery issued from the blockchain network through the second client, the user can decrypt the corresponding ciphertext of the lottery by using the encryption key of the lottery issued 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 same key may be used to encrypt and decrypt the ticket information, and the key may be obtained after the user pays to purchase the issued ticket, and the specific process may be described in the corresponding part of the following embodiments.
In some implementation manners of embodiments, for the lottery information of different issued coupons, the encryption algorithm adopted in the encryption processing may be an asymmetric encryption algorithm, that is, the encryption key may be different from the decryption key, after the encryption key is used to encrypt the lottery information of the corresponding issued coupon, the obtained ciphertext of the lottery and the decryption key are simultaneously recorded into the blockchain network, so that after a user purchases the issued coupon, the user may be informed of the corresponding decryption key, so that the second client of the user may use the decryption key to decrypt the ciphertext of the lottery, and obtain the corresponding plaintext information. It should be understood that the decryption keys for different issued coupons are often different, and the method for obtaining the encryption key and the decryption key in this encryption and decryption implementation is not limited by the present invention.
In practical application, after obtaining the ciphertext of all the issued lottery tickets, the first client can generate corresponding lottery ticket issuing records, and synchronize the lottery ticket issuing records to the whole blockchain network, so that a subsequent user can know the issuing condition of the batch of lottery tickets by inquiring the lottery ticket issuing records, and then select a certain issued lottery ticket to be purchased; of course, the user may quickly check the information about each issued ticket issued by using the ticket issuing record after all the issued tickets issued at this time are sold out.
In this case, the ticket issuing record may include the contents of the rewarding mechanism, the issuing time, the number of issues, the issuer information, etc. of each issued ticket, and the present invention is not limited to the contents of the information included in the ticket issuing record, and may be determined according to actual demands.
In some embodiments, after encrypting the ticket information in any of the above described encryption manners, the resulting ticket ciphertext may have a format as shown in table 2 below, but is not limited to such information format:
TABLE 2
In table 2, the content corresponding to the field pre-tx-HASH may represent a check HASH value (HASH value) of the entire content of the previous Transaction (such as a ticket ciphertext of an issued ticket), and the embodiment may use the SHA-256 algorithm (a HASH function) to compress the ticket information of the issued ticket, so as to reduce the data size thereof, and generate a HASH value in a certain format, where the HASH value may be a character string consisting of a random letter and a number, which is equivalent to an array with a length of 32 bytes, but the method is not limited to this processing, and table 2 is only exemplified by this processing method.
The check value obtained by HASH calculation of the contents of each field in table 2 of the present Transaction by using the SHA-256 algorithm may be recorded in the field of "check HASH value of the present Transaction", and the check value is a 32-byte character string, and the specific content is not limited as described above for analysis of the SHA-256 algorithm. It should be understood that the hash calculation is performed by other hash algorithms, and the byte size of the obtained hash value may be 32 bytes, or may be other sizes.
The content of the field serial (code) may be the code of the issued lottery ticket itself, and the corresponding code is different for different issued lottery tickets, that is, the code has unique characteristics, and the present invention does not limit the representation mode of the code, and may be a number and/or letter.
The content of the field type may be the type of the transaction record, specifically may include the ticket information of issuing a ticket, the purchase record of the issued ticket for the user to purchase, etc., and in the ticket issuing stage, the content of the field type is mainly the transaction type of the ticket information of the corresponding issued ticket, and after the purchase record is to be sent, the transaction type of the purchase record may also appear.
The content of the field info (information) may be a ticket ciphertext corresponding to the issued ticket, and if a purchase record exists, the field info (information) may also include information such as a purchase ticket number corresponding to the purchase record. In some embodiments, for the content of the record of the type field, the transaction type of the lottery information may be represented by 0, and the transaction type of the purchase record may be represented by 1, but is not limited to the representation of 0 and 1. It can be seen that the present invention can intuitively know whether the issuing ticket is purchased by the user through the contents of the type field.
Step S14, the first client broadcasts the ciphertext of each lottery of the plurality of issued lottery in the blockchain network;
step S15, all the lottery ciphertext broadcasted is recorded by the nodes 1 to N;
in this embodiment, after obtaining the ciphertext of each issued ticket, the first client may submit the ciphertext to any one of the nodes 1 to N in the blockchain network, that is, any network node in the blockchain network, and the node synchronizes all received ciphertext of the issued ticket to other network nodes in the blockchain network according to a consensus mechanism, so that a subsequent user may conveniently query the ciphertext of any issued ticket through the second client.
Therefore, in this embodiment, for the lottery issuer, the first client may encrypt the lottery information of all the issued certificates to be issued, synchronize the obtained lottery ciphertext to the whole blockchain network, and facilitate the buyer or the verifier (any user) to access any node of the blockchain network, obtain the information such as the lottery ciphertext of each issued certificate and the lottery issuing record, so that the buyer can select any issued certificate to purchase, thereby avoiding the situation that the issuer withholds or issues the big prize with pertinence to issue the lottery, and realizing the disclosure and fairness of issuing the lottery.
Step S16, the first client side responds to the key publishing instruction and broadcasts the keys of the issued certificates in the blockchain network;
in step S17, the nodes 1 to N record the keys of all issued coupons broadcasted.
In this embodiment, after the respective keys of all issued certificates to be issued at this time are acquired by the first client, the keys may be stored, so that when it is determined that the certificate purchase records of a plurality of issued certificates meet the condition, if all issued certificates issued at this time are sold out, a key publishing instruction may be generated, and the first client may respond to the key publishing instruction to synchronize the respective keys of the prestored issued certificates to each node in the blockchain network, that is, publish the keys of all issued certificates on the whole network. The implementation process of implementing information synchronization is not described in detail with respect to how each node in the blockchain network implements information synchronization in a consensus manner.
If any user can access any node in the blockchain network to acquire the key of any one or more issued lottery, the corresponding cipher text of the lottery is decrypted by using the key to obtain the lottery information of the corresponding issued lottery, and the lottery information can be compared with the lottery issuing record published by the issuer to verify the fairness of the instant lottery system.
The present invention is not limited to the specific content indicated by the condition that the lottery ticket purchase records of the plurality of issued lottery tickets satisfy, but may be a condition indicating that all of the issued lottery tickets issued this time are sold out, such as the number of the lottery ticket purchase records reaching the number of all of the issued lottery tickets issued.
Therefore, in this embodiment, after the issued lottery is sold out, the keys of all issued lottery are published in the whole blockchain network, so that any user can check the lottery information of all issued lottery purchased, the transparency of the whole lottery issuing process is realized, the traversal of lottery purchasing and inquiring is improved, and the fairness of the lottery system is ensured.
The data processing method according to the present invention will be described with reference to fig. 6, which is a signaling flow chart illustrating another alternative example of the data processing method according to the present invention, where the method may be applied to a network node in a blockchain network, and this embodiment mainly uses a scenario in which a user purchases a issued lottery ticket as an example, and regarding a process of issuing relevant information of the issued lottery ticket, description of corresponding parts of the foregoing embodiment may be referred to, which is not repeated. As shown in fig. 6, the data processing method proposed in the present embodiment may include, but is not limited to, the following steps:
Step S21, the second client obtains a lottery ticket purchase request of a first lottery ticket ciphertext aiming at a first issuing lottery ticket;
following the description of the above embodiments, the ticket issuer issues all ticket ciphertext of issued tickets to the entire blockchain network in advance, and any user can obtain all ticket ciphertext by accessing the blockchain network. Based on this, when a user needs to purchase an issued ticket, any node in the blockchain network may be accessed to obtain a ticket ciphertext of each issued ticket that is not currently sold, from which the user selects the issued ticket to purchase, and then, the second client may generate a ticket purchase request for the ticket ciphertext of the selected issued ticket in response to a selection operation of the user, where the generated ticket ciphertext of the issued ticket selected by the user is recorded as a first ticket ciphertext, and the generated ticket purchase request may include the first ticket ciphertext, user identification information of the purchasing user (such as account information registered by the user in the ticket system, a second client identification, etc.), and so on.
In some embodiments, when the second client displays the ciphertext of each issued ticket, the second client may also display the virtual resource (such as the amount of money) that is required to purchase the corresponding issued ticket, and the user may complete the payment operation while selecting the issued ticket to be purchased, where the request for buying the ticket may further include whether the user pays the virtual resource required for the selected issued ticket. The present invention is not limited to the contents included in the acquired lottery ticket purchase request.
Step S22, the second client transmits the lottery purchase request to any node in the blockchain network;
step S23, the node responds to the lottery buying request, determines that the second client side pays successfully, and generates a lottery buying record aiming at the first lottery ciphertext;
step S24, the node synchronizes the lottery purchase record to the whole blockchain network;
after the user determines the issued lottery to be purchased through the second client, the related information of the issued lottery to be purchased can be synchronized to the whole blockchain network, and after the blockchain network determines that the user finishes the payment operation on the issued lottery selected to be purchased and determines that the payment is successful, a lottery purchase record aiming at the first lottery ciphertext can be generated, so that the subsequent user can know which issued lottery has been sold through the lottery purchase record.
In some embodiments, the node in the blockchain network may respond to the request for buying the lottery ticket, and may successfully transfer the virtual resource of the first issued lottery ticket from the buying user account to the lottery ticket issuing user account, and determine that the second client is successful in payment.
The specific content included in the ticket purchase record is not limited, and may include information about the issued ticket purchased by the user, the time of purchase, the time of issuance of the issued ticket, whether to pay, the time of payment, the number of purchases, and the like.
It should be understood that, for the node in the direct blockchain network that directly receives the ticket purchase request, verifies whether the payment is successful, and generates the ticket purchase record, the node may synchronize the ticket purchase record to other nodes in a consensus manner, so that any node in the blockchain network can obtain the required information after a query request is initiated, and the implementation process of how a node synchronizes the obtained information to the whole blockchain network is not described in detail in the present invention.
Step S25, the node detects that the lottery purchase record is invalid, updates the lottery purchase record recorded by each node of the blockchain network, and refunds to the second client;
in this embodiment, if there is already a ticket purchase record that the same issued ticket has been successfully purchased by another purchaser before the current user purchases the issued ticket, the ticket purchase record generated for the purchase operation of the user may be considered invalid, and refund may be performed on the second client of the current user at this time, for example, virtual resources spent in purchasing the issued ticket in advance at this time are forwarded to the user account of the current user from the account of the ticket issuer, and the specific implementation process will not be described in detail.
As can be seen, the invalidation of the ticket purchase record may indicate that, among the existing ticket purchase records of the blockchain network, there is a ticket purchase record of the first issued ticket, i.e., the first issued ticket has been purchased by other users; accordingly, the validation of the ticket purchase record may indicate that there is no ticket purchase record for the first issued ticket, i.e., the first issued ticket was first purchased, in the ticket purchase records already available in the blockchain network.
In some embodiments, after the purchaser pre-purchases the issued lottery, a request is sent to any node of the blockchain network, the node may select a lottery ciphertext of the issued lottery that is not currently purchased and feed the selected lottery ciphertext back to the second client, so that the purchaser can only select the issued lottery to be purchased from the issued lottery that is not currently sold, in which case the validity of the generated lottery purchase record may not be subsequently verified.
It should be appreciated that, in this embodiment, the blockchain network needs to update the ticket purchase record recorded in the blockchain network in time after generating a new ticket purchase record, so that when a corresponding purchase user requests later, the ticket ciphertext of each issuing ticket that is not sold can be obtained by querying the latest ticket purchase record, and the specific implementation process will not be described in detail.
Step S26, the node detects that the lottery ticket purchasing record is valid, and a first key corresponding to a first lottery ticket ciphertext is obtained;
step S27, the node feeds back the first key to the second client;
step S28, the second client decrypts the first secret key and the first lottery ciphertext to obtain first lottery information;
In step S29, the second client outputs the first ticket information.
In this case, the blockchain network may acquire the first key (i.e., the decryption key) corresponding to the issued ticket purchased by the user, thereby performing decryption processing on the obtained first ticket ciphertext. The corresponding first ticket information (i.e., the ticket plaintext of the first issuing ticket) is obtained, thereby knowing whether the prize is won.
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 will not be described in detail, and the method for generating the decryption key may refer to the description of the encryption key portion above.
Therefore, in this embodiment, since the lottery system issues the ciphertext of all issued lottery to the blockchain network in advance, the user can select any one of the unsold issued lottery to purchase at any time, which is not limited by time and region, so that convenience in purchasing the lottery is improved, and the situation that the issued lottery (such as the issued lottery corresponding to the jackpot) is not issued by the issuer is avoided, thereby ensuring disclosure and fairness of the lottery system.
Referring to fig. 7, a signaling flow chart of another alternative example of the data processing method according to the present invention is shown, where the method may be applied to a network node in a blockchain network, and this embodiment mainly uses a scenario in which a user examines all issued lottery information issued as an example, and regarding a process of issuing and purchasing related information of the issued lottery, description of corresponding parts of the foregoing embodiment may be referred to, which is not repeated herein. It should be understood that the checking user may be a purchasing user who issues a lottery ticket, or may be an issuing user who issues another lottery ticket, or any other user, where the first client may be different from the second client, and the user who issues a lottery ticket this time may be the checking user, and the fairness check may be performed according to the method described in the embodiment, where 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 transmits a lottery checking request to any node in the blockchain network;
after all issued tickets are sold out, if the user doubts about the issued ticket, a ticket checking request can be sent to any node in the blockchain network, such as any node 1 to node N, through the second client, and the ticket checking request can include second client identification information, a ticket type identification of the issued ticket requesting checking, and the like, so that the node knows which issued ticket information to query according to the ticket type identification, and the obtained information is fed back to which client.
Step S32, the node responds to the lottery checking request and acquires the respective secret keys, the lottery ciphertext information and the lottery issuing records of all issued lottery;
in this embodiment, the ticket issuing record may contain information about all issued tickets issued in advance by the issuer, such as the total number of issued tickets, the types of rewards, the number of issued tickets for each type of rewards, and the contents of rewards.
It should be understood that, since any node synchronizes to the whole blockchain network in a common manner when obtaining the respective keys, the ciphertext information and the ticket issuing records of all issued tickets, when responding to the request for checking the rewards, the node in step S32 may query its own memory or the memory of other nodes to obtain the respective keys, the ciphertext information and the ticket issuing records of all issued tickets that are requested to be checked, and may obtain other information that needs to be checked according to actual needs, which is not described in detail in the present invention.
Step S33, the node sends the respective secret keys, the cipher text information of the lottery ticket and the issuing records of the lottery ticket to the second client;
step S34, the second client decrypts the secret key and the cipher text of the lottery issued by the same lottery to obtain corresponding lottery information;
Step S35, the second client performs fairness check on the lottery information of all issued lottery by using the lottery issuing record;
in step S36, the second client synchronizes the obtained fairness check result to the blockchain network.
In practical applications, after the second client requests the keys, the ciphertext information and the ticket issuing records of all issued tickets for verification, the second client may automatically compare the key information, the ciphertext information and the ticket issuing records of all issued tickets to determine whether the ticket information of each issued ticket published in the blockchain network is consistent with the ticket information of each issued ticket obtained by decryption, thereby verifying whether the current ticket activity of the ticket system is public or fair. It should be noted that the fairness check process performed in step S35 is not limited to the method described in this section, and the flexibility can be adjusted according to the actual inspection requirement, which is not described in detail in the present invention.
The fairness verification result obtained through the fairness verification may be a result of whether the comparison is consistent, which 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 lottery issued at the current time, and the like.
In some embodiments, the second client may also directly display the obtained respective keys, the ciphertext information of the certificates and the certificate issuing records of all issued certificates, and the user manually compares the respective keys, the ciphertext information and the certificate issuing records of all issued certificates to implement fairness verification.
In summary, in this embodiment, since the relevant information such as the ticket information, the ticket purchase record, and the ticket issue record of all the issued tickets of this time are all published to the blockchain network, the transparency of the issuing and purchasing processes of the issued tickets is realized, so that after the issued ticket is sold out, the blockchain network will publish the key of the ticket ciphertext of each issued ticket, any user can acquire the key to decrypt the corresponding ticket ciphertext of the issued ticket, and verify whether the published ticket relevant information is met, thereby avoiding the occurrence of the operation of the dark box of the issuer, ensuring the disclosure, fairness and fairness of the ticket system, and improving the feeling of purchasing the ticket by the user.
In connection with the description of the data processing method according to the present invention in the above embodiments, the lottery ticket is taken as an example to simply describe the ticket issuing, purchasing and checking process, and the description of the present invention will not be repeated for other types of ticket issuing, purchasing and checking processes.
Referring to fig. 8, after determining the lottery to be issued, the lottery issuing user may acquire the lottery information of each lottery, such as the type, number and content of the lottery awards, or may acquire the key corresponding to each lottery information, and after performing encryption processing, obtain the lottery ciphertext of each lottery, synchronize the lottery ciphertext to the blockchain network, so that each node in the blockchain network may obtain the lottery ciphertext of all the lottery to be issued.
And when any user needs to purchase the lottery, marking the user as the purchasing user, accessing any node of the blockchain network to obtain the lottery ciphertext of each issued and unsold lottery, selecting one or more lottery as a first lottery, generating a lottery purchase request aiming at the first lottery ciphertext, sending the first lottery purchase request to the blockchain network, determining that the purchasing user pays successfully by any node in the blockchain network, generating a lottery purchase record and synchronizing the lottery purchase record with the whole blockchain network, feeding back a first key of the first lottery ciphertext to a client of the purchasing user, so that the client can decrypt the first key and the first lottery ciphertext (if a plurality of lottery tickets are purchased, respectively decrypting the corresponding first lottery by the plurality of first keys to obtain lottery information of each purchased, and checking the lottery number after lottery winning information is published, determining whether the lottery is prizewinning or not.
After the lottery ticket issued at this time is sold out, the secret key of all the lottery ticket issued at this time is published to the blockchain network, so that any user can perform fairness check, specifically, an inspection user (i.e. any user) initiates a lottery ticket checking request to the blockchain network through a client, any node of the blockchain network can respond to the lottery ticket checking request to obtain information such as the lottery ticket ciphertext, secret key and lottery ticket issuing record of all the lottery ticket issued at this time, the information is fed back to the client of the inspection user, the client decrypts the corresponding lottery ticket ciphertext by using the obtained secret key, and performs fairness check on each lottery ticket information obtained by decryption by using the content of the lottery ticket issuing record, such as verifying whether the information of the two information is consistent or not, after that, the obtained fairness check result can be synchronized to the blockchain network, any node of the blockchain network can be directly accessed by a subsequent user, and the fairness check result of the lottery ticket issued at this time can be known, and the disclosure, fairness and fairness of the lottery ticket system are realized.
Referring to fig. 9, there is shown a block diagram of an alternative example of a data processing apparatus according to the present invention, which may be adapted for use with a network node in a blockchain network, as shown in fig. 9, the apparatus may include:
A first acquisition module 11 for acquiring lottery information and a key of each of a plurality of issued lottery;
an encryption module 12, configured to encrypt the ticket information and the key of the same issued ticket, so as to obtain a ticket ciphertext of the corresponding issued ticket;
a first synchronization module 13, configured to synchronize the ticket ciphertext to a blockchain network;
a key publishing module 14 for synchronizing keys of each of the plurality of issued coupons to the blockchain network in response to a key publishing instruction, the key publishing instruction being generated if a coupon purchase record of the plurality of issued coupons meets a condition, the coupon purchase record being generated after the issued coupon is 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 disposed at a first terminal device that issues a lottery, and may specifically be a program function module of a first client, and for specific processes of implementing corresponding functions by these program function modules, reference may be made to the descriptions of corresponding parts of the foregoing method embodiments.
In some embodiments, as shown in fig. 10, the apparatus may further include:
A second acquisition module 15 for acquiring a ticket purchase request for a first ticket ciphertext for a first issued ticket that is any of the plurality of issued tickets;
a first request sending module 16, configured to send the ticket purchase request to any node in the blockchain network, where the node responds to the ticket purchase request, generates a ticket purchase record for the first issued ticket, and obtains a first key of the first ticket 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 ticket ciphertext to obtain first ticket information of the first issuing ticket;
and an information output module 18 for outputting the first ticket information.
In practical applications, the second obtaining module 15, the first request sending module 16, the decryption module 17, and the information output module 18 may be deployed on a second terminal device used by a user who purchases and issues a lottery, and may specifically be a program function module of the second client, and for specific processes of implementing corresponding functions by these program function modules, reference may be made to the description of corresponding parts of the foregoing method embodiments.
Since the issuing user may be a purchasing user, the second acquiring module 15, the first request transmitting module 16, the decrypting module 17, and the information outputting module 18 may be disposed in the first terminal device, or may be a program function module of the first client.
In some embodiments, as shown in fig. 11, the apparatus may further include:
a third acquisition module 19 for acquiring ticket validation requests for the plurality of issued tickets;
a second request sending module 110, configured to send the ticket checking request to any node in the blockchain network, where the node responds to the ticket checking request to obtain a key and a ticket ciphertext of each of the plurality of issued tickets, and a ticket issuing record, where the ticket issuing record includes total number of the plurality of issued tickets and rewarding mechanism information;
an information receiving module 111, configured to receive the key and the ciphertext of each of the plurality of issued coupons fed back by the node, and a ticket issuing record;
a second decryption module 112, configured to decrypt the secret key and the ciphertext of the same issued ticket, to obtain ticket information of the corresponding issued ticket;
And a verification module 113, configured to perform fairness verification on the ticket information of each of the plurality of issued tickets using the ticket issue record.
In practical applications, the third obtaining module 19, the second request sending module 110, the information receiving module 111, the second decryption module 112, and the verification module 113 may be deployed on the second terminal device used by the user who purchases the issued lottery or the non-purchasing user, and may specifically be a program function module of the second client, and for specific processes of implementing corresponding functions by these program function modules, reference may be made to the description of corresponding parts of the foregoing method embodiments.
Since the issuing user may be a purchasing user or a querying user, the third obtaining module 19, the second request sending module 110, the information receiving module 111, the second decryption module 112, and the verification module 113 may be disposed in the first terminal device, or may be a program function module of the first client.
Referring to fig. 12, there is shown a block diagram of an alternative example of a data processing apparatus according to the present invention, which may be adapted to a network node in a blockchain network, specifically any one of the above nodes 1 to N, and as shown in fig. 12, the apparatus may include:
The lottery ciphertext receiving module 21 is configured to receive a lottery ciphertext of each of a plurality of issued lottery sent by a client, and synchronize the lottery ciphertext to a blockchain network;
a detection module 22, configured to detect that the lottery ticket purchase records of the plurality of issued lottery tickets satisfy a condition, and send a key publishing instruction to the client;
and a key receiving module 23, configured to receive a key of each of the plurality of issued coupons 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 ticket purchase request acquisition module configured to acquire a lottery ticket purchase request for a first lottery ticket ciphertext of a first issued lottery ticket, the first issued lottery ticket being any of the plurality of issued lottery tickets;
a ticket purchase request response module for generating a ticket purchase record for the first issued ticket in response to the ticket purchase request, synchronizing the ticket 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 back the first key to a target client side initiating the lottery purchase request so that the target client side can decrypt the first key and the first lottery ciphertext to obtain first lottery information of the first issued lottery.
In some implementations, the ticket purchase request response module may include:
a lottery ticket purchase request response unit configured to transfer the virtual resource of the first issuing lottery ticket from a purchase user account to a lottery ticket issuing user account in response to the lottery ticket purchase request;
a lottery ticket purchase record generation unit configured to generate a lottery ticket purchase record for the first issuing lottery ticket;
correspondingly, the device can further comprise:
the transfer module is used for detecting that the lottery purchase record is invalid, updating the lottery purchase record recorded by the blockchain network, transferring the virtual resource of the issued lottery from the lottery issuing user account to the purchasing user account, wherein the fact that the lottery purchase record is invalid indicates that the lottery purchase record of the first issued lottery exists in the lottery purchase records of the blockchain network;
the effective detection module is used for detecting that the lottery ticket purchasing record is effective and triggering the key feedback module to acquire a first key of the first lottery ticket ciphertext.
In some embodiments, the apparatus may further include:
a ticket validation request response module configured to obtain a key and a ticket ciphertext for each of the plurality of issued tickets in response to ticket validation requests for the plurality of issued tickets, and a ticket issue record including a total number of the plurality of issued tickets and rewarding mechanism information;
And the information feedback module is used for sending the respective secret keys and the lottery ciphertext of the plurality of issued lottery tickets and the lottery issuing records to a target client side which initiates the lottery checking request, decrypting the secret keys and the lottery ciphertext of the same issued lottery by the target client side, and carrying out fairness check on the respective lottery information of the plurality of issued lottery tickets obtained by decryption by utilizing the lottery issuing records.
It should be noted that, regarding the various modules, units, and the like in the above-described embodiment of the apparatus applied to any one of the nodes 1 to N may be stored as program modules in the memory of the node (i.e., the computer device), and the processor executes the program modules stored in the memory to implement corresponding functions, and regarding the functions implemented by each program module and the combination thereof, and the achieved technical effects, reference may be made to descriptions of corresponding parts of the above-described method embodiment, which are not repeated herein.
The present invention also provides a storage medium on which a program can be stored, which program can be called and loaded by a processor to implement the steps of the data processing method described in the above embodiments, and the specific implementation procedure can be referred to in the description of the above corresponding embodiments.
Referring to fig. 13, a schematic hardware structure of a terminal device according to an embodiment of the present invention is shown, and the present invention does not limit a product type of the terminal device, and may be combined with the description of the corresponding parts of the above system embodiment, as shown in fig. 13, where 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 be capable of data interaction 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, etc., and may be determined according to a product type of the terminal device, a usage habit of a user to input information using the terminal device, etc.
In this embodiment, the user may obtain information such as the lottery ticket information, the lottery ticket purchase request, the lottery ticket checking request, etc. through the input device, and detailed implementation process will not be described.
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, or may include an interface, such as a USB interface, a serial/parallel interface, etc., for implementing 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 in the present invention.
The memory 33 may be used to store a program implementing 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.
Processor 34 may be configured to load and execute programs stored in the memory to implement the steps of the data processing method described in the corresponding method embodiments described above, and reference may be made to the description of the corresponding method embodiments described above for specific implementation.
In some embodiments, the processor 34 may be a central processing unit (Central Processing Unit, CPU), application-specific integrated circuit (ASIC), digital Signal Processor (DSP), application-specific integrated circuit (ASIC), off-the-shelf programmable gate array (FPGA), or other programmable logic device, or the like.
It should be understood that the structure of the terminal device shown in fig. 13 does not limit the terminal device in the embodiment of the present invention, and in practical application, the terminal device may include more or less components than those shown in fig. 13, or some components, such as an output device, various sensors, a power supply device, an antenna, etc., are combined, which is not specifically recited herein.
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 equipment, and reference is made to the description of the corresponding parts of the embodiment of the terminal equipment.
Unlike the above-described terminal device embodiment, the memory in the computer device stores a program of the data processing method described from the perspective of the computer device, and the processor invokes the program to implement the steps of the data processing method described from the perspective of the computer device, and the specific implementation process may refer to the description of the method embodiment described from the perspective of the computer device.
In addition, the computer device may be a terminal device or a server, the product type of the computer device is not limited by 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, which is not described in detail herein.
Finally, it should be noted that, in the present description, each embodiment is described in a progressive or parallel manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are only required to be referred to each other. For the apparatus, the terminal device and the computer device disclosed in the embodiments, the description is relatively simple, and the relevant parts refer to the description of the method section because the apparatus, the terminal device and the computer device correspond to the methods disclosed in the embodiments.
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 elements and steps are described above generally in terms of functionality in order to clearly illustrate the 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 solution. 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. The software modules may be disposed 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 (15)

1. A data processing method, characterized by being applied to a instant lottery ticket, the method comprising:
obtaining lottery information and keys of each of a plurality of issued lottery to be issued;
Encrypting the lottery information and the secret key of the same issued lottery to obtain a lottery ciphertext of the corresponding issued lottery;
synchronizing the ciphertext of all issued coupons to be issued to a blockchain network;
and synchronizing keys of the plurality of issued coupons to the blockchain network in response to a key publishing instruction, the key publishing instruction being generated if a coupon purchase record of the plurality of issued coupons meets a condition, the coupon purchase record being generated after the issued coupons are purchased, wherein keys of all issued coupons are published in the blockchain network for any user to verify the coupon information of all issued coupons purchased.
2. The method according to claim 1, wherein the method further comprises:
obtaining a ticket purchase request for a first ticket ciphertext for a first issued ticket that is any of the plurality of issued tickets;
transmitting the lottery purchase request to any node in the blockchain network, responding to the lottery purchase request by the node, generating a lottery purchase record for the first issued 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 information.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
acquiring ticket validation requests for the plurality of issued tickets;
transmitting the lottery validation request to any node in the blockchain network, and responding the lottery validation request by the node to obtain respective keys and lottery ciphers of the plurality of issued lottery tickets and a lottery issuing record, wherein the lottery issuing record comprises total quantity and rewarding mechanism information of the plurality of issued lottery tickets;
receiving the respective secret keys and the ciphertext of the lottery tickets and the lottery ticket issuing records fed back by the nodes;
decrypting the secret key and the cipher text of the lottery ticket issued by the same lottery ticket to obtain the lottery ticket information of the corresponding issued lottery ticket;
and performing fairness verification on the lottery information of each of the plurality of issued lottery tickets by using the lottery issuing record.
4. A data processing method, characterized by being applied to a instant lottery ticket, the method comprising:
Receiving a lottery ciphertext of each of a plurality of issued lottery to be issued, which is sent by a client, and synchronizing the lottery ciphertext to a blockchain network;
detecting that the lottery ticket purchase records of the plurality of issued lottery tickets meet the condition, and sending a key publishing instruction to the client;
and receiving the keys of the plurality of issued certificates fed back by the client in response to the key publishing instruction, and synchronizing the received keys to the blockchain network, wherein the keys of all issued certificates are published in the blockchain network, so that any user can check the purchased certificate information of all issued certificates.
5. The method according to claim 4, wherein the method further comprises:
obtaining a ticket purchase request for a first ticket ciphertext for a first issued ticket that is any of the plurality of issued tickets;
generating a ticket purchase record for the first issued ticket in response to the ticket purchase request, synchronizing the ticket purchase record to the blockchain network;
and acquiring a first key of the first lottery ciphertext, and feeding back the first key to a target client side initiating the lottery purchase request, so that the target client side 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 generating a ticket purchase record for the first issued ticket in response to the ticket purchase request comprises:
responding to the lottery ticket purchase request, and transferring the virtual resource of the first issuing lottery ticket from a purchase user account to a lottery ticket issuing user account;
generating a ticket purchase record for the first issued ticket;
the method further comprises the steps of:
detecting that the lottery purchase record is invalid, updating the lottery purchase record of the blockchain network record, and transferring the virtual resource of the issued lottery from the lottery issuing user account to the purchasing user account, wherein the fact that the lottery purchase record is invalid 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 ticket purchase record is valid, and executing the step of obtaining the first key of the first lottery ticket ciphertext.
7. The method according to any one of claims 4 to 6, further comprising:
obtaining a key and a ticket ciphertext for each of the plurality of issued tickets in response to a ticket validation request for the plurality of issued tickets, and a ticket issue record containing a total number of the plurality of issued tickets and rewards mechanism information;
And transmitting the respective keys and the lottery ciphertext of the plurality of issued lottery tickets and the lottery issuing records to a target client which initiates the lottery checking request, decrypting the respective keys and the lottery ciphertext of the same issued lottery by the target client, and performing fairness check on the respective lottery information of the plurality of issued lottery tickets obtained by decryption by using the lottery issuing records.
8. A data processing apparatus for use with a instant ticket, the apparatus comprising:
the first acquisition module is used for acquiring lottery information and keys of each of a plurality of issued lottery to be issued;
the encryption module is used for carrying out encryption processing on the lottery information and the secret key of the same issued lottery to obtain a lottery ciphertext of the corresponding issued lottery;
the first synchronization module is used for synchronizing the ciphertext of all issued lottery to be issued to the blockchain network;
and a key publishing module for synchronizing keys of each of the plurality of issued vouchers to the blockchain network in response to a key publishing instruction, the key publishing instruction being generated if a voucher purchase record of the plurality of issued vouchers satisfies a condition, the voucher purchase record being generated after the issued vouchers are purchased, wherein keys of all issued vouchers are published in the blockchain network for any user to verify lottery information of all issued vouchers purchased.
9. The apparatus of claim 8, wherein the apparatus further comprises:
a second acquisition module configured to acquire a ticket purchase request for a first ticket ciphertext for a first issued ticket that is any of the plurality of issued tickets;
a first request sending module, configured to send the ticket purchase request to any node in the blockchain network, where the node responds to the ticket purchase request, generates a ticket purchase record for the first issued ticket, and obtains a first key of the first ticket ciphertext;
the first decryption module is used for receiving the first secret key fed back by the node, and decrypting the first secret key and the first lottery ciphertext to obtain first lottery information of the first issuing lottery;
and the information output module is used for outputting the first lottery information.
10. The apparatus according to claim 8 or 9, characterized in that the apparatus further comprises:
a third acquisition module configured to acquire ticket validation requests for the plurality of issued tickets;
a second request sending module, configured to send the ticket checking request to any node in the blockchain network, where the node responds to the ticket checking request to obtain a key and a ticket ciphertext of each of the plurality of issued tickets, and a ticket issuing record, where the ticket issuing record includes total number of the plurality of issued tickets and rewarding mechanism information;
The information receiving module is used for receiving the respective secret keys and the cipher texts of the lottery issued records fed back by the nodes and the lottery issuing records;
the second decryption module is used for decrypting the secret key and the cipher text of the lottery ticket issued by the same lottery ticket to obtain the lottery ticket information of the corresponding lottery ticket issued;
and the verification module is used for carrying out fairness verification on the lottery information of each of the plurality of issued lottery by utilizing the lottery issuing records.
11. A data processing apparatus for use with a instant ticket, the apparatus comprising:
the system comprises a lottery ciphertext receiving module, a block chain network and a plurality of lottery ciphertext receiving modules, wherein the lottery ciphertext receiving module is used for receiving the lottery ciphertext of each of a plurality of issued lottery to be issued and sent by a client, and synchronizing the lottery ciphertext to the block chain network;
the detection module is used for detecting that the lottery ticket purchase records of the plurality of issued lottery tickets 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 fed back by the client in response to the key publishing instruction and synchronizing the received keys to the blockchain network, wherein the keys of all issued lottery are published in the blockchain network, so that any user can check the lottery information of all purchased issued lottery.
12. The apparatus of claim 11, wherein the apparatus further comprises:
a lottery ticket purchase request acquisition module configured to acquire a lottery ticket purchase request for a first lottery ticket ciphertext of a first issued lottery ticket, the first issued lottery ticket being any of the plurality of issued lottery tickets;
a ticket purchase request response module for generating a ticket purchase record for the first issued ticket in response to the ticket purchase request, synchronizing the ticket 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 back the first key to a target client side initiating the lottery purchase request so that the target client side can decrypt the first key and the first lottery ciphertext to obtain first lottery information of the first issued lottery.
13. The apparatus of claim 12, wherein the ticket purchase request response module comprises:
a lottery ticket purchase request response unit configured to transfer the virtual resource of the first issuing lottery ticket from a purchase user account to a lottery ticket issuing user account in response to the lottery ticket purchase request;
A lottery ticket purchase record generation unit configured to generate a lottery ticket purchase record for the first issuing lottery ticket;
the apparatus further comprises:
the transfer module is used for detecting that the lottery purchase record is invalid, updating the lottery purchase record recorded by the blockchain network, transferring the virtual resource of the issued lottery from the lottery issuing user account to the purchasing user account, wherein the fact that the lottery purchase record is invalid indicates that the lottery purchase record of the first issued lottery exists in the lottery purchase records of the blockchain network;
and the validity detection module is used for detecting that the lottery ticket purchasing record is valid, and executing the step of obtaining the first key of the first lottery ticket ciphertext.
14. The apparatus according to any one of claims 11 to 13, further comprising:
a ticket validation request response module configured to obtain a key and a ticket ciphertext for each of the plurality of issued tickets in response to ticket validation requests for the plurality of issued tickets, and a ticket issue record including a total number of the plurality of issued tickets and rewarding mechanism information;
and the information feedback module is used for sending the respective secret keys and the lottery ciphertext of the plurality of issued lottery tickets and the lottery issuing records to a target client side which initiates the lottery checking request, decrypting the secret keys and the lottery ciphertext of the same issued lottery by the target client side, and carrying out fairness check on the respective lottery information of the plurality of issued lottery tickets obtained by decryption by utilizing the lottery issuing records.
15. A storage medium having a program stored thereon, wherein the program is called by a processor to implement the data processing method according to any one of claims 1 to 3 or to implement the 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 CN110795749A (en) 2020-02-14
CN110795749B true 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)

Families Citing this family (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

Also Published As

Publication number Publication date
CN110795749A (en) 2020-02-14

Similar Documents

Publication Publication Date Title
US12063209B2 (en) Certificate issuing system based on block chain
CN107145768B (en) Copyright management method and system
US20190066439A1 (en) Encrypted electronic gaming ticket
JP6608256B2 (en) Electronic data existence certification program and existence certification server
CA2947177C (en) System and method for secure voting
US20160267493A1 (en) Product anti-counterfeiting method, apparatus and system
KR102452210B1 (en) Method of managing privacy preserving lottery
KR101702748B1 (en) Method, system and recording medium for user authentication using double encryption
CN110599342B (en) Block chain-based identity information authorization method and device
CN111241196B (en) Advertisement frequency control method and system
JP2010211294A (en) User authentication system and user authentication method
JP2004171544A (en) Content browsing system with time restriction
CN111461799B (en) Data processing method, data processing device, computer equipment and medium
KR20200119671A (en) method of distributing digital content by the amount of issuance, server performing the method, and computer program
CN109948370A (en) A kind of method for processing business based on block chain, device and electronic equipment
JP6669609B2 (en) Data trading system and program
CN109074604A (en) Platform for the Resource TOC based on apparatus
CN110795749B (en) Data processing method, device and storage medium
CN114417377B (en) Data interaction method based on block chain
JP2005352786A (en) Electronic ticket vending method, electronic ticket vending/transferring method, server device, client device, program, and recording medium
CN110942292B (en) User information processing method and device, electronic equipment and storage medium
JP2009094592A (en) Communication system
CN111461706A (en) User information binding method and device based on block chain
EP4191944A1 (en) Methods and devices for content distribution with distributed rights management
EP4191976A1 (en) Methods and devices for content distribution

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