CN109741052A - Red packet processing method, equipment and storage medium - Google Patents
Red packet processing method, equipment and storage medium Download PDFInfo
- Publication number
- CN109741052A CN109741052A CN201910077963.4A CN201910077963A CN109741052A CN 109741052 A CN109741052 A CN 109741052A CN 201910077963 A CN201910077963 A CN 201910077963A CN 109741052 A CN109741052 A CN 109741052A
- Authority
- CN
- China
- Prior art keywords
- red packet
- user
- transaction
- random number
- block chain
- 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.)
- Pending
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 38
- 238000000034 method Methods 0.000 claims abstract description 65
- 238000004590 computer program Methods 0.000 claims description 6
- 238000012545 processing Methods 0.000 abstract description 17
- 230000006854 communication Effects 0.000 description 10
- 238000004891 communication Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 230000000694 effects Effects 0.000 description 3
- 238000012795 verification Methods 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention provides a kind of red packet processing method, equipment and storage medium, this method comprises: receiving the solicited message that gives bonus that the first user terminal is sent;Several random numbers, and the Hash list of the cryptographic Hash including each random number are generated according to the corresponding red packet quantity of the solicited message that gives bonus;The transaction that gives bonus is generated according to Hash list;The transaction that will give bonus returns to the first user terminal for will give bonus transaction and red packet payment transaction is packaged as trading group and is sent to the node of the first block chain for executing so that red packet fund to be frozen in red packet contract, by Hash list records on the first block chain;The first random number in several random numbers is sent to the second user end for the second user for getting red packet, for generate red packet get trade and be sent to the node of the first block chain for execute with verify the first random number cryptographic Hash whether be recorded in Hash list: be then to provide red packet.The application realizes the red packet processing scheme that centralization is combined with decentralization.
Description
Technical field
This application involves Internet technical fields, and in particular to a kind of red packet processing method, equipment and storage medium.
Background technique
Current red packet processing scheme is all based on traditional giving bonus for centralized server processing user and requests or rob
Red packet request, and carry out the centralization scheme of the processing such as red packet distribution.It there is no mature decentralization or center on Vehicles Collected from Market
Change the red packet processing scheme combined with decentralization.
The red packet processing scheme of complete decentralization especially robs the such reception user of red packet mode and does not know mode
In red packet processing scheme, there remains be difficult to compromise between security and ease for use.For example, system can give bonus
User automatically generates verification mode, but by block chain disclose verify data can make as rob red packet user audient user it
Outer other block chain users equally have an opportunity to get red packet;And verify data is supplied to by way of being exchanged under line and is robbed
To the user of red packet, the ease for use of scheme can be made to decline to a great extent, it is difficult to user be attracted to use.
Summary of the invention
In view of drawbacks described above in the prior art or deficiency, be intended to provide a kind of centralization combined with decentralization it is red
Packet processing method, equipment and storage medium.
In a first aspect, the present invention provides a kind of red packet processing method suitable for server-side, this method comprises:
Receive the solicited message that gives bonus that the first user terminal of the first user is sent;
Several random numbers, and the Hash including each random number are generated according to the corresponding red packet quantity of the solicited message that gives bonus
The Hash list of value;
The transaction that gives bonus is generated according to Hash list;
The transaction that will give bonus returns to the first user terminal for that will give bonus transaction and red packet payment transaction is packaged as trading
Group and be sent to the node of the first block chain for execute be frozen in red packet contract with the red packet fund for paying the first user,
By Hash list records on the first block chain;
The first random number in several random numbers is sent to the second user end for the second user for getting red packet, for
Two user terminals are got according to the first generating random number red packet trades and is sent to the node of the first block chain for executing to pass through
Whether the cryptographic Hash that red packet contract verifies the first random number is recorded in Hash list: being that then red packet contract is according to red packet fund
Red packet is provided to the account of second user.
Second aspect, the present invention provide a kind of red packet processing method of node suitable for block chain, this method comprises:
It receives and executes trading group and be frozen in red packet contract with the red packet fund for paying the first user, and Hash is arranged
Table is recorded on the first block chain;Wherein, trading group is given bonus request from the first user terminal of the first user to server-side
Information, server-side generate several random numbers according to the corresponding red packet quantity of the solicited message that gives bonus, and including each random number
The Hash list of cryptographic Hash, after generating the transaction that gives bonus according to Hash list, after the transaction that will give bonus returns to the first user terminal,
To give bonus transaction and red packet payment transaction of first user terminal is packaged and generates;
It receives and executes red packet and get whether transaction is recorded in the cryptographic Hash for verifying the first random number by red packet contract
In Hash list: being that then red packet contract provides red packet to the account of second user according to red packet fund;Wherein, red packet gets friendship
Easily first in several random numbers that server-side is sent is being received at random by the second user end for getting the second user of red packet
According to the first generating random number after number.
The third aspect, the present invention provide a kind of red packet processing method suitable for user terminal, this method comprises:
Generation give bonus solicited message and to server-side send, so that server-side is corresponding red according to the solicited message that gives bonus
Packet quantity generates several random numbers, and the Hash list of the cryptographic Hash including each random number, is generated according to Hash list rubescent
Packet transaction;
Reception gives bonus transaction, will give bonus transaction and red packet payment transaction is packaged as trading group and is sent to the first block
The node of chain for execute be frozen in red packet contract with the red packet fund for paying the first user, by Hash list records
On one block chain.
Fourth aspect, the present invention provide another red packet processing method for being suitable for user terminal, this method comprises:
After getting red packet, receives server-side and send the first random number in several random numbers;Wherein, several random numbers by
Server-side receives the solicited message that gives bonus that the first user terminal of the first user is sent, corresponding red according to the solicited message that gives bonus
Packet quantity generates;
It is got according to the first generating random number red packet and trades and be sent to the node of the first block chain for executing to pass through
Whether the cryptographic Hash that red packet contract verifies the first random number is recorded in Hash list: being that then red packet contract provides red packet;Its
In, Hash list is generated by server-side according to the cryptographic Hash of several random numbers, and generates the transaction that gives bonus according to Hash list, will
The transaction that gives bonus returns to the first user terminal for that will give bonus transaction and red packet payment transaction is packaged as trading group and is sent to
The node of first block chain is frozen in red packet contract, by Hash list for executing with the red packet fund for paying the first user
It is recorded on the first block chain.
5th aspect, the present invention provide another red packet processing method for being suitable for server-side, this method comprises:
Receive the solicited message that gives bonus that the first user terminal of the first user is sent;
Several random numbers, and the Hash including each random number are generated according to the corresponding red packet quantity of the solicited message that gives bonus
The Hash list of value;
The transaction that gives bonus is generated according to Hash list;
The transaction that will give bonus returns to the first user terminal for that will give bonus transaction and red packet payment transaction is packaged as trading
Group and be sent to the node of the first block chain for execute be frozen in red packet contract with the red packet fund for paying the first user,
By Hash list records on the first block chain;
According to the first generating random number red packet in the account information for the second user for getting red packet and several random numbers
It gets and trades and be sent to the node of the first block chain for executing to verify the cryptographic Hash of the first random number by red packet contract
Whether it is recorded in Hash list: is, then red packet contract provides red packet to second user according to red packet fund.
6th aspect, the present invention provide the red packet processing method of another node for being suitable for block chain, this method comprises:
It receives and executes trading group and be frozen in red packet contract with the red packet fund for paying the first user, and Hash is arranged
Table is recorded on the first block chain;Wherein, trading group is given bonus request from the first user terminal of the first user to server-side
Information, server-side generate several random numbers according to the corresponding red packet quantity of the solicited message that gives bonus, and including each random number
The Hash list of cryptographic Hash, after generating the transaction that gives bonus according to Hash list, the transaction that will give bonus returns to the first user terminal, the
To give bonus transaction and red packet payment transaction of one user terminal is packaged and generates;
It receives and executes red packet and get whether transaction is recorded in the cryptographic Hash for verifying the first random number by red packet contract
In Hash list: being that then red packet contract provides red packet to second user according to red packet fund;Wherein, red packet gets transaction by taking
End be engaged according to the first generating random number in the account information and several random numbers of the second user for getting red packet.
7th aspect, the present invention also provides a kind of equipment, including one or more processors and memory, wherein memory
Comprising can by instruction that the one or more processors execute so that the one or more processors execute it is each according to the present invention
The red packet processing method that embodiment provides.
Eighth aspect, the present invention also provides a kind of storage medium for being stored with computer program, which makes to count
Calculation machine executes the red packet processing method that each embodiment provides according to the present invention.
Red packet processing method, equipment and the storage medium that many embodiments of the present invention provide are by being to give bonus by server-side
User generate several random numbers of corresponding red packet quantity, by include each random number cryptographic Hash Hash list records to block
On chain, get the red packet contract configured on block chain in transaction according to the Hash list recorded on block chain and red packet
Random number verification red packet gets permission, while having ensured red packet by distributing random number to the user for getting red packet from server-side
The accuracy and safety got realize the red packet processing scheme that centralization is combined with decentralization;
Red packet processing method, equipment and the storage medium that some embodiments of the invention provide are further by red packet contract
To after being verified of the first random number, the cryptographic Hash of the first random number is deleted in the Hash list that block chain is recorded, and is protected
Having hindered same random number can not be reused to get red packet.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 is the schematic diagram of a scenario of red packet processing scheme in one embodiment of the invention.
Fig. 2 is a kind of flow chart for red packet processing method suitable for server-side that one embodiment of the invention provides.
Fig. 3 is a kind of flow chart for red packet processing method suitable for block chain node that one embodiment of the invention provides.
Fig. 4 is a kind of flow chart of preferred embodiment of method shown in Fig. 3.
Fig. 5 is a kind of flow chart for red packet processing method suitable for user terminal that one embodiment of the invention provides.
Fig. 6 is the flow chart for the red packet processing method that the another kind that one embodiment of the invention provides is suitable for user terminal.
Fig. 7 be another embodiment of the present invention provides a kind of red packet processing method suitable for server-side flow chart.
Fig. 8 be another embodiment of the present invention provides a kind of red packet processing method suitable for block chain node process
Figure.
Fig. 9 is a kind of flow chart of preferred embodiment of method shown in Fig. 8.
Figure 10 is a kind of structural schematic diagram for equipment that one embodiment of the invention provides.
Specific embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to
Convenient for description, part relevant to invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is the schematic diagram of a scenario of red packet processing scheme in one embodiment of the invention.To be with scene shown in FIG. 1 below
Every solution provided by the invention is described in detail in example.
Fig. 2 is a kind of flow chart for red packet processing method suitable for server-side that one embodiment of the invention provides.Such as Fig. 2
Shown, in the present embodiment, the present invention provides a kind of red packet processing method, is suitable for server-side, this method comprises:
S101: the solicited message that gives bonus that the first user terminal of the first user is sent is received;
S103: several random numbers are generated according to the corresponding red packet quantity of the solicited message that gives bonus, and including each random number
Cryptographic Hash Hash list;
S105: the transaction that gives bonus is generated according to Hash list;
S107: the transaction that will give bonus returns to the first user terminal for that will give bonus transaction and red packet payment transaction is packaged as
Trading group and be sent to the node of the first block chain for execute with the red packet fund for paying the first user be frozen in red packet close
In about, by Hash list records on the first block chain;
S109: sending the first random number in several random numbers to the second user end for the second user for getting red packet,
It is got for second user end according to the first generating random number red packet and trades and be sent to the node of the first block chain for execution
Whether it is recorded in Hash list with the cryptographic Hash for verifying the first random number by red packet contract: is that then red packet contract is according to red
Packet fund provides red packet to the account of second user.
Specifically, in the present embodiment, server-side 10 while the still server-side of certain immediate communication tool, user is by being somebody's turn to do
The transmitting-receiving of immediate communication tool progress red packet;In more embodiments, server-side 10 is configurable to be exclusively used in red packet transmitting-receiving
Server-side can be achieved or, being configured to the server-side of different communication tools of other this fields for carrying out red packet transmitting-receiving simultaneously
Identical technical effect.
With in scene shown in Fig. 1, it is 100xxx coin that user's first has sent a total value in the group of the immediate communication tool
3 people's red packets, Yong Huyi, third, fourth got the red packet, Yong Huwu, oneself etc. do not get red packet for, to above-mentioned shown in Fig. 2
Method is described in detail:
User's first sends 3 people's red packets that a total value is 100xxx coin by the first user terminal 20, and the first user terminal 20 is raw
It transfers accounts the red packet payment transaction tx1 of 100xxx coin at solicited message m1 and one is given bonus to red packet contract, and m1 is sent to
Server-side 10.Wherein, the solicited message that gives bonus m1 includes: red packet total value: 100, currency type: and xxx coin, red packet number: 3, red packet point
With type: random, etc..
In step s101, server-side 10 receives the solicited message m1 that gives bonus that above-mentioned first user terminal 20 is sent.
In step s 103, server-side 10 generates 3 random numbers r1, r2, r3 according to the red packet number (3) of m1, and generates
The cryptographic Hash h1=hash (r1) of 3 random numbers, h2=hash (r2), h3=hash (r3), and including h1, h2, h3
Hash list L1.
In step s105, server-side 10 gives bonus the tx2 that trades according to Hash list L1 generation, tx2 in addition to include L1 it
It outside, further include the information such as red packet total value (100), currency type (xxx), red packet distribution type (random), red packet number (3);
In step s 107, tx2 is returned to the first user terminal 20 of user's first by server-side 10, and the first user terminal 20 receives
After tx2, tx1 and tx2 are packaged as trading group (tx1, tx2), which are sent to the node 501 of the first block chain;
Node 501 broadcasts trading group (tx1, tx2) to other each nodes 501 of the first block chain network 50, each node
Trading group (tx1, tx2) is packed into block and is executed respectively by 501, and the 100xxx coin that user's first is paid is frozen in red packet and is closed
In about, and Hash list L1 is recorded on the first block chain;
Concurrently with above-mentioned steps S103-S107, server-side of the server-side 10 as immediate communication tool, according to giving bonus
Solicited message m1 sends red packet information in group, and after the user terminal of each user receives red packet information in group, Yong Huyi, third, fourth are robbed
Arrived the red packet, Yong Huwu, oneself etc. do not get red packet;Wherein, it is further preferred that in order to ensure red packet can successfully be led
Take, the server-side of immediate communication tool can be executed by the data of synchronous first block chain, confirmation trading group (tx1, tx2) at
After function, then red packet information is sent in group;
In step S109, server-side 10 respectively to get red packet user's second, third, the second user end 30 of fourth sends
State random number r1, r2, r3;
After the second user end 30 of user's second receives random number r1, the account address including random number r1 and user's second is generated
addSecondRed packet get transaction tx3, and tx3 is sent to node 501;
Node 501 is received, is broadcasted and executes tx3 by red packet contract, and whether the cryptographic Hash hash (r1) for verifying r1 records
In Hash list L1: being then to be verified, a part of xxx coin in 100xxx coin that above-mentioned red packet contract freezes is transferred accounts
To addSecondTo complete to provide red packet to user's second;
Similarly, the second user end 30 of user third and user's fourth generates red respectively after receiving random number r2 and r3 respectively
Packet gets transaction tx4 and tx5 and is sent to node 501;Node 501 is sent out to user third and fourth respectively after being verified by red packet contract
Put red packet.
It is further preferred that avoid the random number r1 in tx3 from being stolen by other users of block chain and attempt to falsely claim as one's own red
Packet, after second user end 30 receives random number r1, can be generated random number R and the first cryptographic Hash H=hash (r1+R), regenerate
Account address add including random number R, the first cryptographic Hash H and user's secondSecondRed packet get transaction tx3 ', tx3 ' is sent to
Node 501;
Node 501 receives, broadcasts and simultaneously executes tx3 ' by red packet contract, and random number R and the first cryptographic Hash H are recorded to the
On one block chain, and in waiting proofing state;
Second user end 30 generates verifying transaction tx3 " further according to random number r1 and is sent to node 501;
Node 501 receive, broadcast simultaneously by red packet contract execute tx3 ", verify tx3 ' and tx3 " transmission address whether one
It causes, whether hash (r1+R) and H are identical, whether hash (r1) is recorded in Hash list L1: if being all verified, providing
Red packet.
Wherein, when there is multiple users to send respectively, the red packet that same random number r1 is generated gets transaction tx3 ' and verifying is traded
When tx3 " (the other users of block chain steal tx3's ")
Even if it is red that above-mentioned preferred embodiment can ensure that other users of block chain have stolen the r1 in tx3 " also and can not falsely claim as one's own
Packet.
In the above embodiments, when red packet distribution type is configured to random, red packet contract can be calculated scheduled first
The block Hash for some block that method determines or the transaction Hash of certain transaction are as random number, in conjunction with scheduled second algorithm,
Generate the red packet number distributed at random for user's second, third, fourth;Red packet contract can also utilize random provided by block catenary system
Number, such as the random digit generation method random number generated that applicant proposes in CN201811351787.0 patent, knot
It closes and states scheduled second algorithm, generate the red packet number distributed at random for user's second, third, fourth;
And when red packet distribution type is configured to respectively or when other nonrandom methods of salary distribution, red packet contract can direct basis
The specified method of salary distribution is allocated.
In the above-described embodiments, it is transferred accounts with red packet payment transaction to red packet contract, it includes second that red packet, which gets transaction,
For the address of user, red packet contract are transferred accounts to the address, illustrative elaboration has been carried out to the above method;
In another embodiment, red packet contract is configured with system of account, when keeping accounts to the account balance of each user, also
It can configure red packet payment transaction to freeze remaining sum of first user in red packet contract, red packet is got into transaction and is configured to wrap
Account identification information, the red packet contract for including second user are real by the account balance of the first user and second user in modification contract
Red packet now is provided, it can be achieved that identical technical effect to second user.For example, system of account is configured in red packet contract, record
There are the account balance 1000xxx coin of user's first, the account balance 0xxx coin of user's second, freezes to use by executing red packet payment transaction
The 100xxx coin (the movable xxx coin of account balance 900, the 100 xxx coin freezed of user's first at this time) of family first, it is red by executing
Packet get transaction tx3 modification red packet contract book keeping operation (the movable xxx coin of account balance 900 of user's first, 80 are freezed at this time
Xxx coin, the account balance 20xxx coin of user's second).
Above-described embodiment will be wrapped by being that the user's generation to give bonus corresponds to several random numbers of red packet quantity by server-side
It includes in the Hash list records to block chain of the cryptographic Hash of each random number, allows the red packet contract configured on block chain according to area
The random number verification red packet that the Hash list recorded on block chain and red packet are got in transaction gets permission, while by by server-side
Random number is distributed to the user for getting red packet accuracy and safety that red packet is got have been ensured, realize centralization and go
The red packet processing scheme that the heart combines.
In a preferred embodiment, it is above-mentioned be verified after further include: in the Hash list that the first block chain is recorded
The middle cryptographic Hash for deleting the first random number.Specifically, for example, the second user end 30 of user's second, which sends red packet, gets transaction tx3
Red packet is got, red packet contract is after being verified, to addSecondTransfer accounts while providing red packet also by L1 be updated to only include h2,
The L1 ' of h3, so that user's second can not repeat to get red packet by r1, if r1 is leaked to other users by user's second, other
User also can not get again red packet by r1.
In another preferred embodiment, red packet contract can not also modify Hash list, but got by record red
The list of random numbers of packet avoids repeating getting the effect of red packet to realize, in the preferred embodiment, red packet contract verifying with
Whether the cryptographic Hash of machine number is recorded in front of Hash list, first judges whether random number is recorded in the random number series for having got red packet
In table: being that then the red packet gets transaction and executes failure.
Above-described embodiment in block chain further by being recorded after red packet contract is to being verified of the first random number
Hash list in delete the cryptographic Hash of the first random number, ensured that same random number can not be reused to get red packet.
Fig. 3 is a kind of flow chart for red packet processing method suitable for block chain node that one embodiment of the invention provides.
Method shown in Fig. 3 can cooperate method shown in Fig. 2 to execute.
As shown in figure 3, in the present embodiment, the present invention also provides a kind of red packet processing sides suitable for block chain node
Method, comprising:
S201: receiving and executes trading group is frozen in red packet contract with the red packet fund for paying the first user, and will
Hash list records are on the first block chain;Wherein, trading group is sent rubescent from the first user terminal of the first user to server-side
Packet solicited message, server-side generate several random numbers according to the corresponding red packet quantity of the solicited message that gives bonus, and including respectively with
The Hash list of the cryptographic Hash of machine number, after generating the transaction that gives bonus according to Hash list, the transaction that will give bonus returns to the first use
Behind the end of family, will give bonus transaction and red packet payment transaction of the first user terminal is packaged and generates;
S203:, which receiving, and executes red packet gets whether transaction is remembered with the cryptographic Hash for verifying the first random number by red packet contract
Record is in Hash list:
Be to then follow the steps S205: red packet contract provides red packet to the account of second user according to red packet fund;Wherein,
Red packet gets the second user end for the second user by getting red packet of trading in receiving several random numbers that server-side is sent
The first random number after according to the first generating random number.
The red packet handling principle of method shown in Fig. 3 can refer to method shown in Fig. 2, and details are not described herein again.
Fig. 4 is a kind of flow chart of preferred embodiment of method shown in Fig. 3.Method shown in Fig. 4 can cooperate above-mentioned Fig. 2
The preferred embodiment of shown method executes.
As shown in figure 4, in a preferred embodiment, after being verified of step S203, the above method further include:
S207: the cryptographic Hash of the first random number is deleted in the Hash list that the first block chain is recorded.
The principle of method shown in Fig. 4 equally repeats no more.
Fig. 5 is a kind of flow chart for red packet processing method suitable for user terminal that one embodiment of the invention provides.Fig. 5 institute
Show that method can cooperate method shown in Fig. 2-4 to execute.
As shown in figure 5, in the present embodiment, the present invention also provides a kind of red packet processing sides suitable for the first user terminal 20
Method, comprising:
S301: generation give bonus solicited message and to server-side send, so that server-side is according to the solicited message pair that gives bonus
The red packet quantity answered generates several random numbers, and the Hash list of the cryptographic Hash including each random number, raw according to Hash list
At the transaction that gives bonus;
S303: reception gives bonus transaction, will give bonus transaction and red packet payment transaction is packaged as trading group and is sent to the
The node of one block chain is frozen in red packet contract with the red packet fund for paying the first user for executing, remembers Hash list
Record is on the first block chain.
The red packet handling principle of method shown in Fig. 5 equally can refer to method shown in Fig. 2, and details are not described herein again.
Fig. 6 is the flow chart for the red packet processing method that the another kind that one embodiment of the invention provides is suitable for user terminal.Fig. 6
Shown method can cooperate method shown in Fig. 2-5 to execute.
As shown in fig. 6, in the present embodiment, the red packet processing method the present invention also provides another kind suitable for user terminal,
Include:
S401: it after getting red packet, receives server-side and sends the first random number in several random numbers;Wherein, Ruo Gansui
The solicited message that gives bonus that machine number is sent by the first user terminal that server-side receives the first user, according to the solicited message pair that gives bonus
The red packet quantity answered generates;
S403: according to the first generating random number red packet get trade and be sent to the node of the first block chain for execute with
Whether it is recorded in Hash list by the cryptographic Hash that red packet contract verifies the first random number: is, then red packet contract provides red packet;
Wherein, Hash list is generated by server-side according to the cryptographic Hash of several random numbers, and generates the transaction that gives bonus according to Hash list,
The transaction that will give bonus returns to the first user terminal for that will give bonus transaction and red packet payment transaction is packaged as trading group and sends
Node to the first block chain is frozen in red packet contract with the red packet fund for paying the first user for executing, arranges Hash
Table is recorded on the first block chain.
Preferably, it is above-mentioned be verified after further include: delete first in the Hash list that the first block chain is recorded
The cryptographic Hash of random number.
Fig. 7 be another embodiment of the present invention provides a kind of red packet processing method suitable for server-side flow chart.
As shown in fig. 7, in another embodiment, the present invention also provides another red packet processing sides for being suitable for server-side
Method, comprising:
S501: the solicited message that gives bonus that the first user terminal of the first user is sent is received;
S503: several random numbers are generated according to the corresponding red packet quantity of the solicited message that gives bonus, and including each random number
Cryptographic Hash Hash list;
S505: the transaction that gives bonus is generated according to Hash list;
S507: the transaction that will give bonus returns to the first user terminal for that will give bonus transaction and red packet payment transaction is packaged as
Trading group and be sent to the node of the first block chain for execute with the red packet fund for paying the first user be frozen in red packet close
In about, by Hash list records on the first block chain;
S509: according to the first generating random number in the account information for the second user for getting red packet and several random numbers
Red packet, which is got, trades and is sent to the node of the first block chain for executing to verify the Kazakhstan of the first random number by red packet contract
Whether uncommon value is recorded in Hash list: being that then red packet contract provides red packet to second user according to red packet fund.
Preferably, it is above-mentioned be verified after further include: delete first in the Hash list that the first block chain is recorded
The cryptographic Hash of random number.
The difference of method shown in Fig. 7 and method shown in Fig. 2 is, in method shown in Fig. 7, by servicing in step S509
End 10, which for second user generates red packet, gets and trades and be sent to node, and in method shown in Fig. 2, by the in step S109
The second user end 30 of two users generates red packet and gets transaction and be sent to node.
Fig. 8 be another embodiment of the present invention provides a kind of red packet processing method suitable for block chain node process
Figure.Method shown in Fig. 8 can cooperate method shown in Fig. 7 to execute.
As shown in figure 8, in another embodiment, the present invention also provides another red packet processing for being suitable for block chain node
Method, comprising:
S601: receiving and executes trading group is frozen in red packet contract with the red packet fund for paying the first user, and will
Hash list records are on the first block chain;Wherein, trading group is sent rubescent from the first user terminal of the first user to server-side
Packet solicited message, server-side generate several random numbers according to the corresponding red packet quantity of the solicited message that gives bonus, and including respectively with
The Hash list of the cryptographic Hash of machine number, after generating the transaction that gives bonus according to Hash list, the transaction that will give bonus returns to the first use
Family end, will give bonus transaction and red packet payment transaction of the first user terminal are packaged and generate;
S603:, which receiving, and executes red packet gets whether transaction is remembered with the cryptographic Hash for verifying the first random number by red packet contract
Record is in Hash list:
Be to then follow the steps S605: red packet contract provides red packet to second user according to red packet fund;Wherein, red packet is led
Take transaction raw according to the first random number in the account information and several random numbers of the second user for getting red packet by server-side
At.
Method shown in Fig. 8 is same as the difference of method shown in Fig. 3 to be, in method shown in Fig. 8, red packet gets transaction
It is generated and sent by server-side 10 to node, and in method shown in Fig. 3, red packet is got transaction and generated by second user end 30
And it is sent to node.
Fig. 9 is a kind of flow chart of preferred embodiment of method shown in Fig. 8.As shown in figure 9, in a preferred embodiment
In, after being verified of step S603 further include:
S607: the cryptographic Hash of the first random number is deleted in the Hash list that the first block chain is recorded.
In addition, the method that first user terminal 10 executes can refer to method shown in fig. 5 in Fig. 7-scheme shown in Fig. 9,
Details are not described herein again.
Figure 10 is a kind of structural schematic diagram for equipment that one embodiment of the invention provides.
As shown in Figure 10, as on the other hand, present invention also provides a kind of equipment 1000, including one or more centers
Processing unit (CPU) 1001, can be according to the program being stored in read-only memory (ROM) 1002 or from storage section
1008 programs being loaded into random access storage device (RAM) 1003 and execute various movements appropriate and processing.In RAM1003
In, it is also stored with equipment 1000 and operates required various programs and data.CPU1001, ROM1002 and RAM1003 pass through total
Line 1004 is connected with each other.Input/output (I/O) interface 1005 is also connected to bus 1004.
I/O interface 1005 is connected to lower component: the importation 1006 including keyboard, mouse etc.;Including such as cathode
The output par, c 1007 of ray tube (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section including hard disk etc.
1008;And the communications portion 1009 of the network interface card including LAN card, modem etc..Communications portion 1009 passes through
Communication process is executed by the network of such as internet.Driver 1010 is also connected to I/O interface 1005 as needed.It is detachable to be situated between
Matter 1011, such as disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 1010, so as to
In being mounted into storage section 1008 as needed from the computer program read thereon.
Particularly, in accordance with an embodiment of the present disclosure, the red packet processing method of any of the above-described embodiment description can be implemented
For computer software programs.For example, embodiment of the disclosure includes a kind of computer program product comprising be tangibly embodied in
Computer program on machine readable media, the computer program include the program code for executing red packet processing method.
In such embodiments, which can be downloaded and installed from network by communications portion 1009, and/or from
Detachable media 1011 is mounted.
As another aspect, present invention also provides a kind of computer readable storage medium, the computer-readable storage mediums
Matter can be computer readable storage medium included in the device of above-described embodiment;It is also possible to individualism, it is unassembled
Enter the computer readable storage medium in equipment.Computer-readable recording medium storage has one or more than one program, should
Program is used to execute the red packet processing method for being described in the application by one or more than one processor.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use
The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box
The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually
It can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depending on related function.Also it wants
It is noted that the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, Ke Yitong
The dedicated hardware based system of functions or operations as defined in executing is crossed to realize, or by specialized hardware and can be calculated
The combination of machine instruction is realized.
Being described in the embodiment of the present application involved unit or module can be realized by way of software, can also be with
It is realized by way of hardware.Described unit or module also can be set in the processor, for example, each unit can
To be the software program being arranged in computer or intelligent movable equipment, it is also possible to the hardware device being separately configured.Wherein, this
The title of a little units or module does not constitute the restriction to the unit or module itself under certain conditions.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art
Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic
Scheme, while should also cover in the case where not departing from the application design, appointed by above-mentioned technical characteristic or its equivalent feature
Other technical solutions of meaning combination and formation.Such as features described above and (but being not limited to) disclosed herein have similar functions
Technical characteristic replaced mutually and the technical solution that is formed.
Claims (13)
1. a kind of red packet processing method, which is characterized in that the method is suitable for server-side, which comprises
Receive the solicited message that gives bonus that the first user terminal of the first user is sent;
Several random numbers are generated according to the corresponding red packet quantity of the solicited message that gives bonus, and including each random number
The Hash list of cryptographic Hash;
The transaction that gives bonus is generated according to the Hash list;
The transaction that gives bonus is returned into first user terminal for giving bonus transaction and red packet payment transaction is beaten for described
Packet is trading group and is sent to the node of the first block chain and is freezed for executing with the red packet fund for paying first user
In red packet contract, by the Hash list records on the first block chain;
The first random number in several random numbers is sent to the second user end for the second user for getting red packet, for institute
State second user end according to the first generating random number red packet get trade and be sent to the node of the first block chain with
For executing so that whether the cryptographic Hash for verifying first random number by the red packet contract is recorded in the Hash list:
It is that then the red packet contract provides red packet to the account of the second user according to the red packet fund.
2. the method according to claim 1, wherein it is described be verified after further include: in firstth area
The cryptographic Hash of first random number is deleted in the Hash list that block chain is recorded.
3. a kind of red packet processing method, which is characterized in that the method is suitable for the node of block chain, which comprises
It receives and executes trading group and be frozen in red packet contract with the red packet fund for paying the first user, and Hash list is remembered
Record is on the first block chain;Wherein, the trading group is given bonus from the first user terminal of the first user to server-side
Solicited message, the server-side corresponding red packet quantity of solicited message that gives bonus according to generate several random numbers, and packet
The Hash list for including the cryptographic Hash of each random number will be described rubescent after generating the transaction that gives bonus according to the Hash list
After packet transaction returns to first user terminal, transaction and the red packet payment transaction of giving bonus is packaged by first user terminal
It generates;
It receives and executes red packet and get whether transaction is remembered with the cryptographic Hash for verifying first random number by the red packet contract
Record is in the Hash list: being, then account granting of the red packet contract according to the red packet fund to the second user
Red packet;Wherein, the red packet gets transaction and is receiving the server-side by the second user end for getting the second user of red packet
According to first generating random number after the first random number in several random numbers sent.
4. according to the method described in claim 3, it is characterized in that, it is described be verified after further include: in firstth area
The cryptographic Hash of first random number is deleted in the Hash list that block chain is recorded.
5. a kind of red packet processing method, which is characterized in that the method is suitable for user terminal, which comprises
Generation give bonus solicited message and to server-side send, for the server-side give bonus according to solicited message correspondence
Red packet quantity generate several random numbers, and the Hash list of the cryptographic Hash including each random number, according to the Hash
List generates the transaction that gives bonus;
Give bonus transaction described in reception, gives bonus transaction and red packet payment transaction is packaged as trading group and is sent to first for described
The node of block chain is frozen in red packet contract, by the Hash for executing with the red packet fund for paying first user
List records are on the first block chain.
6. a kind of red packet processing method, which is characterized in that the method is suitable for user terminal, which comprises
After getting red packet, receives server-side and send the first random number in several random numbers;Wherein, several random numbers by
Server-side receives the solicited message that gives bonus that the first user terminal of the first user is sent, corresponding according to the solicited message that gives bonus
Red packet quantity generate;
It is got according to the first generating random number red packet and trades and be sent to the node of the first block chain for executing to pass through
Whether the cryptographic Hash that red packet contract verifies first random number is recorded in Hash list: being, then the red packet contract granting
Red packet;Wherein, the Hash list is generated by the server-side according to the cryptographic Hash of several random numbers, and according to the Kazakhstan
Uncommon list generation gives bonus transaction, and the transaction that gives bonus is returned to first user terminal for by the transaction that gives bonus
Trading group is packaged as with red packet payment transaction and is sent to the node of the first block chain for executing with by the first user branch
Pay red packet fund be frozen in red packet contract, by the Hash list records on the first block chain.
7. according to the method described in claim 6, it is characterized in that, it is described be verified after further include: in firstth area
The cryptographic Hash of first random number is deleted in the Hash list that block chain is recorded.
8. a kind of red packet processing method, which is characterized in that the method is suitable for server-side, which comprises
Receive the solicited message that gives bonus that the first user terminal of the first user is sent;
Several random numbers are generated according to the corresponding red packet quantity of the solicited message that gives bonus, and including each random number
The Hash list of cryptographic Hash;
The transaction that gives bonus is generated according to the Hash list;
The transaction that gives bonus is returned into first user terminal for giving bonus transaction and red packet payment transaction is beaten for described
Packet is trading group and is sent to the node of the first block chain and is freezed for executing with the red packet fund for paying first user
In red packet contract, by the Hash list records on the first block chain;
According to the first generating random number red packet in the account information for the second user for getting red packet and several random numbers
Get trade and be sent to the node of the first block chain for execute with by the red packet contract verifying described first with
Whether the cryptographic Hash of machine number is recorded in the Hash list: being that then the red packet contract is according to the red packet fund to described
Second user provides red packet.
9. according to the method described in claim 8, it is characterized in that, it is described be verified after further include: in firstth area
The cryptographic Hash of first random number is deleted in the Hash list that block chain is recorded.
10. a kind of red packet processing method, which is characterized in that the method is suitable for the node of block chain, which comprises
It receives and executes trading group and be frozen in red packet contract with the red packet fund for paying the first user, and Hash list is remembered
Record is on the first block chain;Wherein, the trading group is given bonus from the first user terminal of the first user to server-side
Solicited message, the server-side corresponding red packet quantity of solicited message that gives bonus according to generate several random numbers, and packet
The Hash list for including the cryptographic Hash of each random number will be described rubescent after generating the transaction that gives bonus according to the Hash list
After packet transaction returns to first user terminal, transaction and the red packet payment transaction of giving bonus is packaged by first user terminal
It generates;
It receives and executes red packet and get whether transaction is remembered with the cryptographic Hash for verifying first random number by the red packet contract
Record is in the Hash list: being that then the red packet contract provides red packet to second user according to the red packet fund;Wherein,
The red packet get transaction by the server-side according to the account information of the second user for getting red packet and it is described it is several at random
The first generating random number in number.
11. according to the method described in claim 10, it is characterized in that, it is described be verified after further include: described first
The cryptographic Hash of first random number is deleted in the Hash list that block chain is recorded.
12. a kind of equipment, which is characterized in that the equipment includes:
One or more processors;
Memory, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors
Execute such as method of any of claims 1-11.
13. a kind of storage medium for being stored with computer program, which is characterized in that realize when the program is executed by processor as weighed
Benefit requires method described in any one of 1-11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910077963.4A CN109741052A (en) | 2019-01-28 | 2019-01-28 | Red packet processing method, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910077963.4A CN109741052A (en) | 2019-01-28 | 2019-01-28 | Red packet processing method, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109741052A true CN109741052A (en) | 2019-05-10 |
Family
ID=66366371
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910077963.4A Pending CN109741052A (en) | 2019-01-28 | 2019-01-28 | Red packet processing method, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109741052A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110363512A (en) * | 2019-07-12 | 2019-10-22 | 上海唯链信息科技有限公司 | The processing of block chain red packet creates, gets method and apparatus, medium and computer program |
CN110648447A (en) * | 2019-08-08 | 2020-01-03 | 杭州复杂美科技有限公司 | Game random number generation method, application, device, equipment and storage medium |
CN112052970A (en) * | 2020-09-02 | 2020-12-08 | 杭州复杂美科技有限公司 | Queuing number-taking method, device and storage medium |
CN112134912A (en) * | 2019-06-25 | 2020-12-25 | 湖南云帆流量科技有限公司 | Block chain based distribution method and device |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104917807A (en) * | 2015-03-19 | 2015-09-16 | 腾讯科技(深圳)有限公司 | Resource transfer method, apparatus and system |
US20170221052A1 (en) * | 2015-07-14 | 2017-08-03 | Fmr Llc | Computationally Efficient Transfer Processing and Auditing Apparatuses, Methods and Systems |
CN107220820A (en) * | 2017-05-16 | 2017-09-29 | 腾讯科技(深圳)有限公司 | Resource transfers method, device and storage medium |
CN108062671A (en) * | 2017-11-03 | 2018-05-22 | 深圳市轱辘车联数据技术有限公司 | Data trade method, block chain node server and data submit terminal |
CN108171606A (en) * | 2018-01-11 | 2018-06-15 | 北京欧链科技有限公司 | The distribution method and device of block chain assets |
CN108229958A (en) * | 2017-12-27 | 2018-06-29 | 浙商银行股份有限公司 | A kind of accounts receivable system and method based on block chain technology |
CN108615145A (en) * | 2018-04-09 | 2018-10-02 | 交通银行股份有限公司 | A kind of method and system of account parallel access money |
CN108921525A (en) * | 2018-06-29 | 2018-11-30 | 北京金山安全软件有限公司 | Processing method and device for block chain red packet, electronic equipment and medium |
CN108960826A (en) * | 2018-06-29 | 2018-12-07 | 杭州复杂美科技有限公司 | A kind of trading group, trading group building method, storage medium, equipment and system |
CN108985760A (en) * | 2018-06-15 | 2018-12-11 | 杭州复杂美科技有限公司 | Method of payment and system, equipment and storage medium |
KR101936759B1 (en) * | 2018-07-27 | 2019-01-11 | 주식회사 미탭스플러스 | Apparatus and Method for KYC using KYC blockchain |
-
2019
- 2019-01-28 CN CN201910077963.4A patent/CN109741052A/en active Pending
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104917807A (en) * | 2015-03-19 | 2015-09-16 | 腾讯科技(深圳)有限公司 | Resource transfer method, apparatus and system |
US20170221052A1 (en) * | 2015-07-14 | 2017-08-03 | Fmr Llc | Computationally Efficient Transfer Processing and Auditing Apparatuses, Methods and Systems |
CN107220820A (en) * | 2017-05-16 | 2017-09-29 | 腾讯科技(深圳)有限公司 | Resource transfers method, device and storage medium |
CN108062671A (en) * | 2017-11-03 | 2018-05-22 | 深圳市轱辘车联数据技术有限公司 | Data trade method, block chain node server and data submit terminal |
CN108229958A (en) * | 2017-12-27 | 2018-06-29 | 浙商银行股份有限公司 | A kind of accounts receivable system and method based on block chain technology |
CN108171606A (en) * | 2018-01-11 | 2018-06-15 | 北京欧链科技有限公司 | The distribution method and device of block chain assets |
CN108615145A (en) * | 2018-04-09 | 2018-10-02 | 交通银行股份有限公司 | A kind of method and system of account parallel access money |
CN108985760A (en) * | 2018-06-15 | 2018-12-11 | 杭州复杂美科技有限公司 | Method of payment and system, equipment and storage medium |
CN108921525A (en) * | 2018-06-29 | 2018-11-30 | 北京金山安全软件有限公司 | Processing method and device for block chain red packet, electronic equipment and medium |
CN108960826A (en) * | 2018-06-29 | 2018-12-07 | 杭州复杂美科技有限公司 | A kind of trading group, trading group building method, storage medium, equipment and system |
KR101936759B1 (en) * | 2018-07-27 | 2019-01-11 | 주식회사 미탭스플러스 | Apparatus and Method for KYC using KYC blockchain |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112134912A (en) * | 2019-06-25 | 2020-12-25 | 湖南云帆流量科技有限公司 | Block chain based distribution method and device |
CN112134912B (en) * | 2019-06-25 | 2023-07-21 | 湖南云帆流量科技有限公司 | Block chain-based distribution method and device |
CN110363512A (en) * | 2019-07-12 | 2019-10-22 | 上海唯链信息科技有限公司 | The processing of block chain red packet creates, gets method and apparatus, medium and computer program |
CN110363512B (en) * | 2019-07-12 | 2022-12-20 | 上海唯链信息科技有限公司 | Processing, creating and getting method and device for block chain red packet, medium and computer program |
CN110648447A (en) * | 2019-08-08 | 2020-01-03 | 杭州复杂美科技有限公司 | Game random number generation method, application, device, equipment and storage medium |
CN110648447B (en) * | 2019-08-08 | 2021-08-06 | 杭州复杂美科技有限公司 | Game random number generation method, application, device, equipment and storage medium |
CN112052970A (en) * | 2020-09-02 | 2020-12-08 | 杭州复杂美科技有限公司 | Queuing number-taking method, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109727009A (en) | Red packet processing method, equipment and storage medium | |
CN109741052A (en) | Red packet processing method, equipment and storage medium | |
CN109816362A (en) | Red packet processing method, equipment and storage medium | |
CN110175913B (en) | Data processing system, method, computing device and storage medium based on block chain | |
CN109784888A (en) | Red packet processing method, equipment and storage medium | |
CN110363665B (en) | Credit right data processing method, device, equipment and medium | |
CN107332826B (en) | The communication means and device of block chain agent node | |
CN109325762A (en) | Across the chain method of commerce of parallel chain, equipment and storage medium | |
CN106982205A (en) | Digital asset treating method and apparatus based on block chain | |
CN108665372A (en) | Information processing, inquiry, storage method based on block chain and device | |
CN109345387A (en) | Across the chain method of commerce of block chain, across chain communication device and storage medium | |
CN109146448A (en) | Across chain assets transfer method, equipment and storage medium | |
CN109087080A (en) | Across chain method of commerce, equipment and storage medium | |
CN109314643A (en) | Transacter, transaction methods and the program for it | |
CN108959621A (en) | A kind of implementation method, device, equipment and the storage medium of block chain network | |
CN108197974A (en) | Integration processing method and device based on block chain technology | |
KR102090025B1 (en) | Blockchain network system for Internetworking in Heterogeneous Platforms and Method for Generating Block Chain | |
CN109643415A (en) | Trade management technology | |
CN108764872A (en) | A kind of authority to pay method and system, equipment and storage medium | |
CN108053244A (en) | Integration processing method and device based on block chain technology | |
CN110428332A (en) | A kind of across the chain method of commerce of parallel chain, equipment and storage medium | |
KR102140140B1 (en) | The vehicle charging and communication system | |
CN108230011A (en) | Integration processing method and device based on block chain technology | |
CN109272388A (en) | A kind of purchase method based on block chain, equipment and storage medium | |
CN109934566A (en) | Red packet processing method, equipment and storage medium |
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 | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20190510 |
|
WD01 | Invention patent application deemed withdrawn after publication |