CN109767271B - Lottery method and equipment based on block chain - Google Patents

Lottery method and equipment based on block chain Download PDF

Info

Publication number
CN109767271B
CN109767271B CN201910047049.5A CN201910047049A CN109767271B CN 109767271 B CN109767271 B CN 109767271B CN 201910047049 A CN201910047049 A CN 201910047049A CN 109767271 B CN109767271 B CN 109767271B
Authority
CN
China
Prior art keywords
lottery
user information
activity
blockchain
blockchain account
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
CN201910047049.5A
Other languages
Chinese (zh)
Other versions
CN109767271A (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.)
Zhongan Information Technology Service Co Ltd
Original Assignee
Zhongan Information Technology Service 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 Zhongan Information Technology Service Co Ltd filed Critical Zhongan Information Technology Service Co Ltd
Priority to CN201910047049.5A priority Critical patent/CN109767271B/en
Publication of CN109767271A publication Critical patent/CN109767271A/en
Application granted granted Critical
Publication of CN109767271B publication Critical patent/CN109767271B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present disclosure discloses a lottery method and apparatus based on a blockchain, the lottery method including: receiving lottery configuration parameters from a sponsor; transmitting the lottery configuration parameters to a blockchain account; receiving one or more user information participating in the lottery; sending a lottery processing request to the blockchain account; receiving lottery results and transaction hash values corresponding to the user information; processing the lottery result to generate a readable lottery result; and transmitting the readable lottery result to a client corresponding to the user information. The lottery drawing method and the lottery drawing device can solve the problems that the lottery drawing activity initiated by the existing sponsor is unfair and opaque, and can realize the fair and true process of the user participating in the lottery drawing, so that the trust degree of the user to the sponsor is improved.

Description

