CN106649637B - Method and system for processing red packet - Google Patents

Method and system for processing red packet Download PDF

Info

Publication number
CN106649637B
CN106649637B CN201611122300.2A CN201611122300A CN106649637B CN 106649637 B CN106649637 B CN 106649637B CN 201611122300 A CN201611122300 A CN 201611122300A CN 106649637 B CN106649637 B CN 106649637B
Authority
CN
China
Prior art keywords
red packet
red
database
packet
currency value
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
CN201611122300.2A
Other languages
Chinese (zh)
Other versions
CN106649637A (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.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201611122300.2A priority Critical patent/CN106649637B/en
Publication of CN106649637A publication Critical patent/CN106649637A/en
Application granted granted Critical
Publication of CN106649637B publication Critical patent/CN106649637B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Abstract

The invention discloses a method and a system for processing a red packet.A red packet server judges whether the red packet robbing request carries an identity Identification (ID) corresponding to the red packet or not after the client sends the red packet robbing request; if yes, randomly determining a first query database from the multiple query databases, and searching whether the currency value corresponding to the red packet exists or not by using the first query database based on the identity ID corresponding to the red packet; and if the currency value corresponding to the red packet exists, the red packet server acquires the currency value corresponding to the red packet from the main database and returns the currency value to the client. The invention divides the database into a master database and a slave database set, adopts the inquiry database in the slave database set to check whether the red packet has residual red packets, and then determines whether to finish corresponding operations in the master database, thereby reducing the pressure of the master database and directly improving the response efficiency of the red packet robbery.

Description

Method and system for processing red packet
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and a system for processing red packets.
Background
With the continuous development of science and technology, communication technology has also gained rapid development, and the variety of electronic products is also more and more, and people also enjoy various facilities that scientific and technological development brought.
Applications similar to red envelope grabbing are seen everywhere in internet applications, and particularly in the barrage type video live broadcast industry, various red envelope applications of virtual currency triggered by giving high-value gifts are very common.
In a red packet robbing application scene, a red packet robbing behavior of a user has certain unpredictability, so that a red packet robbing peak period can be formed in the scene of facing high concurrent red packet robbing requests, and the red packet robbing requests are difficult to respond quickly in the red packet robbing peak period.
Disclosure of Invention
The invention provides a method and a system for processing a red packet, which aim to solve the technical problem that a red packet robbing request is difficult to respond quickly.
In order to solve the technical problems, the invention provides a method and a system for processing a red envelope, wherein the method is applied to a system for processing the red envelope, the system comprises a client, a red envelope server and a database group, the database group comprises a master database and a slave database set, and the slave database set comprises a plurality of query databases for querying the currency value corresponding to the red envelope; the method comprises the following steps:
the red packet robbing server receives a red packet robbing request sent by the client and judges whether the red packet robbing request carries an identity Identification (ID) corresponding to the red packet or not;
if the red packet robbing request carries the identity ID corresponding to the red packet, the red packet server randomly determines a first query database from the plurality of query databases, and searches whether the currency value corresponding to the red packet exists or not by using the first query database based on the identity ID corresponding to the red packet;
and if the currency value corresponding to the red packet exists, the red packet server acquires the currency value corresponding to the red packet from the main database and returns the currency value to the client.
Preferably, after the determining whether the red packet robbing request carries the identity ID corresponding to the red packet, the method further includes:
and if the red packet robbing request does not carry the identity ID corresponding to the red packet, generating the red packet with the currency value of 0 and returning the red packet to the client.
Preferably, after the searching, by using the first query database, whether there is a monetary value corresponding to the red packet based on the ID corresponding to the red packet, the method further includes:
and if the currency value corresponding to the red packet does not exist, generating the red packet with the currency value of 0 and returning the red packet to the client.
Preferably, before the client sends the red packet preemption request, the method further includes:
the client sends a request data packet for creating a red packet;
the red packet server receives the request data packet;
the red packet server judges whether the request data packet contains a total currency value Vt and a red packet distribution number Cn, wherein Cn is a positive integer and is more than or equal to 1;
if the request data packet contains the total currency value Vt and the red packet distribution number Cn, the red packet server distributes the total currency value Vt into Cn red packets at random, and each red packet corresponds to the respective currency value;
and the red packet server creates respective identification ID for the Cn red packets.
Preferably, a storage database for permanently storing said Cn portion red packets and the respective monetary value is also included from the database collection.
Preferably, after the red packet server creates the respective ID IDs for the Cn red packets, the method further includes:
the red packet server determines a database group comprising the master database and the slave database set from a plurality of database groups, wherein each database group comprises the master database and the slave database set from the plurality of database groups;
and the red packet server stores the Cn share red packets, the respective identification IDs of the Cn share red packets and the respective currency values of the Cn share red packets by using the main database.
Preferably, after the red packet server stores the Cn number of red packets, the ID of each of the Cn number of red packets, and the monetary value of each of the Cn number of red packets by using the master database, the method further includes:
and the red packet server synchronously stores the Cn share red packet, the respective identification ID of the Cn share red packet and the respective currency value of the Cn share red packet into the slave database set.
Preferably, the red packet server randomly allocates the total monetary value Vt into Cn red packets, including:
the total currency value Vt is distributed by taking Cn red packets as a standard; or
The total monetary value Vt is assigned based on the monetary value, and the number of shares Cn of the red packet is random.
In another aspect of the invention, a system for processing red packets is disclosed, the system comprising: the system comprises a client, a red envelope server and a database group, wherein the database group comprises a master database and a slave database set, and the slave database set comprises a plurality of query databases for querying the currency value corresponding to the red envelope;
the client is used for sending a red packet robbing request;
the red packet server is used for receiving a red packet robbing request sent by the client and then judging whether the red packet robbing request carries an identity Identification (ID) corresponding to the red packet or not;
the red packet server is used for randomly determining a first query database from the plurality of query databases if the red packet robbing request carries the identity ID corresponding to the red packet, and searching whether the money value corresponding to the red packet exists or not by using the first query database based on the identity ID corresponding to the red packet;
and the red packet server is used for acquiring the currency value corresponding to the red packet from the main database and returning the currency value to the client if the currency value corresponding to the red packet exists.
Preferably, the client is configured to send a request packet for creating a red packet;
the red packet server is used for receiving the request data packet; judging whether the request data packet contains a total currency value Vt and a red packet distribution number Cn, wherein Cn is a positive integer and is more than or equal to 1; if the request data packet contains the total currency value Vt and the red packet distribution number Cn, randomly distributing the total currency value Vt into Cn red packets, wherein each red packet corresponds to the respective currency value; and creating respective identification IDs for the Cn red packets.
Through one or more technical schemes of the invention, the invention has the following beneficial effects or advantages:
the invention discloses a method and a system for processing a red packet.A red packet server judges whether the red packet robbing request carries an identity Identification (ID) corresponding to the red packet or not after the client sends the red packet robbing request; if yes, randomly determining a first query database from the plurality of query databases, and searching whether the money value corresponding to the red packet exists or not by using the first query database based on the identity ID corresponding to the red packet; and if the currency value corresponding to the red packet exists, the red packet server acquires the currency value corresponding to the red packet from the main database and returns the currency value to the client. The invention divides the database into a master database and a slave database set, adopts the inquiry database in the slave database set to check whether the red packet has residual red packets, and then determines whether to finish corresponding operations in the master database, thereby reducing the pressure of the master database and directly improving the response efficiency of the red packet robbery.
Drawings
FIG. 1 is an overall frame diagram in an embodiment of the present invention;
FIG. 2 is a composition diagram of a Redis Group according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating the method of creating a red envelope according to an embodiment of the present invention;
fig. 4 is a flow chart of a red packet in an embodiment of the present invention.
Detailed Description
In order to make the present application more clearly understood by those skilled in the art to which the present application pertains, the following detailed description of the present application is made with reference to the accompanying drawings by way of specific embodiments.
Fig. 1 is an overall framework diagram of the present invention:
1) the Client side sends a treasure box robbing request. For example, the present invention has client 1, client 2, client 3 … …, client n. Each client may send a treasure box robbing request.
2) The gateway server Cluster is responsible for network access of the client, and data exchange of the public network and the internal network is isolated and protected.
3) RedpacketServer Cluster: and the cluster of the red packet server is responsible for processing network requests for creating the red packet and robbing the red packet.
4) And the Redis Group is responsible for the result processing of the red packet data persistence and the red packet robbery, and fragments are carried out according to the red packet identification ID, and each red packet has a unique identification ID. For example, the present invention has m database sets, which are: database group 1, database group 2, database group 3 … … database group m.
FIG. 2 is a composition diagram of Redis Group:
in fig. 2, a Redis Group is composed of a Master Redis Master database and a slave database set, and the slave database set includes a storage database for storing red envelope data and a plurality of query databases for querying a currency value corresponding to the red envelope.
Specifically, a plurality of (greater than or equal to 2) Slave databases of Slave Redis are contained in the Slave database set. Wherein, one of the plurality of slave databases can be randomly determined as a storage database, and the rest slave databases are used as query databases. For example, in fig. 2, the first slave database of the x slave databases is used as the storage database, and the remaining 2 nd slave databases to the xth slave database are used as the query databases.
5) Master Redis: and the main database is responsible for creating the red packet and writing the red packet data. A synchronization mechanism exists in the master database and the slave database set, and the data of the Mater Redis changes and can be automatically synchronized to all the SlaveRedis slave databases.
6) Slave Redis 1: the first slave database in the slave databases, which is also used as a storage database, is only responsible for the persistence of the red packet data. The meaning of persistence is: the first slave database will permanently store all red packs created, their respective IDs, their respective monetary values, etc. Such data is not lost due to a restart, a failure, etc. of the server.
7) Slave Redis 2 to Slave Redis x: the 2 nd slave database to the x th slave database in the databases are used as query databases. The slave databases are only responsible for Query operations for processing red packet data, and the Query Per Second (QPS) of Redis currently comparing mainstream servers can be as high as 5-8W.
To sum up, the invention discloses a system for processing red packet, comprising: the system comprises a client cluster, a red packet server cluster, a gateway service cluster and a plurality of database groups.
And the information of the client and the red packet server is forwarded through the gateway service cluster during information interaction.
Each database group comprises a master database and a slave database set, and the slave database set comprises a plurality of query databases for querying the currency value corresponding to the red envelope.
The specific implementation process of creating the red envelope is described first, but of course, the present invention is described by taking one client as an example, and the processes of creating the red envelope by other clients are similar, so that the detailed description is omitted.
The client is used for sending a request data packet for creating a red packet;
the red packet server is used for receiving the request data packet; judging whether the request data packet contains a total currency value Vt and a red packet distribution number Cn, wherein Cn is a positive integer and is more than or equal to 1; if the request data packet contains the total currency value Vt and the red packet distribution number Cn, randomly distributing the total currency value Vt into Cn red packets, wherein each red packet corresponds to the respective currency value; and creating respective identification IDs for the Cn red packets.
In addition, the red packet server is further configured to determine, after creating respective ID IDs for the Cn red packets, a database group including the master database and the slave database set from among a plurality of database groups, where each database group in the plurality of database groups includes a master database and a slave database set; and storing the respective identification IDs of the Cn parts of red packets and the respective currency values of the Cn parts of red packets by using the main database.
As an optional embodiment, the red packet server is further configured to store the Cn-share red packet, the respective ID of the Cn-share red packet, and the respective monetary value of the Cn-share red packet synchronously in the slave database collection.
The implementation of the red packet is described below.
The client is used for sending a red packet robbing request;
the red packet server is used for receiving a red packet robbing request sent by the client and then judging whether the red packet robbing request carries an identity Identification (ID) corresponding to the red packet or not; if the red packet robbing request carries the identity ID corresponding to the red packet, randomly determining a first query database from the plurality of query databases, and searching whether the currency value corresponding to the red packet exists or not by using the first query database based on the identity ID corresponding to the red packet; and if the currency value corresponding to the red packet exists, the currency value corresponding to the red packet is obtained from the main database and returned to the client.
Based on the above framework, fig. 3 is a flow chart of creating a red packet according to the present invention:
in step 31, the client sends a request packet for creating a red packet.
Specifically, on the client, a corresponding Application program Application is installed. The application program can execute the red packet creating operation and can also execute the red packet robbing operation.
When creating the red packet, the application program on the client sends a request data packet CreateData for creating the red packet to the red packet Server redpack Server. The request packet CreateData includes at least a total monetary value Vt of a red packet and a number of allocated copies Cn of the red packet.
The red packet Server is a constituent unit of the red packet Server Cluster, each red packet Server has a unique 16-bit service ID, and the red packet Server is abbreviated as RSID in the invention.
The result Rm obtained by the Random function Random (time (null)) and from which red packet Server the request packet CreateData is sent to is determined modulo the total number Rn of red packet servers. For example: rm% Rn is 0, the drop point of the request data packet CreateData is on the 1 st red packet server RedpacketServer, and so on.
Step 32, the red packet server receives the request data packet.
In step 33, the red packet server determines whether the request packet includes the total value Vt of the money and the number of copies Cn to be allocated to the red packet.
Wherein Cn is a positive integer and Cn is more than or equal to 1.
Specifically, the red packet Server redpack Server checks whether the necessary parameters are carried in the request packet CreateData. If the request data packet CreateData carries the total value Vt of the money, the allocated number Cn of red packets, if none exists, or only one parameter exists, the failure of creating the red packet is directly returned.
If the total monetary value Vt, the allocated number of red packets Cn are present, step 34 is entered.
And step 34, if the request data packet contains the total currency value Vt and the red packet distribution number of shares Cn, the red packet server randomly distributes the total currency value Vt into Cn red packets, and each red packet corresponds to the respective currency value.
Specifically, the red packet Server redpack Server randomly allocates (the allocation rule can be customized according to different business requirements) the total currency value Vt into Cn red packets, and each red packet contains the currency value Vn.
In the implementation of allocation, there are two allocation methods:
the first distribution mode: and C, distributing the total currency value Vt by taking Cn red packets as a standard, wherein the currency value in each red packet is random. For example, if Cn is 5 and the total monetary value is 100, then the 100 blocks are divided into 5 red packets, and the monetary value of each red packet may be random, for example, 50 blocks, 20 blocks, 10 blocks. Of course, it may be equally distributed, with 20 blocks per red packet.
In the second distribution mode, the total currency value Vt is distributed by taking the currency value as a standard, and the number Cn of the red packets is random. For example, if the total monetary value is 100 pieces and the monetary value of each red pack is 1 piece or 2 pieces, then 50 red packs to 100 red packs can be allocated according to the monetary value.
And step 35, the red packet server creates respective identification IDs for the Cn red packets.
Specifically, each red packet has a unique 64-bit identification ID, abbreviated RPID. The high 32 bits of the RPID are the current timestamp, the middle 16 bits are the RSID, and the low 16 bits are the self-growing ID of 0-65536 cycles.
And after the red packet server creates respective identification IDs for the Cn red packets, the red packet server determines a database group comprising the master database and the slave database set from a plurality of database groups. Wherein, in a plurality of database groups, each database group comprises a master database and a slave database set.
Therefore, after step 35, step 36 is executed: and the red packet server stores the Cn share red packets, the respective identification IDs of the Cn share red packets and the respective currency values of the Cn share red packets by using the main database. For example, when a Redis Group database is selected, a BKDR hash is performed on the RPID to obtain a result Hn, and the Hn takes a model of the total amount Gn of the Redis groups to determine which Redis Group the landing point is on. Hn% Gn is 0, the red packet data falls to the 1 st Redis Group, and so on.
In Redis Group, Master Redis stores Cn shares of red packets in a List data structure, and Key value is RPID.
After the flow is completed, the Redis master and slave synchronization mechanism can automatically complete the data synchronization work. Namely, step 37: and the red packet server synchronously stores the Cn share red packet, the respective identification ID of the Cn share red packet and the respective currency value of the Cn share red packet into the slave database set.
And returning a result that the red packet is successfully created.
FIG. 4 is a flow chart of a method of processing red packets according to the present invention.
And step 41, the client sends a red packet robbing request.
Specifically, the Client sends a request for requesting GrabData for a red packet. The red packet sent by the user A at the client carries the corresponding ID. Therefore, when the user B snatches the red packet, the client generates a red packet snatching request based on the operation of the user B, the request carries the identity ID corresponding to the red packet, and then the red packet snatching request is sent to the gateway service GateServer. The gateway service Gate Server is a constituent unit of the Gate Server Cluster.
And the Gate Server forwards the red packet robbing request GrabData to a red packet Server RedpacketServer of the intranet.
And 42, the red packet server receives the red packet robbing request sent by the client, and then judges whether the red packet robbing request carries the identity ID corresponding to the red packet.
And if the red packet robbing request does not carry the identity ID corresponding to the red packet, generating the red packet with the currency value of 0 and returning the red packet to the client.
Specifically, the Redpacket Server checks whether the data of the Red packet robbing request GrabData is valid (for example, whether the data contains a legal RPID), if the data is legal, the next flow is entered, otherwise, the result of the Red packet not robbed reward is returned (a piece of Red packet data with Vn of 0 is forged and returned).
And 43, if the red packet robbing request carries the identity identifier ID corresponding to the red packet, the red packet server randomly determines a first query database from the plurality of query databases, and searches whether the money value corresponding to the red packet exists or not by using the first query database based on the identity identifier ID corresponding to the red packet.
The first query database is an arbitrarily determined query database in the plurality of query databases, and is used for searching whether the currency value corresponding to the red packet exists or not based on the identity ID corresponding to the red packet. And if the currency value corresponding to the red packet does not exist, generating the red packet with the currency value of 0 and returning the red packet to the client, wherein the red packet is not robbed and rewarded.
Specifically, whether a red packet exists in a red packet with an RPID of RPID is inquired in a certain Slave Redis, if yes, the next flow is entered, and if not, a result that the red packet is not robbed is returned (a red packet data with a Vn of 0 is forged and returned).
And 44, if the currency value corresponding to the red packet exists, the red packet server acquires the currency value corresponding to the red packet from the main database and returns the currency value to the client.
Specifically, a List with Key being RPID is found in Master Redis, and pop out a piece of red packet data, if the List is empty or nonexistent, a piece of red packet data with Vn being 0 is forged and returned. The result of successful red packet robbing can be returned.
And throwing the data with Vn larger than 0 in the red packet and the UID into MQ (MessageQueue message queue) to asynchronously complete the currency transaction.
The key point of the scheme is the Redis Group.
The Redis Group can be horizontally expanded according to RPID fragmentation to balance the request pressure brought by different red packets. The Slave Redis in each Redis Group can also be expanded transversely to balance the request pressure brought by the same red packet. And particularly, which Redis Group each Red packet List falls on is determined by BKDR hash according to the RPID, so that the discrete type is ensured.
The Red packet data is persistent by the Slave Redis 1 in the Redis Group, so that the QPS (quick Path _ Settlement _.
Whether the red packet has residual red packets is checked through the Slave Redis, and whether the corresponding operation needs to be finished in the Master Redis is determined. Although the number of clients robbing a red packet may be in the millions, the fraction of red packets that can actually be allocated is well below this order of magnitude (thousands or tens of thousands). GrabData of more than 90% of the unnecessary response of the Mater Redis can be filtered by inquiring the residual quantity of the red packets from the Slave Redis. The pressure of Mater Redis is reduced, and the response efficiency of the treasure box is directly improved.
Through one or more embodiments of the present invention, the present invention has the following advantageous effects or advantages:
the invention discloses a method and a system for processing a red packet.A red packet server judges whether the red packet robbing request carries an identity Identification (ID) corresponding to the red packet or not after the client sends the red packet robbing request; if yes, randomly determining a first query database from the plurality of query databases, and searching whether the money value corresponding to the red packet exists or not by using the first query database based on the identity ID corresponding to the red packet; and if the currency value corresponding to the red packet exists, the red packet server acquires the currency value corresponding to the red packet from the main database and returns the currency value to the client. The invention divides the database into a master database and a slave database set, adopts the inquiry database in the slave database set to check whether the red packet has residual red packets, and then determines whether to finish corresponding operations in the master database, thereby reducing the pressure of the master database and directly improving the response efficiency of the red packet robbery.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (9)

1. The method is applied to a system for processing the red envelope, and the system comprises a client, a red envelope server and a database group, wherein the database group comprises a master database and a slave database set, the master database is responsible for writing data for creating the red envelope and robbing the red envelope, and the slave database set comprises a plurality of query databases for querying the currency value corresponding to the red envelope; the method comprises the following steps:
the red packet robbing server receives a red packet robbing request sent by the client and judges whether the red packet robbing request carries an identity Identification (ID) corresponding to the red packet or not;
if the red packet robbing request carries the identity ID corresponding to the red packet, the red packet server randomly determines a first query database from the plurality of query databases, and searches whether the currency value corresponding to the red packet exists or not by using the first query database based on the identity ID corresponding to the red packet;
if the currency value corresponding to the red packet exists, the red packet server acquires the currency value corresponding to the red packet from the main database and returns the currency value to the client;
and if the currency value corresponding to the red packet does not exist, the first query database generates a red packet with the currency value of 0 and returns the red packet to the client.
2. The method of claim 1, wherein after determining whether the red packet robbing request carries an identity ID corresponding to the red packet, the method further comprises:
and if the red packet robbing request does not carry the identity ID corresponding to the red packet, generating the red packet with the currency value of 0 and returning the red packet to the client.
3. The method of claim 1, wherein prior to the client sending a red packet preemption request, the method further comprises:
the client sends a request data packet for creating a red packet;
the red packet server receives the request data packet;
the red packet server judges whether the request data packet contains a total currency value Vt and a red packet distribution number Cn, wherein Cn is a positive integer and is more than or equal to 1;
if the request data packet contains the total currency value Vt and the red packet distribution number Cn, the red packet server distributes the total currency value Vt into Cn red packets at random, and each red packet corresponds to the respective currency value;
and the red packet server creates respective identification ID for the Cn red packets.
4. A method according to claim 3, further including a storage database for permanently storing said Cn portion red packets and respective monetary value from the database collection.
5. The method of claim 3, wherein after said red packet server creates respective identification IDs for said Cn share red packets, said method further comprises:
the red packet server determines a database group comprising the master database and the slave database set from a plurality of database groups, wherein each database group comprises the master database and the slave database set from the plurality of database groups;
and the red packet server stores the Cn share red packets, the respective identification IDs of the Cn share red packets and the respective currency values of the Cn share red packets by using the main database.
6. The method of claim 5, wherein after said red packet server utilizing said master database to store said Cn red packets, respective IDs of said Cn red packets, and respective monetary values of said Cn red packets, said method further comprises:
and the red packet server synchronously stores the Cn share red packet, the respective identification ID of the Cn share red packet and the respective currency value of the Cn share red packet into the slave database set.
7. The method of claim 5, wherein the red packet server randomly apportioning the total monetary value, Vt, into Cn red packets, comprises:
the total currency value Vt is distributed by taking Cn red packets as a standard; or
The total monetary value Vt is assigned based on the monetary value, and the number of shares Cn of the red packet is random.
8. A system for processing red envelope, said system comprising: the system comprises a client, a red envelope server and a database group, wherein the database group comprises a master database and a slave database set, the master database is responsible for the write-in operation of creating red envelope data and robbing red envelope data, and the slave database set comprises a plurality of query databases used for querying the currency value corresponding to the red envelope;
the client is used for sending a red packet robbing request;
the red packet server is used for receiving a red packet robbing request sent by the client and then judging whether the red packet robbing request carries an identity Identification (ID) corresponding to the red packet or not;
the red packet server is used for randomly determining a first query database from the plurality of query databases if the red packet robbing request carries the identity ID corresponding to the red packet, and searching whether the money value corresponding to the red packet exists or not by using the first query database based on the identity ID corresponding to the red packet;
the red packet server is used for obtaining the currency value corresponding to the red packet from the main database and returning the currency value to the client side if the currency value corresponding to the red packet exists
And the red packet server is used for enabling the first query database to be used for generating a red packet with the currency value of 0 and returning the red packet to the client if the currency value corresponding to the red packet does not exist.
9. The system of claim 8,
the client is used for sending a request data packet for creating a red packet;
the red packet server is used for receiving the request data packet; judging whether the request data packet contains a total currency value Vt and a red packet distribution number Cn, wherein Cn is a positive integer and is more than or equal to 1; if the request data packet contains the total currency value Vt and the red packet distribution number Cn, randomly distributing the total currency value Vt into Cn red packets, wherein each red packet corresponds to the respective currency value; and creating respective identification IDs for the Cn red packets.
CN201611122300.2A 2016-12-08 2016-12-08 Method and system for processing red packet Active CN106649637B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611122300.2A CN106649637B (en) 2016-12-08 2016-12-08 Method and system for processing red packet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611122300.2A CN106649637B (en) 2016-12-08 2016-12-08 Method and system for processing red packet

Publications (2)

Publication Number Publication Date
CN106649637A CN106649637A (en) 2017-05-10
CN106649637B true CN106649637B (en) 2020-04-10

Family

ID=58819180

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611122300.2A Active CN106649637B (en) 2016-12-08 2016-12-08 Method and system for processing red packet

Country Status (1)

Country Link
CN (1) CN106649637B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107436818A (en) * 2017-07-31 2017-12-05 北京微影时代科技有限公司 A kind of red packet acquisition of information and the method and apparatus sent
CN107608790A (en) * 2017-09-06 2018-01-19 阿里巴巴集团控股有限公司 Resource allocation methods and device and electronic equipment
CN109670798A (en) * 2017-10-13 2019-04-23 中兴通讯股份有限公司 A kind of red packet system and its implementation
CN108270773A (en) * 2017-12-22 2018-07-10 杭州顺网珑腾信息技术有限公司 A kind of processing system for being used to implement electronics red packet granting
CN108810643A (en) * 2018-06-01 2018-11-13 沈文策 A kind of red packet distribution method, device and live broadcast system
CN109255596B (en) * 2018-08-14 2021-07-23 创新先进技术有限公司 Method and device for getting password red envelope
CN109688477A (en) * 2018-11-06 2019-04-26 北京达佳互联信息技术有限公司 Data creation method, device, electronic equipment and readable storage medium storing program for executing
CN112308621A (en) * 2020-11-04 2021-02-02 深圳市欢太科技有限公司 Data processing method and device, computer storage medium and electronic equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101090401B (en) * 2007-05-25 2011-05-18 金蝶软件(中国)有限公司 Data buffer store method and system at duster environment
FR2965952B1 (en) * 2010-10-06 2013-06-21 Commissariat Energie Atomique METHOD FOR UPDATING A REVERSE INDEX AND SERVER IMPLEMENTING SAID METHOD
CN102779304A (en) * 2011-05-10 2012-11-14 中国联合网络通信集团有限公司 Processing method for gifted amount in electronic wallet and server
US20160350782A1 (en) * 2015-05-16 2016-12-01 John Wang Method and system for red envelope reward advertisement for social networking systems
CN105447103B (en) * 2015-11-12 2019-05-21 北京奇虎科技有限公司 Red packet orients distribution method, apparatus and system
CN106095877A (en) * 2016-06-07 2016-11-09 中国建设银行股份有限公司 A kind of red packet data processing method and device

Also Published As

Publication number Publication date
CN106649637A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
CN106649637B (en) Method and system for processing red packet
CN106991607B (en) Disordered transaction control method based on block chain account model
CN109949111B (en) Electronic bill identification distribution method, electronic bill generation method, device and system
US11461310B2 (en) Distributed ledger technology
US20210256016A1 (en) Blockchain system and method
CN109146484A (en) Common recognition verification method, digging mine machine and block catenary system based on block chain
CN108769146B (en) Data transmission method and device based on block chain and block chain system
CN113094396B (en) Data processing method, device, equipment and medium based on node memory
CN109614209B (en) Task processing method, application server and system
CN106909451A (en) A kind of distributed task dispatching system and method
CN109087111A (en) Common recognition verification method, digging mine machine and block catenary system based on block chain
CN111556120A (en) Data processing method and device based on block chain, storage medium and equipment
CN112800466B (en) Data processing method and device based on privacy protection and server
CN109087105A (en) For digging the Hash Search method of mine, digging mine machine and block catenary system
CN101442558A (en) Method and system for providing index service for P2SP network
CN112714196B (en) Node management method, device, equipment and storage medium based on block chain network
CN110727727A (en) Statistical method and device for database
CN109150936A (en) The sharing method and device of session object Session in a kind of distributed type assemblies
CN114490826B (en) Request response method, data storage method, device, server and storage medium
CN109242491A (en) It digs mine identity identifying method, dig mine machine and block catenary system
CN113765675B (en) Transaction data processing method, device, equipment and medium
US20190372825A1 (en) Communication apparatus, communication method, and recording medium
CN109302300A (en) Data distributing method and device, data processing method and server
EP3520370B1 (en) A decentralised database
CN103905512A (en) Data processing method and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant