Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.). Where a convention analogous to "A, B or at least one of C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B or C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
Note that, the lottery tickets in the following embodiments refer to electronic lottery tickets, except that the lottery tickets are specifically described as paper lottery tickets.
Embodiments of the present disclosure provide a lottery management method performed by a site server. The method comprises the steps of obtaining a lottery ticket purchasing request from terminal equipment; verifying the lottery ticket purchase request; under the condition that the lottery ticket purchase request passes the verification, transaction information is generated; and writing the transaction information to the blockchain.
Fig. 1 schematically illustrates an exemplary system architecture 100 to which a lottery management method may be applied, according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present disclosure may be applied to help those skilled in the art understand the technical content of the present disclosure, and does not mean that the embodiments of the present disclosure may not be applied to other devices, systems, environments or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include a terminal device 101, a site server 102, a redemption center server 103, and a blockchain network 104.
A user may use terminal device 101 to interact with site server 102, redemption center server 103, and blockchain network 104 to receive or send messages, etc. Various communication client applications, such as an electronic lottery application, a shopping-type application, a web browser application, a search-type application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only) may be installed on the terminal device 101.
The terminal device 101 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The site server 102 is, for example, a server or a server cluster of an electronic lottery selling site for providing an electronic lottery selling service to the terminal device.
The redemption center server 103 is, for example, a server or server cluster of an electronic lottery redemption center for verifying winning tickets and winning users corresponding to the winning tickets and redeeming prizes or awards for the winning users.
The blockchain network 104 is used to store data generated during the lottery transaction and redemption process.
It should be understood that the number of terminal devices, site servers, redemption center servers, and blockchain networks in fig. 1 are illustrative only. There may be any number of terminal devices, site servers, redemption center servers, and blockchain networks, as desired for implementation.
Fig. 2 schematically illustrates a flow chart of a lottery management method performed by a site server according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S210 to S240.
In operation S210, a lottery ticket purchase request from a terminal device is acquired.
According to an embodiment of the present disclosure, the lottery ticket purchase request may include, for example, lottery ticket information, user identity information, and first signature information.
The lottery information may include, for example, lottery type, lottery number, lottery period number, and other information related to the lottery selected by the user. The user identity information may include, for example, an account identification, an identity document number, a telephone number, and the like. The first signature information may be, for example, signature information obtained by the terminal device signing lottery information and user identity information according to the first private key.
According to embodiments of the present disclosure, each user may correspond to a pair of private and public keys, with different users having different private and public keys. The private key and the public key correspond to each other, and the information signed by the private key can be verified by the public key, so that the identity of the user can be verified by verifying the signed information. The terminal device stores the private key of the user, and the site server and the exchange center server store the public key of the user.
According to an embodiment of the present disclosure, the private key and the public key of the user who purchased the lottery ticket are referred to as a first private key and a first private key for the convenience of distinction.
Then, the lottery ticket purchase request is authenticated in operation S220.
According to an embodiment of the present disclosure, operation S220 may include, for example, obtaining a first public key corresponding to the first private key, verifying the first signature information in the lottery ticket purchase request according to the first public key, and if the first signature information is verified, determining that the lottery ticket purchase request is verified, otherwise, determining that the lottery ticket purchase request cannot be verified.
In operation S230, in case that the lottery ticket purchase request is authenticated, transaction information is generated.
According to an embodiment of the present disclosure, the transaction information may include, for example, lottery information, user identity information, and site identification of a site server, etc. information related to a lottery purchase transaction.
According to further embodiments of the present disclosure, the transaction information may further include first signature information.
According to embodiments of the present disclosure, each site server may correspond to a pair of private and public keys. In this embodiment, for convenience of distinction, the private key and the public key of the site server are referred to as a second private key and a second private key. The site server may sign the transaction information according to the second private key to obtain second signature information, and then attach the second signature information to the transaction information. The second signature information may be used to verify the identity of the seller of the lottery transaction.
In operation S240, transaction information is written to the blockchain.
According to the embodiment of the disclosure, the site server submits the transaction information to the blockchain network, and the node in the blockchain network responsible for creating the new block creates a new block according to the transaction information, and then submits the newly created block to other nodes for evaluation. If the block passes the evaluation of other nodes, each node adds the block to its own blockchain copy, so that the transaction information is recorded in the blockchain network.
According to the embodiment of the disclosure, the lottery ticket purchase request from the terminal device is obtained, the lottery ticket purchase request is verified, the transaction information is generated under the condition that the lottery ticket purchase request passes the verification, the transaction information is written into the block chain, the transaction of the lottery ticket can be completed, the paper lottery ticket does not need to be photocopied in the transaction process, waste of forest resources can be reduced, the printing cost is reduced, the transaction information of the lottery ticket is stored in the block chain, the risks of losing the lottery ticket and tampering the lottery ticket are reduced, and the security is higher.
Fig. 3A schematically illustrates a flow chart of a lottery management method performed by a redemption center server in accordance with an embodiment of the present disclosure.
As shown in fig. 3A, the method includes operations S310 to S350.
In operation S310, a lottery ticket exchange request from a terminal device is acquired.
According to an embodiment of the present disclosure, the lottery ticket redemption request may include, for example, lottery ticket information of the lottery ticket to be redeemed, user identification information of the redeemer, and third signature information. The third signature information may be signature information obtained by the terminal device signing lottery information of the lottery to be rewarded and user identity information of the rewarder according to a private key of the rewarder.
Then, it is determined whether there is exchange information corresponding to the lottery ticket exchange request in the block chain in operation S320.
According to embodiments of the present disclosure, redemption information may be used to indicate that a prize of a winning lottery has been redeemed, and the redemption information may include, for example, lottery information of the winning lottery, identity information of the winner, and the like.
According to the embodiment of the present disclosure, it is queried whether there is conversion information corresponding to the lottery ticket conversion request in the blockchain network, and if there is no conversion information corresponding to the lottery ticket conversion request in the blockchain network, operation S330 is performed. If the redemption information corresponding to the lottery ticket redemption request exists in the block chain network, it indicates that the winning lottery ticket has been redeemed, and the notification that the lottery ticket has been redeemed is fed back to the terminal device, and operations S330 to S350 are not performed any more.
In operation S330, the lottery ticket redemption request is verified.
Fig. 3B schematically illustrates a flow chart for validating a lottery redemption request in accordance with an embodiment of the present disclosure.
As shown in FIG. 3B, operation S330 may include, for example, operations S331-S332.
In operation S331, a third public key corresponding to the winning user is acquired.
According to an embodiment of the present disclosure, operation S331 may include, for example: obtaining winning lottery information including, for example, the type, the number, etc. of the winning lottery; then, searching transaction information corresponding to the winning lottery information in the block chain network, and analyzing the transaction information to obtain user identity information in the transaction information, namely identity information of a winning person; and searching the public key of the winning user from a database storing the public key of the user according to the identity information of the winning person, thereby obtaining a third public key.
In operation S332, the third signature information is verified according to the third public key.
According to the embodiment of the disclosure, the third signature information is decrypted according to the third public key to obtain lottery information and user identity information, the decrypted lottery information and user identity information are compared with the lottery information and the user identity information in the lottery exchange request, if the two are consistent, the lottery player is determined to be a winner, the lottery exchange request is determined to pass the verification, otherwise, the lottery player is determined not to be the winner, and the lottery exchange request cannot pass the verification.
Next, in operation S340, in case that the lottery ticket exchange request is verified, exchange information corresponding to the lottery ticket exchange request is generated.
According to the embodiment of the disclosure, when the lottery ticket exchange request passes the verification, the exchange information is generated according to the lottery ticket information of the winning lottery ticket, the identity information of the winner and other information.
In operation S350, the redemption information is written to the blockchain.
According to an embodiment of the disclosure, the redemption center server may submit the redemption information to the blockchain network so that the redemption information is recorded in the blockchain network. It should be noted that, regarding the specific method for submitting the redemption information to the blockchain network, reference may be made to the description about the method for submitting the transaction information to the blockchain network in operation S240 above, and details are not described here again.
According to the embodiment of the disclosure, after the exchange information is written into the block chain, the exchange center server exchanges prizes for the prize exchanging users.
Fig. 4 schematically illustrates a flow chart of a lottery management method performed by a redemption center server according to an embodiment of the disclosure.
As shown in fig. 4, the method includes operations S410 to S440.
In operation S410, a lottery ticket purchase request is generated.
In operation S420, a lottery ticket purchase request is transmitted to the site server.
In operation S430, a lottery ticket redemption request is generated.
In operation S440, the lottery ticket exchange request is transmitted to the exchange center server.
According to the embodiment of the disclosure, when a user needs to purchase lottery tickets, the user can select the lottery tickets which are wanted to be purchased through the terminal device and complete payment, then the terminal device signs the lottery information of the lottery tickets purchased by the user and the user identity information according to the private key of the user to obtain first signature information, then a lottery ticket purchase request is generated according to the lottery ticket information, the user identity information and the first signature information, and the lottery ticket purchase request is sent to the site server, so that the site server processes lottery ticket purchase transactions.
According to the embodiment of the disclosure, the user can access the blockchain network through the terminal device to inquire the relevant information of the lottery purchased by the user. When the lottery purchased by the user wins, the terminal equipment signs the lottery information and the user identity information according to the private key of the user to obtain third signature information, then generates a lottery exchange request according to the lottery information, the user identity information and the third signature information, and sends the lottery exchange request to the exchange center server, so that the exchange center server exchanges the lottery for the user.
The methods illustrated in fig. 2, 3A, 3B, and 4 are further described below in conjunction with specific embodiments.
The terminal equipment generates a public key and a private key of the user in advance and informs the site server and the exchange center server of the public key of the user.
The method comprises the steps that a user selects lottery tickets to be purchased through terminal equipment and finishes payment, then the terminal equipment signs the lottery ticket information of the lottery tickets purchased by the user and the user identity information according to a private key of the user to obtain first signature information, then a lottery ticket purchase request is generated according to the lottery ticket information, the user identity information and the first signature information, and the lottery ticket purchase request is sent to a site server.
The site server receives the lottery ticket purchase request from the terminal equipment and then verifies the first signature information in the lottery ticket purchase request according to the first public key. After the first signature information passes the verification, the site server signs the lottery information, the user identity information and the site identification of the site server according to the private key of the site to obtain second signature information, and then transaction information is generated according to the lottery information, the user identity information, the first signature information, the site identification and the second signature information. Transaction information is then written to the blockchain network.
And after the block chain network finishes the writing of the transaction information, returning a processing result to the site server.
And the site server receives the processing result returned by the blockchain network and feeds back a successful purchase message to the terminal equipment.
The user can inquire the related information of the lottery purchased by the user in the block chain network through the terminal equipment. When the lottery purchased by the user wins, the terminal equipment signs the lottery information and the user identity information according to the private key of the user to obtain third signature information. And then generating a lottery ticket exchange request according to the lottery ticket information, the user identity information and the third signature information, and sending the lottery ticket exchange request to the exchange center server.
The exchange center server receives a lottery ticket exchange request from the terminal equipment. And then, after inquiring in the block chain network, finding that the exchange information corresponding to the lottery exchange request does not exist, and finding out the transaction information corresponding to the winning lottery information in the block chain network. Then, the user identity information in the transaction information, namely the identity information of the winner, is obtained by analyzing the transaction information. And searching the public key of the winning user from a database storing the public key of the user according to the identity information of the winning person, thereby obtaining a third public key. And decrypting the third signature information according to the third public key to obtain lottery information and user identity information, and comparing the lottery information and the user identity information obtained by decryption with the lottery information and the user identity information in the lottery exchange request. If the two are consistent, the lottery information of the winning lottery and the identity information of the winner are generated to exchange information, and the exchange information is written into the block chain.
And after the block chain network finishes writing the exchange information, returning a processing result to the exchange center server.
And after receiving the processing result returned by the block chain network, the exchange center server issues the bonus to the account of the bonus exchange user.
Fig. 5 schematically illustrates a block diagram of a lottery management system according to an embodiment of the present disclosure.
As shown in fig. 5, the system 500 includes a site server 510, a redemption center server 520, and a terminal device 530.
A site server 510 for acquiring a lottery ticket purchase request from a terminal device; verifying the lottery ticket purchase request; under the condition that the lottery ticket purchasing request passes the verification, transaction information is generated; and writing the transaction information into a blockchain.
The exchange center server 520 is used for acquiring a lottery ticket exchange request from the terminal equipment; determining whether the block chain has exchange information corresponding to the lottery exchange request; verifying the lottery ticket exchange request under the condition that the exchange information does not exist in the block chain; generating exchange information corresponding to the lottery ticket exchange request under the condition that the lottery ticket exchange request passes the verification; and writing the exchange information into the block chain.
A terminal device 530 for generating a lottery ticket purchase request; sending a lottery ticket purchase request to a site server; generating a lottery ticket exchange request; and sending the lottery ticket exchange request to the exchange center server.
According to the embodiment of the disclosure, the lottery ticket purchase request from the terminal device is obtained, the lottery ticket purchase request is verified, the transaction information is generated under the condition that the lottery ticket purchase request passes the verification, the transaction information is written into the block chain, the transaction of the lottery ticket can be completed, the paper lottery ticket does not need to be photocopied in the transaction process, waste of forest resources can be reduced, the printing cost is reduced, the transaction information of the lottery ticket is stored in the block chain, the risks of losing the lottery ticket and tampering the lottery ticket are reduced, and the security is higher.
Any number of modules, sub-modules, units, sub-units, or at least part of the functionality of any number thereof according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, and sub-units according to the embodiments of the present disclosure may be implemented by being split into a plurality of modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in any other reasonable manner of hardware or firmware by integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware, and firmware implementations. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the disclosure may be at least partially implemented as a computer program module, which when executed may perform the corresponding functions.
For example, any of the site server 510, the redemption center server 520, and the terminal device 530 may be combined in one module for implementation, or any of the modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the site server 510, the redemption center server 520 and the terminal device 530 may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in any one of or a suitable combination of software, hardware and firmware implementations. Alternatively, at least one of the site server 510, the redemption center server 520 and the terminal device 530 may be implemented at least in part as computer program modules that, when executed, may perform corresponding functions.
FIG. 6 schematically shows a block diagram of a computer system suitable for implementing the above described method according to an embodiment of the present disclosure. The computer system illustrated in FIG. 6 is only one example and should not impose any limitations on the scope of use or functionality of embodiments of the disclosure.
As shown in fig. 6, a computer system 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. Processor 601 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 601 may also include onboard memory for caching purposes. Processor 601 may include a single processing unit or multiple processing units for performing different actions of a method flow according to embodiments of the disclosure.
In the RAM 603, various programs and data necessary for the operation of the system 600 are stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. The processor 601 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 602 and/or RAM 603. It is to be noted that the programs may also be stored in one or more memories other than the ROM 602 and RAM 603. The processor 601 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, system 600 may also include an input/output (I/O) interface 605, input/output (I/O) interface 605 also connected to bus 604. The system 600 may also include one or more of the following components connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
According to embodiments of the present disclosure, method flows according to embodiments of the present disclosure may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program, when executed by the processor 601, performs the above-described functions defined in the system of the embodiments of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 602 and/or RAM 603 described above and/or one or more memories other than the ROM 602 and RAM 603.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.