Lottery method and equipment based on block chain
Technical Field
The present disclosure relates to the field of blockchain technologies, and more particularly, to a blockchain-based lottery method and a blockchain-based lottery apparatus.
Background
On the one hand, the existing lottery system, especially the lottery marketing system of many merchants, cannot sense the fairness and the authenticity of the lottery activity content in the process of participating in the lottery, and the data of specific lottery items and winning results are completely opaque to the users. On the other hand, the sponsor may use the sponsor management authority to manually modify winning lists, winning prizes in the lottery system, resulting in user distrust to the sponsor.
The Blockchain technology is a technology based on a decentralised peer-to-peer network, combines a cryptography principle with a consensus mechanism to ensure the data continuity and persistence of each distributed node, thereby realizing the purposes of instant information verification, traceability, difficult tampering and incapability of shielding, and further creating a set of privacy, high-efficiency and safe shared value system.
The intelligent contracts on the blockchain are a section of computer executing a secondary program, and the intelligent contracts based on the blockchain technology not only can exert the advantages of the intelligent contracts in the aspect of cost efficiency, but also can avoid the interference of malicious behaviors on the normal execution of the intelligent contracts. The intelligent contracts are written into the blockchain in a digital mode, and the characteristics of the blockchain technology ensure that the whole process of storage, reading and execution is transparent and trackable and can not be clenched and changed. Meanwhile, a set of state machine systems are built by a consensus algorithm of the blockchain, so that intelligent contracts can be operated efficiently.
Disclosure of Invention
Because the existing lottery system can not enable the users participating in the lottery to perceive the fairness and the authenticity of the lottery activity content, the possibility that the sponsor uses the management authority of the sponsor to manually modify the winning list and the winning prize in the lottery system is caused, and the user is not trusted to the sponsor. Therefore, there is a need for a lottery method that is not tamperable, tracks lottery results and lottery algorithms, and increases the confidence level of winning results.
In view of the foregoing, a first aspect of the present disclosure proposes a lottery method based on a blockchain, the lottery method including:
receiving lottery configuration parameters from a sponsor, wherein the lottery configuration parameters at least comprise a starting time, an ending time, a lottery activity rule, a lottery algorithm and a lottery activity prize related to a lottery activity;
transmitting the lottery configuration parameters to a blockchain account;
receiving one or more user information participating in the lottery;
transmitting a lottery processing request to the blockchain account, wherein the lottery processing request at least comprises each piece of user information and information for indicating the blockchain account to call a lottery intelligent contract corresponding to the lottery activity;
receiving a lottery result corresponding to the user information and a transaction hash value, wherein the transaction hash value is an identification of a block storing the lottery result;
processing the lottery result to generate a readable lottery result;
and transmitting the readable lottery result to a client corresponding to the user information.
According to a first aspect of the present disclosure, before sending a lottery processing request to the blockchain account, the lottery method further includes:
and deleting the user information which does not accord with the risk control standard in all the received user information.
According to a first aspect of the present disclosure, before sending a lottery processing request to the blockchain account, the lottery method further includes:
determining whether user information which does not meet the starting time and/or ending time related to the lottery activity exists in all the received user information;
deleting user information in case it is determined that the user information does not satisfy the start time and/or the end time related to the lottery activity exists;
determining whether user information which does not meet the lottery activity rules exists in all the received user information;
and deleting the user information in case that the user information which does not meet the lottery activity rule is determined to exist.
According to a first aspect of the present disclosure, the lottery method further includes:
sending a query request to the blockchain account, wherein the query request includes the transaction hash value, data associated with the lottery activity to be queried;
in the event that there is data associated with the lottery activity to query, a query result corresponding to the query request is received.
According to a first aspect of the present disclosure, after the lottery configuration parameters are sent to the blockchain account, the lottery method further includes:
receiving a contract address of a lottery intelligence contract corresponding to the lottery activity;
binding the contract address with the lottery activity.
According to a first aspect of the present disclosure, sending a lottery processing request to the blockchain account further includes:
and generating the information for instructing the blockchain account to call a lottery intelligent contract corresponding to the lottery based on the binding contract address of the lottery.
In view of the above, a second aspect of the present disclosure proposes a lottery method based on a blockchain, the lottery method including:
receiving lottery configuration parameters, wherein the lottery configuration parameters at least comprise a starting time, an ending time, a lottery activity rule, a lottery algorithm and a lottery activity prize related to a lottery activity;
creating a lottery intelligence contract corresponding to the lottery activity based on the lottery configuration parameters;
receiving a lottery processing request, wherein the lottery processing request at least comprises each piece of user information and information for indicating the blockchain account to call the lottery intelligent contract;
calling the lottery intelligent contract to complete lottery processing aiming at the user information so as to generate a lottery result;
storing the lottery result in a block of a blockchain;
and returning the lottery result and a transaction hash value, wherein the transaction hash value is the identification of the block storing the lottery result.
According to a second aspect of the present disclosure, the lottery method further includes:
receiving a query request, wherein the query request comprises a transmitted transaction hash value, data associated with the lottery activity to be queried;
querying the blockchain for the presence of data associated with the lottery activity to query based on the transaction hash value;
in the event that there is data associated with the lottery activity to query, a query result is returned.
According to a second aspect of the present disclosure, after creating a lottery smart contract corresponding to the lottery activity based on the lottery configuration parameters, the lottery method further includes: and returning a contract address of the lottery intelligent contract corresponding to the lottery activity.
In view of the foregoing, a third aspect of the present disclosure proposes a blockchain-based lottery device, the device including:
a processor;
a memory for storing instructions that, when executed, cause the processor to:
receiving lottery configuration parameters from a sponsor, wherein the lottery configuration parameters at least comprise a starting time, an ending time, a lottery activity rule, a lottery algorithm and a lottery activity prize related to a lottery activity;
transmitting the lottery configuration parameters to a blockchain account;
receiving one or more user information participating in the lottery;
transmitting a lottery processing request to the blockchain account, wherein the lottery processing request at least comprises each piece of user information and information for indicating the blockchain account to call a lottery intelligent contract corresponding to the lottery activity;
receiving a lottery result corresponding to the user information and a transaction hash value, wherein the transaction hash value is an identification of a block storing the lottery result;
processing the lottery result to generate a readable lottery result;
and transmitting the readable lottery result to a client corresponding to the user information.
According to a third aspect of the disclosure, prior to sending a lottery processing request to the blockchain account, the instructions, when executed, cause the processor to further: and deleting the user information which does not accord with the risk control standard in all the received user information.
According to a third aspect of the disclosure, prior to sending a lottery processing request to the blockchain account, the instructions, when executed, cause the processor to further:
determining whether user information which does not meet the starting time and/or ending time related to the lottery activity exists in all the received user information;
deleting user information in case it is determined that the user information does not satisfy the start time and/or the end time related to the lottery activity exists;
determining whether user information which does not meet the lottery activity rules exists in all the received user information;
and deleting the user information in case that the user information which does not meet the lottery activity rule is determined to exist.
According to a third aspect of the disclosure, the instructions, when executed, cause the processor to further:
sending a query request to the blockchain account, wherein the query request includes the transaction hash value, data associated with the lottery activity to be queried;
in the event that there is data associated with the lottery activity to query, a query result corresponding to the query request is received.
According to a third aspect of the present disclosure, after sending the lottery configuration parameters to a blockchain account, the instructions, when executed, cause the processor to further:
receiving a contract address of a lottery intelligence contract corresponding to the lottery activity;
binding the contract address with the lottery activity.
According to a third aspect of the present disclosure, sending a lottery processing request to the blockchain account further includes: and generating the information for instructing the blockchain account to call a lottery intelligent contract corresponding to the lottery based on the binding contract address of the lottery.
In view of the foregoing, a fourth aspect of the present disclosure proposes a blockchain-based lottery device, the device including:
a processor;
a memory for storing instructions that, when executed, cause the processor to:
receiving lottery configuration parameters, wherein the lottery configuration parameters at least comprise a starting time, an ending time, a lottery activity rule, a lottery algorithm and a lottery activity prize related to a lottery activity;
creating a lottery intelligence contract corresponding to the lottery activity based on the lottery configuration parameters;
receiving a lottery processing request, wherein the lottery processing request at least comprises each piece of user information and information for indicating the blockchain account to call the lottery intelligent contract;
calling the lottery intelligent contract to complete lottery processing aiming at the user information so as to generate a lottery result;
storing the lottery result in a block of a blockchain;
and returning the lottery result and a transaction hash value, wherein the transaction hash value is the identification of the block storing the lottery result.
According to a fourth aspect of the disclosure, the instructions, when executed, cause the processor to further:
receiving a query request, wherein the query request comprises a transmitted transaction hash value, data associated with the lottery activity to be queried;
querying the blockchain for the presence of data associated with the lottery activity to query based on the transaction hash value;
in the event that there is data associated with the lottery activity to query, a query result is returned.
According to a fourth aspect of the present disclosure, after creating a lottery intelligence contract corresponding to the lottery activity based on the lottery configuration parameters, the instructions, when executed, cause the processor to further perform the operations of: and returning a contract address of the lottery intelligent contract corresponding to the lottery activity.
The lottery method and the lottery equipment based on the blockchain can combine the blockchain technology with lottery configuration parameters, algorithms and the like, so that the problems that the existing sponsor initiates lottery activities in a non-public and opaque way and participation users cannot perceive fairness and authenticity of lottery activity contents are solved or partially solved by utilizing the characteristics of the blockchain technology such as non-tamper property, data traceability and the like.
Drawings
Features, advantages, and other aspects of embodiments of the disclosure will become more apparent upon reference to the following detailed description, taken in conjunction with the accompanying drawings, wherein several embodiments of the disclosure are shown by way of illustration, and not limitation, in which:
FIG. 1 is a first exemplary flow chart of a blockchain-based lottery method in accordance with the present disclosure;
FIG. 2 is a second exemplary flow chart of a blockchain-based lottery method in accordance with the present disclosure;
FIG. 3 is a schematic diagram of an embodiment of a blockchain-based lottery method in accordance with the present disclosure; and
fig. 4 is a schematic diagram of a blockchain-based lottery device 400 in accordance with the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure are described in detail below with reference to the drawings. The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of methods and systems according to various embodiments of the present disclosure. It should be noted that 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 logical functions specified in the various embodiments. 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 flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by special purpose hardware-based systems which perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.
The terms "comprising," including, "and similar terms used herein should be interpreted as open-ended terms, i.e., including, but not limited to," meaning that other elements may also be included. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment," and so forth.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate. For the purpose of illustration only, the connection between elements in the figures is meant to indicate that at least the elements at both ends of the connection are in communication with each other and is not intended to limit the inability to communicate between elements that are not connected.
Embodiments of the present disclosure focus mainly on the following technical problems: how to ensure fairness and authenticity of lottery activities initiated by a sponsor and improve trust of users participating in lottery to the sponsor.
In order to solve the problems, the block chain-based lottery method and the lottery equipment of the present disclosure combine the block chain technology and the lottery technology, and save lottery algorithms, winning data and the like in the block chain by utilizing the characteristics of non-tamper property, traceability and the like of the data of the block chain, so that anyone cannot tamper the lottery algorithms, the lottery data, and trace the winning data, thereby fundamentally realizing non-tamper and fairness of lottery activities and improving attraction of sponsor (e.g., merchant) activities to users.
Example 1
This embodiment will be described with reference to fig. 1 and 3. As shown in fig. 3, the lottery system 310 disclosed herein communicates with one or more blockchain accounts of a blockchain network 320. The lottery system 310 specifically includes: a wind control system 311 and a lottery platform 312; the lottery platform 312 specifically includes: carrier unit 3121, lottery unit 3122, and blockchain read-write unit 3123. In the present disclosure, the wind control system 311 is used to monitor and intercept information such as risk users, reptiles, and system security vulnerabilities that may pose a threat to the lottery system 310 and the blockchain network 320, thereby enabling a stable, safe, and efficient operation of the lottery system 310 and the blockchain network 320.
In this embodiment, the lottery system 310 is capable of implementing the blockchain-based lottery method shown in fig. 1, and specifically operates as follows:
step 110: lottery configuration parameters are received from the sponsor. In particular, lottery configuration parameters from the sponsor are received by the carrier unit 3121, wherein the lottery configuration parameters may include a start time, an end time, a lottery rule, a number of participating lottery thresholds, a lottery algorithm, a lottery prize, and the like, associated with a lottery.
In this embodiment, the lottery algorithm may be any algorithm, existing or developed in the future, and the following are merely illustrative of several algorithms, without limitation:
general algorithm: for example, for a apparel product lottery campaign, a list may be generated that is divided into sections, e.g., when the list length is 100, sections 1-20 belong to shoe products, sections 21-45 belong to mantles, cloak products, etc., and then a number is randomly taken from 100 to see which section is specifically located. The time complexity of the algorithm is as follows: preprocessing O (MN), random number generation O (1), and spatial complexity O (MN), wherein N represents the article type, and M is determined by the lowest probability.
Discrete algorithm: for example, also for apparel products lottery activities, if intervals 1-20 are for shoe products, intervals 21-45 are for mantles, cloak products, etc., then it may be abstracted to be 20 or less for shoe products, 20 or more and 45 or less for mantles, cloak products; then it may become a few points 20,45,55,60,100 and then a number R is randomly taken from 1 to 100 and compared in order among these points to find the subscript of the first number greater than R. Discrete algorithms reduce the footprint over general algorithms. The time complexity of the algorithm is as follows: preprocessing O (N), random number generation O (log N), spatial complexity O (N).
Alias sampling (Alias Method): the N possibilities are assembled into a square (whole) and divided into N columns, each column having a height of 1 and at most two possibilities, the possibilities being abstracted to a certain color, i.e. at most two colors per column, and there must be an nth possibility in the nth column, which is herein referred to as primary color. The time complexity of the algorithm is as follows: preprocessing O (Nlog N), random number generation O (1), and spatial complexity O (2N).
Step 120: and sending the lottery configuration parameters to a blockchain account. The method comprises the following steps:
the carrier unit 3121 transmits the lottery configuration parameters to the lottery unit 3122 for processing and transmits the valid lottery configuration parameters to the blockchain account of the blockchain network 320 in communication therewith via the blockchain read-write unit 3123.
The lottery method disclosed in this embodiment further includes, between steps 120 and 130:
first, a contract address of a lottery intelligence contract corresponding to the lottery activity is received. When the block chain account receives effective lottery configuration parameters, a corresponding lottery intelligent contract is generated by utilizing the lottery configuration parameters, the lottery intelligent contract is stored in a distributed data database which is stored in a chained mode, the related lottery configuration parameters and lottery intelligent contracts are submitted to the block chain by utilizing a consensus algorithm among distributed nodes, data are broadcast to each node in the block chain distributed network, once the data are written into the block chain nodes, the data cannot be tampered, and the data identification and the hash value of the successful block chain uplink are in one-to-one correspondence.
Meanwhile, the contract address of the lottery smart contract is transmitted to the lottery unit 3122 via the blockchain read-write unit 3123.
Second, the contract address is bound to the lottery activity. Specifically, after the lottery unit 3122 receives the contract address of the lottery smart contract, the contract address is bound with the lottery activity, whereby the corresponding lottery smart contract can be effectively invoked upon receiving the lottery processing request of the lottery activity.
Step 130: one or more user information is received to participate in the lottery. In this embodiment, one or more users send one or more user information to the lottery system 310 via clients.
In this embodiment, the client may be various clients capable of satisfying various usage habits of the user, for example, a supporting H5, a WEB page client, a desktop application, an APP mobile phone client, a WeChat applet, and the like.
The lottery method disclosed in this embodiment further includes, between steps 130 and 140:
first, the wind control system 311 deletes the user information that does not meet the risk control standard from all the received user information. Specifically, the wind control system 311 screens, isolates, and deletes disqualified users such as risk users, crawler users, and the like; meanwhile, the wind control system 311 can also guide the flow dispersion of lottery peaks, instantly block gaps of risk loopholes, ensure the stable operation of the lottery system 310, ensure that the sponsor lottery activities also need the wind control system 311 to operate effectively, analyze user data, risk areas, IP data and the like by utilizing a big data analysis technology, and form a risk user data pool so as to realize dynamic intelligent regulation and control.
Next, the wind control system 311 transmits all the user information after the filtering to the lottery unit 3122, and determines whether there is user information that does not satisfy the start time and/or end time associated with the lottery activity among all the user information received by the lottery unit 3122.
In the present embodiment, in the event that it is determined that there is user information that does not satisfy the start time and/or end time associated with the lottery activity, the lottery unit 3122 deletes the user information while returning information such as "participation failure" to the client that issued the user information.
Again, the lottery unit 3122 determines whether there are user information that do not satisfy the lottery activity rules among all the user information received.
In the present embodiment, in the event that it is determined that there is user information that does not satisfy the lottery activity rule, the lottery unit 3122 deletes the user information and returns information such as "participation failure" to the client that issued the user information.
Step 140: and sending a lottery processing request to the blockchain account. The specific operation of the method is as follows:
first, the lottery unit 3122 generates the information for instructing the blockchain account to call a lottery smart contract corresponding to the lottery activity based on the binding contract address with the lottery activity.
Second, the information for instructing the blockchain account to call the lottery intelligent contract corresponding to the lottery activity and each piece of user information are transmitted to the blockchain account as a lottery processing request.
In this embodiment, the lottery unit 3122 transmits a lottery processing request to a corresponding blockchain account via the blockchain read-write unit 3123. After the block chain account receives the lottery processing request, remote calling of a corresponding lottery intelligent contract is realized by means of RPC communication to complete lottery processing aiming at the user information, and a corresponding lottery result is generated, wherein the lottery result comprises: whether a prize is won, in the case of winning, several prizes are won, what the corresponding prize is, the prize redemption period, the manner of prize redemption, etc.
Step 150: and receiving lottery results corresponding to the user information and a transaction hash value, wherein the transaction hash value is an identification of a block storing the lottery results.
The lottery unit 3122 obtains the lottery result from the corresponding blockchain account via the blockchain read-write unit 3123 and the transaction hash value generated by the present lottery.
In this embodiment, the lottery result and the transaction hash value generated in the lottery are signed and transmitted to the lottery system 310 through the RSA double-key algorithm, so as to ensure the non-falsification of the RPC communication of the data, enhance the control of the data security, and realize the efficient and rapid transmission of the data by adopting data compression and serialization, solve the performance bottleneck of high concurrent access of the internet application by adopting single long connection, and ensure the high efficiency of service call. The lottery unit 3122 then places the lottery results in a message queue, which in turn persists the transaction hash values to the lottery system 310.
Step 160: and processing the lottery result to generate a readable lottery result. In this embodiment, the lottery unit 3122 performs readable processing on the lottery result, thereby generating a readable lottery result that can be recognized by the user.
Step 170: and transmitting the readable lottery result to a client corresponding to the user information. In particular, the lottery unit 3122 transmits readable lottery results to the corresponding clients.
In addition, the lottery method based on the blockchain disclosed in the embodiment further comprises the following steps:
first, a query request is sent to the blockchain account, wherein the query request includes the transaction hash value, data associated with the lottery activity to be queried.
In this embodiment, the user may send a query request through the client, and the lottery unit 3122 receiving the query request may send the query request to the corresponding blockchain account via the blockchain read-write unit 3123.
In addition, the sponsor may also send the query request to the corresponding blockchain account through the lottery unit 3122, blockchain read-write unit 3123.
The blockchain account queries in the blockchain based on the transaction hash value whether there is data associated with the lottery to query.
Second, in the case where there is data associated with the lottery activity to be queried, a query result corresponding to the query request is received.
In this embodiment, the lottery unit 3122 may obtain the query results corresponding to the query request from the blockchain account via the blockchain read-write unit 3123.
The lottery system 310 and the blockchain network 320 shown in fig. 3 can implement the blockchain-based lottery method disclosed in embodiment 1, so that the lottery activity initiated by the sponsor can be truly and effectively recorded in the distributed database of the blockchain without falsifying any data about the lottery activity, and finally, the trust of the user to the sponsor is improved, and the effectiveness and the user participation of the lottery activity are improved.
Example 2
This embodiment will be described with reference to fig. 2 and 3. As shown in fig. 3, the lottery system 310 disclosed herein communicates with one or more blockchain accounts of a blockchain network 320. In view of the detailed description of the structure of the lottery system 310 and the blockchain network 320 in embodiment 1, the detailed description thereof is omitted.
In this embodiment, the blockchain account in communication with the lottery system 310 enables the blockchain-based lottery method shown in fig. 2, which specifically operates as follows:
step 210: lottery configuration parameters are received.
In the present embodiment, the blockchain account receives lottery configuration parameters including at least a start time, an end time, a lottery rule, a lottery algorithm, and a lottery prize associated with a lottery, via the blockchain read/write unit 3123.
Step 220: and creating a lottery intelligent contract corresponding to the lottery activity based on the lottery configuration parameters. For this step, the blockchain account specifically operates as follows:
and writing lottery intelligent contract codes of the blockchain ERC20 standard specification by using a solubility language, wherein the lottery intelligent contract method is realized according to a lottery algorithm provided by a host, so that a core service of lottery activities is completely placed on lottery intelligent contracts of a blockchain network. The lottery intelligent contract disclosed by the embodiment enables lottery results to be generated on the block chain, so that human factors are eliminated, lottery business fairness and non-falsification are finally realized, and a user can rely on the lottery results more.
In this embodiment, the blockchain account also needs to do the following between steps 220, 230:
after the lottery intelligent contract creation is completed, the contract address of the lottery intelligent contract corresponding to the lottery activity is returned to the lottery unit 3122 via the blockchain read-write unit 3123 so that the lottery unit 3122 binds the contract address with the corresponding lottery activity.
Step 230: the blockchain account receives a lottery processing request. Wherein the lottery processing request includes at least each user information and information for instructing the blockchain account to invoke the lottery smart contract.
Step 240: and calling the lottery intelligent contract to complete lottery processing aiming at the user information so as to generate lottery results.
Step 250: storing the lottery result in a block of a blockchain.
Step 260: and returning the lottery result and a transaction hash value, wherein the transaction hash value is the identification of the block storing the lottery result.
In this embodiment, the disclosed lottery method further includes a query step, and the specific operations of the blockchain account are as follows:
first, a query request is received, wherein the query request includes a transmitted transaction hash value, data associated with the lottery activity to be queried.
Second, whether there is data associated with the lottery to be queried in the blockchain based on the transaction hash value is queried.
Again, in the event that there is data associated with the lottery activity to query, a query result is returned.
The lottery system 310 and the blockchain network 320 shown in fig. 3 can implement the blockchain-based lottery method disclosed in embodiment 2, and the blockchain account can write the lottery algorithm and the related lottery configuration parameters provided by the sponsor into corresponding lottery intelligent contracts to be stored in the blockchain, and when a request for lottery processing is obtained, the lottery processing is completed in the blockchain using the user information and the lottery intelligent contracts; finally, the real and effective lottery drawing is realized, and lottery drawing data cannot be tampered.
Fig. 4 illustrates that the blockchain-based lottery device 400 disclosed herein is capable of implementing the blockchain-based lottery method illustrated in fig. 1. The lottery device 400 includes a processor 410 and a memory 420. Wherein the memory 420 is configured to store instructions that cause the processor 410 to:
receiving lottery configuration parameters from a sponsor, wherein the lottery configuration parameters at least comprise a starting time, an ending time, a lottery activity rule, a lottery algorithm and a lottery activity prize related to a lottery activity;
transmitting the lottery configuration parameters to a blockchain account;
receiving one or more user information participating in the lottery;
transmitting a lottery processing request to the blockchain account, wherein the lottery processing request at least comprises each piece of user information and information for indicating the blockchain account to call a lottery intelligent contract corresponding to the lottery activity;
receiving a lottery result corresponding to the user information and a transaction hash value, wherein the transaction hash value is an identification of a block storing the lottery result;
processing the lottery result to generate a readable lottery result;
and transmitting the readable lottery result to a client corresponding to the user information.
In one embodiment according to the present disclosure, the instructions, when executed, cause the processor 410 to further perform the following operations prior to sending a lottery processing request to the blockchain account:
and deleting the user information which does not accord with the risk control standard in all the received user information.
In one embodiment according to the present disclosure, the instructions, when executed, cause the processor 410 to further perform the following operations prior to sending a lottery processing request to the blockchain account:
determining whether user information which does not meet the starting time and/or ending time related to the lottery activity exists in all the received user information;
deleting user information in case it is determined that the user information does not satisfy the start time and/or the end time related to the lottery activity exists;
determining whether user information which does not meet the lottery activity rules exists in all the received user information;
and deleting the user information in case that the user information which does not meet the lottery activity rule is determined to exist.
In one embodiment according to the present disclosure, the instructions, when executed, cause the processor 410 to further perform the following:
sending a query request to the blockchain account, wherein the query request includes the transaction hash value, data associated with the lottery activity to be queried;
in the event that there is data associated with the lottery activity to query, a query result corresponding to the query request is received.
In one embodiment according to the present disclosure, after the lottery configuration parameters are sent to the blockchain account, the instructions, when executed, cause the processor 410 to further perform the following:
receiving a contract address of a lottery intelligence contract corresponding to the lottery activity;
binding the contract address with the lottery activity.
In one embodiment according to the present disclosure, sending a lottery processing request to the blockchain account further includes:
and generating the information for instructing the blockchain account to call a lottery intelligent contract corresponding to the lottery based on the binding contract address of the lottery.
In addition, the blockchain-based lottery device 400 disclosed in fig. 4 is also capable of implementing the blockchain-based lottery method shown in fig. 2. The lottery device 400 includes a processor 410 and a memory 420. Wherein the memory 420 is configured to store instructions that cause the processor 410 to:
receiving lottery configuration parameters, wherein the lottery configuration parameters at least comprise a starting time, an ending time, a lottery activity rule, a lottery algorithm and a lottery activity prize related to a lottery activity;
creating a lottery intelligence contract corresponding to the lottery activity based on the lottery configuration parameters;
receiving a lottery processing request, wherein the lottery processing request at least comprises each piece of user information and information for indicating the blockchain account to call the lottery intelligent contract;
calling the lottery intelligent contract to complete lottery processing aiming at the user information so as to generate a lottery result;
storing the lottery result in a block of a blockchain;
and returning the lottery result and a transaction hash value, wherein the transaction hash value is the identification of the block storing the lottery result.
In one embodiment according to the present disclosure, the instructions, when executed, cause the processor 410 to further perform the following:
receiving a query request, wherein the query request comprises a transmitted transaction hash value, data associated with the lottery activity to be queried;
querying the blockchain for the presence of data associated with the lottery activity to query based on the transaction hash value;
in the event that there is data associated with the lottery activity to query, a query result is returned.
In one embodiment according to the present disclosure, after creating a lottery intelligence contract corresponding to the lottery activity based on the lottery configuration parameters, the instructions, when executed, cause the processor 410 to further perform the operations of:
and returning a contract address of the lottery intelligent contract corresponding to the lottery activity.
The lottery device based on the block chain disclosed by the invention can enable lottery results to be generated on the block chain, thereby eliminating human factors, finally realizing fair and untampereable lottery business, and enabling users to rely more on the lottery results.
Alternatively, the blockchain-based lottery method described above can be implemented by a computer program product. The computer program product may include a computer readable storage medium having computer readable program instructions embodied thereon for performing aspects of the present disclosure. The computer readable storage medium may be a tangible device that can hold and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: portable computer disks, hard disks, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static Random Access Memory (SRAM), portable compact disk read-only memory (CD-ROM), digital Versatile Disks (DVD), memory sticks, floppy disks, mechanical coding devices, punch cards or in-groove structures such as punch cards or grooves having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media, as used herein, are not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., optical pulses through fiber optic cables), or electrical signals transmitted through wires.
The foregoing is merely an alternative embodiment of the present disclosure, and is not intended to limit the embodiments of the present disclosure, and various modifications and variations may be made to the embodiments of the present disclosure by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present disclosure are intended to be included within the scope of the embodiments of the present disclosure.
Although embodiments of the present disclosure have been described with reference to a number of specific embodiments, it should be understood that embodiments of the present disclosure are not limited to the specific embodiments disclosed. The embodiments of the disclosure are intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

