CN112308621A - Data processing method and device, computer storage medium and electronic equipment - Google Patents

Data processing method and device, computer storage medium and electronic equipment Download PDF

Info

Publication number
CN112308621A
CN112308621A CN202011217661.1A CN202011217661A CN112308621A CN 112308621 A CN112308621 A CN 112308621A CN 202011217661 A CN202011217661 A CN 202011217661A CN 112308621 A CN112308621 A CN 112308621A
Authority
CN
China
Prior art keywords
red packet
stack
red
data
target
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
Application number
CN202011217661.1A
Other languages
Chinese (zh)
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.)
Shenzhen Hefei Technology Co ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai 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 Guangdong Oppo Mobile Telecommunications Corp Ltd, Shenzhen Huantai Technology Co Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202011217661.1A priority Critical patent/CN112308621A/en
Publication of CN112308621A publication Critical patent/CN112308621A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0207Discounts or incentives, e.g. coupons or rebates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash

Abstract

The application discloses a data processing method and device, a computer storage medium and electronic equipment. The data processing method comprises the following steps: receiving a red envelope getting instruction; responding to the red packet getting instruction, and acquiring target data from the head of the stack; and generating a target object according to the target data, and sending the target object to a target user terminal. By adopting the method, the distribution efficiency of the electronic red packet can be improved.

Description