Claims (10)

1. A blockchain-based lottery method implemented via a lottery system in communication with one or more blockchain accounts of a blockchain network, the lottery method comprising:
receiving lottery configuration parameters from a sponsor, wherein the lottery configuration parameters at least comprise a starting time, an ending time, a lottery activity rule, a lottery algorithm and a lottery activity prize related to a lottery activity;
transmitting the lottery configuration parameters to a blockchain account;
receiving one or more user information participating in the lottery;
deleting the user information which does not accord with the risk control standard in all the received user information;
transmitting a lottery processing request to the blockchain account, wherein the lottery processing request at least comprises each piece of user information and information for indicating the blockchain account to call a lottery intelligent contract corresponding to the lottery activity;
receiving a lottery result corresponding to the user information and a transaction hash value, wherein the transaction hash value is an identification of a block storing the lottery result;
processing the lottery result to generate a readable lottery result; and
and transmitting the readable lottery result to a client corresponding to the user information.
2. The lottery method as in claim 1, wherein prior to sending a lottery process request to the blockchain account, the lottery method further comprises:
determining whether user information which does not meet the starting time and/or ending time related to the lottery activity exists in all the received user information;
deleting user information in case it is determined that the user information does not satisfy the start time and/or the end time related to the lottery activity exists;
determining whether user information which does not meet the lottery activity rules exists in all the received user information;
and deleting the user information in case that the user information which does not meet the lottery activity rule is determined to exist.
3. The lottery method as in claim 1, wherein the lottery method further comprises:
sending a query request to the blockchain account, wherein the query request includes the transaction hash value, data associated with the lottery activity to be queried;
in the event that there is data associated with the lottery activity to query, a query result corresponding to the query request is received.
4. The lottery method as in claim 1, wherein after the lottery configuration parameters are sent to the blockchain account, the lottery method further comprises:
receiving a contract address of a lottery intelligence contract corresponding to the lottery activity;
binding the contract address with the lottery activity.
5. The lottery method as in claim 4, wherein transmitting a lottery processing request to the blockchain account further comprises:
and generating the information for instructing the blockchain account to call a lottery intelligent contract corresponding to the lottery based on the binding contract address of the lottery.
6. A blockchain-based lottery device in communication with one or more blockchain accounts of a blockchain network, the device comprising:
a processor;
a memory for storing instructions that, when executed, cause the processor to:
receiving lottery configuration parameters from a sponsor, wherein the lottery configuration parameters at least comprise a starting time, an ending time, a lottery activity rule, a lottery algorithm and a lottery activity prize related to a lottery activity;
transmitting the lottery configuration parameters to a blockchain account;
receiving one or more user information participating in the lottery;
deleting the user information which does not accord with the risk control standard in all the received user information;
transmitting a lottery processing request to the blockchain account, wherein the lottery processing request at least comprises each piece of user information and information for indicating the blockchain account to call a lottery intelligent contract corresponding to the lottery activity;
receiving a lottery result corresponding to the user information and a transaction hash value, wherein the transaction hash value is an identification of a block storing the lottery result;
processing the lottery result to generate a readable lottery result; and
and transmitting the readable lottery result to a client corresponding to the user information.
7. The lottery device of claim 6, wherein the instructions, when executed, cause the processor to further perform the following operations prior to sending a lottery processing request to the blockchain account:
determining whether user information which does not meet the starting time and/or ending time related to the lottery activity exists in all the received user information;
deleting user information in case it is determined that the user information does not satisfy the start time and/or the end time related to the lottery activity exists;
determining whether user information which does not meet the lottery activity rules exists in all the received user information;
and deleting the user information in case that the user information which does not meet the lottery activity rule is determined to exist.
8. The lottery device of claim 6, wherein the instructions, when executed, cause the processor to further perform the operations of:
sending a query request to the blockchain account, wherein the query request includes the transaction hash value, data associated with the lottery activity to be queried;
in the event that there is data associated with the lottery activity to query, a query result corresponding to the query request is received.
9. The lottery device of claim 6, wherein after the lottery configuration parameters are sent to a blockchain account, the instructions, when executed, cause the processor to further perform the operations of:
receiving a contract address of a lottery intelligence contract corresponding to the lottery activity;
binding the contract address with the lottery activity.
10. The lottery device of claim 9, wherein sending a lottery processing request to the blockchain account further comprises:
and generating the information for instructing the blockchain account to call a lottery intelligent contract corresponding to the lottery based on the binding contract address of the lottery.
CN201910047049.5A 2019-01-18 2019-01-18 Lottery method and equipment based on block chain Active CN109767271B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910047049.5A CN109767271B (en) 2019-01-18 2019-01-18 Lottery method and equipment based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910047049.5A CN109767271B (en) 2019-01-18 2019-01-18 Lottery method and equipment based on block chain