Data processing method and device, computer storage medium and electronic equipment
Technical Field
The present application relates to the field of electronic payment, and in particular, to a data processing method and apparatus, a computer storage medium, and an electronic device.
Background
When a user completes a specific business behavior through an internet Application (APP), a business party needs to give a certain cash reward to the user, so as to attract more users to complete the specific business behavior. The red envelope is used as a cash reward mode and becomes a fund type reward general strategy in the internet industry at present.
The red envelope issuing is a fund transfer behavior integrating different behaviors such as fund change, quantity change, anti-weight control and the like, and is a form of fund transfer of an internet enterprise organization to an internet individual. The method needs to undergo processes of issuer fund deduction, number deduction, retriever fund increase, qualification change and the like, and belongs to complex business operation.
In the service scene of the internet, the requirement on the rate of red packet issuing is very high. The current technical scheme adopts a database transaction mode to ensure the normal operation of red packet issuing. When the red packet is issued, the red packet service firstly starts the affairs, tries to deduct the fund budget, continuously tries to deduct the number of the red packets after success, tries to record the red packet information for the user after success, and marks all the behaviors as success and updates the database at the same time when all the steps are successful so as to ensure the data consistency. The scheme can not meet the performance requirement of high efficiency, the condition that a large number of red packets are failed to be issued is easy to occur, the user can not take the red packets to be taken, and the experience is very poor.
Disclosure of Invention
The embodiment of the application provides a data processing method and device, a computer storage medium and electronic equipment, which can improve the issuing efficiency of electronic red packages and improve user experience.
In a first aspect, an embodiment of the present application provides a data processing method, including:
receiving a red envelope getting instruction;
responding to the red packet getting instruction, and acquiring target data from the head of the stack;
and generating a target object according to the target data, and sending the target object to a target user terminal.
In a second aspect, an embodiment of the present application provides a data processing apparatus, including:
the receiving module is used for receiving the red packet getting instruction;
the acquisition module is used for responding to the red packet getting instruction and taking out target data from the head of the stack;
and the sending module is used for generating a target object according to the target data and sending the target object to the target user.
In a third aspect, an embodiment of the present application provides a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the method steps provided in the first aspect of the embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps as provided by the first aspect of the embodiments of the present application.
The beneficial effects brought by the technical scheme provided by some embodiments of the application at least comprise:
in the embodiment of the application, the stack is adopted to issue the electronic red packet, whether the remaining red packets exist at present can be judged due to the first-in first-out characteristic and the automatic counting function of the stack, and if the remaining red packets exist, the red packet data is taken out from the head of the stack and sent to the target user terminal. Data may also be returned to the end of the stack in the event of a failed red packet issuance. Therefore, efficient taking out and returning of red packet data can be guaranteed, the problem of core data storage during electronic red packet issuing is solved, the problem of transaction waiting caused by disk reading and writing, resource competition, exclusive lock waiting and the like in a traditional database transaction scheme is solved, the problem that processing time of a Central Processing Unit (CPU) is wasted, system resources are occupied, and red packet issuing speed is low is solved, issuing efficiency of electronic red packets is improved, and rapid experience of users who see the red packets is achieved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a data processing system according to an embodiment of the present application;
fig. 2 is a schematic diagram illustrating an operating principle of a stack according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a data processing method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of another data processing method according to an embodiment of the present application;
fig. 5 is a schematic diagram of a workflow of stacking in a red packet issuing process according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. Further, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Fig. 1 schematically illustrates a structural diagram of a data processing system according to an embodiment of the present application. As shown in fig. 1, a data processing system may include at least: an issuing terminal 10, a server 20, and a receiving terminal cluster 30. Wherein:
the issuing terminal 10 may be a terminal that issues a red envelope. The dispensing terminal 10 may be used to initiate the task of dispensing red packets. In the embodiment of the present application, the issuing terminal 10 may set the red envelope parameter. The red envelope parameters may include the number of red envelopes, the total amount of the red envelopes, the attributes of the red envelopes, and the like. The attributes of the red packet may include a random red packet and an equal red packet. The random red packet is a hand-qi-piecing red packet, and the amount of each red packet is randomly generated. Equal red packets mean that the money of each red packet is equal.
Server 20 may be used to orchestrate the issuance and return of red packs. The server 20 may perform data interaction with the dispensing terminal 10. Specifically, the server 20 may receive an instruction that the issuing terminal 10 sets the red packet parameter, and generate a stack including N data units according to the red packet number N set by the issuing terminal 10. Each data unit may be a memory address for storing red packet data. The red packet data may include the amount of the red packet, the running water, the number, etc. The money amount of the red packet refers to the money amount of the red packet, the running water refers to running water records of fund change, and the number refers to the unique identifier of the red packet.
The trunked receiving terminal 30 may be arranged to receive red packet data. Specifically, the receiving terminal cluster 30 may include one or more receiving terminals, and fig. 1 exemplarily shows that the receiving terminal cluster 30 may include 3 receiving terminals, a receiving terminal 30a, a receiving terminal 30b, and a receiving terminal 30 c. The receiving terminal may perform data interaction with the server 20. Specifically, the receiving terminal may initiate an instruction to the server 20 to get red envelope. In response to the instruction, the server 20 may transmit red packet data to the receiving terminal.
In the embodiment of the application, data interaction among the issuing terminal, the server and the receiving terminal can be carried out through a network. The network connection may be through a cellular network connection, or a wireless connection.
The issuing terminal and the receiving terminal related in the embodiment of the present application may be a tablet Computer, a desktop Computer, a laptop Computer, a notebook Computer, an Ultra-mobile Personal Computer (UMPC), a handheld Computer, a netbook, a Personal Digital Assistant (PDA), a server, and the like.
The number of receiving terminals shown in fig. 1 is not limited, and there may be more or fewer receiving terminals in a specific implementation, which is not limited in this embodiment of the application.
The following exemplarily shows two specific application scenarios provided by the embodiment of the present application.
Questionnaire survey application scenario:
if a business party needs a user to complete a certain questionnaire survey through the internet APP, a certain cash reward can be issued to the user after the user completes the questionnaire survey, and specifically, the cash reward can be issued in the form of an electronic red packet.
Specifically, before initiating the task, the service party may set the number of red packets, the total amount of red packets, and the like in the issuing terminal, and set the relevant pickup condition. The pickup condition may be, for example, that a user who completes a questionnaire can pick up.
After receiving the instruction of setting the red packet parameters by the issuing terminal, the server can generate stacks according to the number of the red packets, the number of the stacked data units can correspond to the number of the red packets, and the data units of the stacks dynamically change along with the drawing progress of the red packets. And a pointer is respectively arranged at the head and the tail of the stack queue and points to the storage address of the red packet data. With the red envelope getting, the pointer at the head of the queue gradually moves backwards. The pointer at the end of the queue may also move backwards step by step as the red packet rolls back.
The user can complete the corresponding questionnaire survey through the receiving terminal, and sends an instruction for getting the red packet to the server after the questionnaire survey is completed. And after the verified receiving end meets the condition of receiving the red packet, the server acquires red packet data from the stack head and sends the red packet data to the receiving terminal. After the user successfully picks up the red envelope, the server can update the balance of the electronic account corresponding to the issuing terminal and the receiving terminal, so that the red envelope is issued.
Instant messaging application scenario:
an instant messenger user a issues a red envelope in a group of instant messenger APPs (such as but not limited to WeChat). The user a can set the red envelope parameters on the issuing terminal. After receiving the instruction of setting the red packet parameters by the issuing terminal, the server can generate a stack according to the number of the red packets. And after receiving the instruction of the user for getting the red packet, the receiving terminal can send the instruction of getting the red packet to the server. After receiving the instruction of getting the red packet, the server can obtain red packet data from the head of the stack queue and send the red packet data to the receiving terminal. After the receiving terminal successfully picks up the electronic account, the server can update the balance of the electronic account corresponding to the issuing terminal and the receiving terminal. If the red packet pickup fails, the server can return the red packet data, store the storage address of the returned red packet data in the tail of the stack, and shift the pointer of the tail of the stack by one bit.
The present invention is not limited to the above-mentioned application scenarios, and in a specific implementation, the present application embodiment may also be applied to other application scenarios, which are not limited in the present application embodiment.
As can be seen, the stack is an ordered single-thread storage structure, the data structure is stable, the data consistency is strong, the thread safety is inherent, and additional locking is not needed. The form of the queue supports the entry of one end of the queue and the exit of the other end of the queue, namely the characteristic of a First-in First-out (FIFO) queue. Fig. 2 illustrates a schematic diagram of the working principle of the stack. As shown in fig. 2, a plurality of data units may be included in the stack, each square in the figure represents each data unit, and the black dots in the squares represent the data stored in the data unit. Typically the data is a certain memory address. If a data is to be fetched, it is fetched from the head of the queue on the stack. If some data is to be stored in the stack, the data can be stored in the tail of the stack.
Next, a data processing method provided by an embodiment of the present application, which is applied to a server, will be described with reference to the data processing system shown in fig. 1 and the operating principle of the stack shown in fig. 2. Fig. 3 schematically shows a flow chart of a data processing method provided by an embodiment of the present application. As shown in fig. 3, the data processing method may include at least the following steps:
s301: and receiving a red packet getting instruction.
Specifically, the red envelope getting instruction may be an instruction sent by the receiving terminal to the server. The instruction may carry a device identifier of the receiving terminal, so that the server determines that the receiving terminal is the target user terminal when subsequently sending the target object.
For example, in an application scenario of the listed questionnaire, the red packet getting instruction may be a red packet getting instruction input by the user based on the receiving terminal after the questionnaire is completed.
For example, in the above listed application scenarios of instant messaging, the red packet getting instruction may be a red packet getting instruction input by the user based on the receiving terminal.
S302: and responding to the red packet getting instruction, and acquiring target data from the head of the stack.
Specifically, the stack may be generated according to a red packet parameter set by the issuing terminal. The stack contains the same number of data units as the number of red packets. The number of data units that a stack contains may be referred to as the length of the stack. And each data unit stores a storage address which is the storage position of the red packet data. The length of the stack may be dynamically adjusted as the red envelope decreases or increases.
Specifically, in response to the red packet getting instruction, the server may first fetch the storage address from the head of the stack, and then obtain the target data from the storage address.
The target data is the red packet data mentioned in the foregoing embodiments. The red packet data may include the amount of the red packet, the running water, the number, etc. The money amount of the red packet refers to the money amount of the red packet, the running water refers to running water records of fund change, and the number refers to the unique identifier of the red packet. It can be appreciated that the amount of the red envelope is determined by the attributes of the red envelope. And if the attribute of the red packet is a random red packet, the server randomly generates the sum of each red packet in advance according to the total sum of the red packets and the number of the red packets set by the issuing terminal. If the attribute of the red packet is an equal-amount red packet, the server can calculate the amount of each red packet according to the total amount of the red packets and the number of the red packets.
S303: and generating a target object according to the target data, and sending the target object to a target user terminal.
Specifically, the target object may include a red envelope amount, a running water, a number, red envelope cover data, and the like. After the server sends the target object to the target user terminal, the user terminal can display the cover of the red envelope according to the data of the cover of the red envelope and display the amount, the running water and the serial number of the red envelope.
Further, after the receiving terminal successfully receives the red envelope, the server can update the balance of the electronic account corresponding to the receiving terminal and the balance of the electronic account corresponding to the issuing terminal, so that the issuing of the red envelope is completed.
In the embodiment of the application, the stack is adopted to issue the electronic red packet, and due to the first-in first-out characteristic of the stack, red packet data can be taken out from the head of the stack and sent to the target user terminal. Therefore, efficient issuing of red packet data can be guaranteed, the problem of core data storage during issuing of electronic red packets is solved, the problem of low red packet issuing rate caused by the fact that processing time of a CPU is wasted and system resources are occupied in a traditional database transaction scheme due to transaction waiting caused by disk reading and writing, resource competition, exclusive lock waiting and the like is solved, issuing efficiency of the electronic red packets is improved, and rapid experience of users who see the red packets is achieved.
Fig. 4 is a schematic flowchart illustrating a specific data processing method provided in an embodiment of the present application. As shown in fig. 4, the data processing method may include at least the following steps:
s401: and receiving an instruction which is sent by the issuing terminal and used for setting the red packet parameters.
Specifically, the red envelope parameters may include a total amount of the red envelope, a number of the red envelope, and a red envelope attribute. The attributes of the red envelope may include a random red envelope and an equal amount of red envelope. The random red packet is a hand-qi-piecing red packet, and the amount of each red packet is randomly generated. Equal red packets mean that the money of each red packet is equal.
S402: and responding to the instruction for setting the red packet parameter, and generating a stack according to the red packet parameter.
In particular, the stack may comprise a plurality of data units. The number of data units corresponds to the number of red packets. It will be appreciated that the length of the stack may be dynamically adjusted as red packets are issued or returned. That is, the initial length of the stack is made to coincide with the number of red packets set by the issuing terminal. However, during the issuance of red packets, the length of the stack may change, consistent with the number of red packets remaining.
S403: and receiving a red packet getting instruction.
Specifically, S403 may refer to the description of S301, which is not repeated herein.
S404: and responding to the red packet getting instruction, and judging whether the residual quantity of the current red packets is zero or not. If so, the method ends, otherwise, S405 is executed.
Specifically, the remaining number of current red packets can be judged by an automatic counting function of the stack. Specifically, a pointer exists at the head of the queue and at the tail of the queue of the stack, and the counting function can be realized according to the pointer at the head of the queue and the pointer at the tail of the queue of the stack. And if the number of the current remaining red packages is zero, indicating that the red packages are completely issued. If the number of the current remaining red packages is not zero, the current red package is not released temporarily, and the user can continue to get the red packages.
S405: and determining the storage address of the target data according to the pointer at the head of the stack queue.
Specifically, when the red packet needs to be issued, red packet data needs to be acquired from the head of the queue of the stack. The address pointed by the pointer at the head of the stack queue is the storage address of the target data.
S406: and acquiring the target data from the storage address of the target data.
Specifically, after the storage address of the target data is determined, the target data can be read from the storage address. The target data may include at least the amount of the red envelope, the running water, the number, etc.
S407: and generating a target object according to the target data, and sending the target object to a target user terminal.
Specifically, S407 may refer to the description of S303, which is not described herein again.
S408: the pointer at the head of the stack queue is shifted back by one bit.
Specifically, after the server fetches the data from the head of the queue of the stack, indicating that the current number of red packets is reduced by one, the number of remaining red packets can be counted by shifting the pointer of the head of the queue back by one. At which point the pointer points to the memory address of the next remaining red packet. The pointer at the head of the stack queue may continue to move backward by one bit by the time the next red packet is sent.
S409: and judging whether a response of the red packet issuing failure returned by the target user terminal is received. If yes, go to S411; if not, go to step S410.
In particular, red packages may fail to be delivered in certain scenarios. For example, when the receiving terminal network is not good, the target object sent by the server may not be received, thereby causing the red packet issuing failure.
Possibly, if the red packet is successfully issued, the target user terminal may feed back a response of successful issuance to the server. If the target user terminal does not feed back a response of successful delivery to the server within the preset time period, the target user terminal can see that the response of failed delivery of the red packet is sent to the server.
Possibly, if the red packet is successfully issued, the target user terminal may not make any feedback to the server. If the red packet fails to be delivered, the target user terminal can send a response of the red packet failure to the server.
S410: and updating the balance of the electronic account corresponding to the target user terminal and the balance of the electronic account corresponding to the issuing terminal.
Specifically, if the red packet is successfully issued, the server may update the balance of the electronic account corresponding to the target user terminal and the balance of the electronic account corresponding to the issuing terminal, thereby completing the issuing of the red packet.
S411: and associating the target data to the tail of the stack queue, and moving the pointer at the tail of the stack queue backwards by one bit.
Specifically, if the red packet fails to be issued, the server needs to return the red packet data, and associates the target data corresponding to the red packet that fails to be issued to the tail of the stack. Specifically, the target data may be saved in the memory of the server again, the storage location is saved to the tail of the stack, and the pointer at the tail of the stack is shifted backward by one bit, so as to update the number of red packets.
Fig. 5 is a schematic diagram illustrating a workflow of a stack in a red packet issuing process according to an embodiment of the present application. As shown in fig. 5, if it is necessary to issue a red packet, the storage address is taken out from the data unit pointed by the pointer at the head of the stack queue, the red packet data is taken out from the storage address and issued to the user, and the pointer at the head of the stack queue is shifted backward by one bit, so that the user can receive the red packet. And if the red packet fails to be issued, returning the red packet data. Specifically, the memory address of the returned red packet data may be placed at the tail of the stack queue, and the pointer at the tail of the stack queue may be shifted backward by one bit. The red packet data to be issued can be quickly fetched by reading the data pointed by the stack queue head pointer. By moving pointers at the head and the tail of the queue, the automatic counting of the remaining red packets can be realized.
In the embodiment of the application, the stack is adopted to issue the electronic red packet, whether the remaining red packets exist at present can be judged due to the first-in first-out characteristic and the automatic counting function of the stack, and if the remaining red packets exist, the red packet data is taken out from the head of the stack and sent to the target user terminal. Data may also be returned to the end of the stack in the event of a failed red packet issuance. Therefore, efficient taking out and returning of the red packet data can be guaranteed, the problem of core data storage during electronic red packet issuing is solved, the problem of low red packet issuing rate caused by CPU processing time waste and system resource occupation due to transaction waiting caused by disk reading and writing, resource competition, exclusive lock waiting and the like in the traditional database transaction scheme is solved, issuing efficiency of the electronic red packet is improved, and rapid experience of a user can be realized.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 6, a schematic structural diagram of a data processing apparatus according to an exemplary embodiment of the present application is shown. The data processing means may be implemented as all or part of an electronic device, in software, hardware or a combination of both. The data processing device 60 may include: a receiving module 610, an obtaining module 620 and a sending module 630. Wherein:
a receiving module 610, configured to receive a red envelope getting instruction;
an obtaining module 620, configured to obtain target data from a head of a stack in response to the red packet getting instruction;
a sending module 630, configured to generate a target object according to the target data, and send the target object to the target user.
In some possible embodiments, the obtaining module 620 includes: a judging unit and an obtaining unit; wherein:
the judging unit is used for responding to the red packet getting instruction and judging whether the residual quantity of the current red packets is zero or not;
and the acquisition unit is used for acquiring the target data from the head of the stack after the judgment unit judges that the residual quantity of the current red packets is not zero.
In some possible embodiments, the obtaining unit includes: determining a subunit and an obtaining subunit;
wherein:
the determining subunit is used for determining the storage address of the target data according to the pointer at the head of the stack queue;
and the acquisition subunit is used for acquiring the target data from the storage address of the target data.
In some possible embodiments, the data processing device 60 further comprises a moving module for moving the pointer of the head of the stack queue backward by one bit.
In some possible embodiments, the receiving module 610 is further configured to: receiving a response of the red packet issuing failure returned by the target user terminal;
and the moving module is also used for associating the target data to the tail of the stack queue and moving the pointer of the tail of the stack queue backwards by one bit based on the response of the red packet issuing failure.
In some possible embodiments, the receiving module 610 is further configured to: receiving an instruction which is sent by a sending terminal and used for setting red packet parameters; the red packet parameters comprise the number N of red packets, wherein N is a positive integer;
the data processing device 60 further comprises a generating module, configured to, in response to the instruction for setting red packet parameters, generate the stack according to the red packet parameters; the stack includes N data units.
In some possible embodiments, the data processing apparatus 60 further includes an updating module, configured to update the balance of the electronic account corresponding to the target user terminal and the balance of the electronic account corresponding to the issuing terminal.
In the embodiment of the application, the stack is adopted to issue the electronic red packet, whether the remaining red packets exist at present can be judged due to the first-in first-out characteristic and the automatic counting function of the stack, and if the remaining red packets exist, the red packet data is taken out from the head of the stack and sent to the target user terminal. Data may also be returned to the end of the stack in the event of a failed red packet issuance. Therefore, efficient taking out and returning of the red packet data can be guaranteed, the problem of core data storage during electronic red packet issuing is solved, the problem of low red packet issuing rate caused by CPU processing time waste and system resource occupation due to transaction waiting caused by disk reading and writing, resource competition, exclusive lock waiting and the like in the traditional database transaction scheme is solved, issuing efficiency of the electronic red packet is improved, and rapid experience of a user can be realized.
It should be noted that, when the data processing apparatus provided in the foregoing embodiment executes the data processing method, only the division of the functional modules is illustrated, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the data processing apparatus and the data processing method provided in the above embodiments belong to the same concept, and details of implementation processes thereof are referred to in the method embodiments and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. As shown in fig. 7, the electronic device 70 may include: at least one processor 701, at least one network interface 704, a user interface 703, memory 705, at least one communication bus 702.
Wherein a communication bus 702 is used to enable connective communication between these components.
The user interface 703 may include a Display screen (Display) and a Camera (Camera), and the optional user interface 703 may also include a standard wired interface and a standard wireless interface.
The network interface 704 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
Processor 701 may include one or more processing cores, among other things. The processor 701 interfaces with various components throughout the electronic device 70 using various interfaces and lines to perform various functions of the electronic device 70 and to process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 705, as well as invoking data stored in the memory 705. Optionally, the processor 701 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 701 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 701, and may be implemented by a single chip.
The Memory 705 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 705 includes a non-transitory computer-readable medium. The memory 705 may be used to store instructions, programs, code sets, or instruction sets. The memory 705 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. The memory 705 may optionally be at least one memory device located remotely from the processor 701. As shown in fig. 7, the memory 705, which is a type of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a data processing application program.
In the electronic device 70 shown in fig. 7, the user interface 703 is mainly used as an interface for providing input for a user to obtain data input by the user; the processor 701 may be configured to call a data processing application stored in the memory 705, and specifically perform the following operations:
receiving a red envelope getting instruction;
responding to the red packet getting instruction, and acquiring target data from the head of the stack;
and generating a target object according to the target data, and sending the target object to a target user terminal.
In some possible embodiments, the obtaining target data from the head of queue of the stack in response to the red packet getting instruction includes:
responding to the red packet getting instruction, and judging whether the residual quantity of the current red packets is zero or not;
if not, acquiring target data from the head of the stack.
In some possible embodiments, when the processor 701 acquires the target data from the queue of the stack, specifically:
determining the storage address of the target data according to the pointer at the head of the stack queue;
and acquiring the target data from the storage address of the target data.
In some possible embodiments, after the processor 701 sends the target object to the target user terminal, the processor is further configured to: and moving the pointer of the head of the stack queue backwards by one bit.
In some possible embodiments, the processor 701 is further configured to perform:
receiving a response of the red packet issuing failure returned by the target user terminal;
and associating the target data to the tail of the stack based on the response of the red packet issuing failure, and moving the pointer of the tail of the stack back by one bit.
In some possible embodiments, before receiving the red packet getting instruction, the processor 701 is further configured to:
receiving an instruction which is sent by a sending terminal and used for setting red packet parameters; the red packet parameters comprise the number N of red packets, wherein N is a positive integer;
responding to the instruction for setting the red packet parameter, and generating the stack according to the red packet parameter; the stack includes N data units.
In some possible embodiments, after the processor 701 sends the target object to the target user terminal, the processor is further configured to:
and updating the balance of the electronic account corresponding to the target user terminal and the balance of the electronic account corresponding to the issuing terminal.
In the embodiment of the application, the stack is adopted to issue the electronic red packet, whether the remaining red packets exist at present can be judged due to the first-in first-out characteristic and the automatic counting function of the stack, and if the remaining red packets exist, the red packet data is taken out from the head of the stack and sent to the target user terminal. Data may also be returned to the end of the stack in the event of a failed red packet issuance. Therefore, efficient taking out and returning of the red packet data can be guaranteed, the problem of core data storage during electronic red packet issuing is solved, the problem of low red packet issuing rate caused by CPU processing time waste and system resource occupation due to transaction waiting caused by disk reading and writing, resource competition, exclusive lock waiting and the like in the traditional database transaction scheme is solved, issuing efficiency of the electronic red packet is improved, and rapid experience of a user can be realized.
Embodiments of the present application also provide a computer-readable storage medium, which stores instructions that, when executed on a computer or a processor, cause the computer or the processor to perform one or more of the steps in the embodiments shown in fig. 3 to 4. The respective constituent modules of the above-described data processing apparatus may be stored in the computer-readable storage medium if they are implemented in the form of software functional units and sold or used as independent products.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in or transmitted over a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)), or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., Digital Versatile Disk (DVD)), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. And the aforementioned storage medium includes: various media capable of storing program codes, such as a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, and an optical disk. The technical features in the present examples and embodiments may be arbitrarily combined without conflict.
The above-described embodiments are merely preferred embodiments of the present application, and are not intended to limit the scope of the present application, and various modifications and improvements made to the technical solutions of the present application by those skilled in the art without departing from the design spirit of the present application should fall within the protection scope defined by the claims of the present application.

Claims (10)

1. A data processing method, comprising:
receiving a red envelope getting instruction;
responding to the red packet getting instruction, and acquiring target data from the head of the stack;
and generating a target object according to the target data, and sending the target object to a target user terminal.
2. The method of claim 1, wherein said obtaining target data from a head of queue of a stack in response to said red packet get instruction comprises:
responding to the red packet getting instruction, and judging whether the residual quantity of the current red packets is zero or not;
if not, acquiring target data from the head of the stack.
3. The method of claim 1, wherein said retrieving target data from a queue of a stack comprises:
determining the storage address of the target data according to the pointer at the head of the stack queue;
and acquiring the target data from the storage address of the target data.
4. The method of claim 3, wherein after sending the target object to a target user terminal, the method further comprises: and moving the pointer of the head of the stack queue backwards by one bit.
5. The method of claim 1, wherein the method further comprises:
receiving a response of the red packet issuing failure returned by the target user terminal;
and associating the target data to the tail of the stack based on the response of the red packet issuing failure, and moving the pointer of the tail of the stack back by one bit.
6. The method of claim 1, wherein prior to receiving the red packet pick-up instruction, the method further comprises:
receiving an instruction which is sent by a sending terminal and used for setting red packet parameters; the red packet parameters comprise the number N of red packets, wherein N is a positive integer;
responding to the instruction for setting the red packet parameter, and generating the stack according to the red packet parameter; the stack includes N data units.
7. The method of claim 6, wherein after sending the target object to a target user terminal, the method further comprises:
and updating the balance of the electronic account corresponding to the target user terminal and the balance of the electronic account corresponding to the issuing terminal.
8. A data processing apparatus, comprising:
the receiving module is used for receiving the red packet getting instruction;
the acquisition module is used for responding to the red packet getting instruction and acquiring target data from the head of the stack;
and the sending module is used for generating a target object according to the target data and sending the target object to the target user.
9. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to perform the method steps according to any of claims 1-7.
10. An electronic device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method steps according to any of claims 1-7.
CN202011217661.1A 2020-11-04 2020-11-04 Data processing method and device, computer storage medium and electronic equipment Pending CN112308621A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011217661.1A CN112308621A (en) 2020-11-04 2020-11-04 Data processing method and device, computer storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011217661.1A CN112308621A (en) 2020-11-04 2020-11-04 Data processing method and device, computer storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112308621A true CN112308621A (en) 2021-02-02