Publications (2)

Publication Number Publication Date
CN109767271A CN109767271A (en) 2019-05-17
CN109767271B true CN109767271B (en) 2023-07-04

Family

ID=66454145

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910047049.5A Active CN109767271B (en) 2019-01-18 2019-01-18 Lottery method and equipment based on block chain

Country Status (1)

Country Link
CN (1) CN109767271B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110164021B (en) * 2019-06-13 2019-11-12 北京艾摩瑞策科技有限公司 A kind of random lottery drawing method and equipment of application block chain
CN110474918B (en) * 2019-08-22 2022-06-07 腾讯科技(深圳)有限公司 Resource allocation verification method and related device
CN111063092B (en) * 2019-10-15 2022-02-01 京东科技信息技术有限公司 Lottery drawing method and device based on block chain, electronic equipment and storage medium
CN110717791A (en) * 2019-10-15 2020-01-21 重庆远见信息产业集团有限公司 Invoice lottery drawing verification management system and method
CN112734455B (en) * 2019-10-29 2023-09-05 腾讯科技(深圳)有限公司 Method, device and equipment for generating prize exchanging result and readable storage medium
CN110990808B (en) * 2019-11-21 2022-04-01 杭州趣链科技有限公司 Notarization number shaking method based on block chain
CN110910559B (en) * 2019-11-25 2021-06-25 杭州趣链科技有限公司 Lottery drawing method based on block chain
CN116739660A (en) * 2019-11-28 2023-09-12 湖南天河国云科技有限公司 Lottery drawing method and system based on block chain
CN112053187A (en) * 2020-08-24 2020-12-08 深圳区块大陆科技有限公司 Block chain-based prize pool reward chain winding method
CN112926822A (en) * 2021-01-19 2021-06-08 北京电解智科技有限公司 Resource allocation method and device
CN112714135B (en) * 2021-01-20 2023-05-02 杭州安存网络科技有限公司 Activity management method based on block chain
CN112801713A (en) * 2021-02-18 2021-05-14 浪潮云信息技术股份公司 Anti-cheating lottery drawing method and device for online general lottery drawing activity
CN113129083A (en) * 2021-05-19 2021-07-16 中国银行股份有限公司 Automatic lottery drawing and distributing method and system based on 5G message of block chain
CN113569199B (en) * 2021-07-29 2024-02-02 杭州脸脸会网络技术有限公司 Lottery data processing method, system, device and readable storage medium
CN114971676A (en) * 2022-04-08 2022-08-30 百果园技术(新加坡)有限公司 Activity event management system, method and equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107103097A (en) * 2017-05-22 2017-08-29 中链科技有限公司 Drawing method and terminal device based on block chain technology
JP2017157910A (en) * 2016-02-29 2017-09-07 日本電気株式会社 Electronic lottery system and electronic lottery method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019036831A1 (en) * 2017-08-21 2019-02-28 达闼科技成都有限公司 Information selection method, apparatus, electronic device and computer-readable storage medium
CN107862782B (en) * 2017-10-27 2020-11-13 贝壳找房(北京)科技有限公司 Lottery drawing method and device based on Ether house block chain
CN108230047B (en) * 2018-02-05 2021-04-27 武汉斗鱼网络科技有限公司 Lottery drawing data processing method and device
CN108648323B (en) * 2018-05-10 2021-02-19 广州市申迪计算机系统有限公司 Target information selection method and device, computer equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017157910A (en) * 2016-02-29 2017-09-07 日本電気株式会社 Electronic lottery system and electronic lottery method
CN107103097A (en) * 2017-05-22 2017-08-29 中链科技有限公司 Drawing method and terminal device based on block chain technology