Family

ID=74325995

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011217661.1A Pending CN112308621A (en) 2020-11-04 2020-11-04 Data processing method and device, computer storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112308621A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104954468A (en) * 2015-06-18 2015-09-30 小米科技有限责任公司 Resource allocation method and resource allocation device
CN106095877A (en) * 2016-06-07 2016-11-09 中国建设银行股份有限公司 A kind of red packet data processing method and device
CN106649637A (en) * 2016-12-08 2017-05-10 武汉斗鱼网络科技有限公司 Red envelope processing method and system
CN109242457A (en) * 2018-09-21 2019-01-18 刘磊 A kind of method and system for robbing red packet
CN109636364A (en) * 2018-12-29 2019-04-16 江苏满运软件科技有限公司 The method, system, equipment and the medium that distribute are grouped for electronics red packet
CN110675133A (en) * 2019-09-30 2020-01-10 北京金山安全软件有限公司 Red packet robbing method and device, electronic equipment and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104954468A (en) * 2015-06-18 2015-09-30 小米科技有限责任公司 Resource allocation method and resource allocation device
CN106095877A (en) * 2016-06-07 2016-11-09 中国建设银行股份有限公司 A kind of red packet data processing method and device
CN106649637A (en) * 2016-12-08 2017-05-10 武汉斗鱼网络科技有限公司 Red envelope processing method and system
CN109242457A (en) * 2018-09-21 2019-01-18 刘磊 A kind of method and system for robbing red packet
CN109636364A (en) * 2018-12-29 2019-04-16 江苏满运软件科技有限公司 The method, system, equipment and the medium that distribute are grouped for electronics red packet
CN110675133A (en) * 2019-09-30 2020-01-10 北京金山安全软件有限公司 Red packet robbing method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US10861107B2 (en) Interaction system and method, client, and background server
CN109242483A (en) A kind of dual trading method and system based on centralization and decentralization
CN106572146A (en) Message sending method and message sending device
CN110728558B (en) Virtual package transmitting method, device, equipment and storage medium
CN111159617B (en) Distribution control method and device of multimedia content and content management system
CN109918203A (en) Access server memory management optimization method, access server and communication system
CN111080429B (en) Virtual resource acquisition method, device and storage medium
CN112184469B (en) Group interaction method, device, equipment and storage medium
CN111445331A (en) Transaction matching method and device
CN115017030A (en) Resource allocation method, device, electronic equipment and storage medium
CN110599343B (en) Contract data processing method, related device and medium
CN112308621A (en) Data processing method and device, computer storage medium and electronic equipment
CN110557661B (en) Method, device, equipment and medium for determining delivery grade
CN111552575A (en) Message queue-based message consumption method, device and equipment
CN110992011A (en) Data splitting method and device, electronic equipment and storage medium
CN110162415B (en) Method, server, device and storage medium for processing data request
CN113421045A (en) Waybill information sending method and device, electronic equipment and computer readable medium
CN113449994A (en) Assignment method, assignment device, electronic device, medium, and program product for job ticket
CN113300937A (en) Resource allocation method, display method, device, system and equipment
CN108829824B (en) Resource processing method and device in internet operation activity
CN112612401A (en) Prompt message processing method, device, system, equipment and storage medium
CN111311146A (en) Information transmission method and system, communication system, computer readable storage medium
CN111192113A (en) Order processing method, device, equipment and storage medium
CN110992118A (en) Electronic invoice issuing method, device, storage medium, equipment and system
CN109714381A (en) Information-pushing method, equipment, storage medium and device based on consumption tracking

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210727

Address after: 518000 2501, office building T2, Qianhai China Resources Financial Center, No. 55, guiwan 4th Road, Nanshan street, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong

Applicant after: Shenzhen Huantai Digital Technology Co.,Ltd.

Address before: 518057 Fuan Science and Technology Building, Block B, No. 13, Yuehai Street, Nanshan District, Shenzhen City, Guangdong Province, 207-2

Applicant before: Shenzhen Huantai Technology Co.,Ltd.

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230630

Address after: 1301, Office Building T2, Qianhai China Resources Financial Center, No. 55 Guiwan Fourth Road, Nanshan Street, Qianhai Shenzhen-Hong Kong Cooperation Zone, Shenzhen, Guangdong Province, 518052

Applicant after: Shenzhen Hefei Technology Co.,Ltd.

Address before: 518000 2501, office building T2, Qianhai China Resources Financial Center, No. 55, guiwan 4th Road, Nanshan street, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong

Applicant before: Shenzhen Huantai Digital Technology Co.,Ltd.