Also Published As

Publication number Publication date
CN109767271A (en) 2019-05-17

Similar Documents

Publication Publication Date Title
CN109767271B (en) Lottery method and equipment based on block chain
Sauter “LOIC Will Tear Us Apart” The Impact of Tool Design and Media Portrayals in the Success of Activist DDOS Attacks
Zanini et al. The networking of terror in the information age
CN100361452C (en) Method and device for server denial of service shield
US11785464B2 (en) Media agnostic content access management
CN106339613B (en) A kind of processing method, terminal and server using data
CN111538596B (en) Resource processing method, device, computer equipment and storage medium
CN106534276A (en) Data sharing method and device, mobile terminal
Musch et al. Web-based Cryptojacking in the Wild
CN108337210A (en) Equipment configuration method and device, system
Al-Shehari et al. Improving operating system fingerprinting using machine learning techniques
CN113961923A (en) Method, device, equipment and storage medium for acquiring threat information
CN107463841A (en) The system and method for detecting malicious computer
CN104935548A (en) Identity verification method, device and system based on intelligent tattooing equipment
Zhao Graph-based forensic investigation of bitcoin transactions
Li et al. Lost in the digital wild: Hiding information in digital activities
CN108306937B (en) Sending method and obtaining method of short message verification code, server and storage medium
CN104796451A (en) Data processing method and device for internet application
Kywe et al. Dissecting developer policy violating apps: characterization and detection
CN110049035A (en) A kind of network attack protection method, device, electronic equipment and medium
CN109347640B (en) Data processing method and terminal based on block chain dynamic intelligent contract
Kilkenny Russian Disinformation–The Technological Force Multiplier
Donato Computer criminal profiling applied to digital investigations
CN109617893A (en) A kind of means of defence, device and the storage medium of Botnet ddos attack
Duong A Proposal of a Cross-Browser User Tracking Method with Browser Fingerprint

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