Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
The following describes a service data processing method and apparatus according to an embodiment of the present application with reference to the drawings.
Fig. 1 is a flowchart of a service data processing method according to an embodiment of the present application.
It should be noted that the service data processing method in the embodiment of the present application may be applied to a group chat scenario of an instant messaging application, and the type of the instant messaging application may not be limited, and may be any one of applications in the market, such as a pay bank application, a wechat application, a QQ application, and the like. In addition, the service may be a red packet or the like.
As shown in fig. 1, the service data processing method may include:
s110, receiving group chat information sent by a first terminal, where the group chat information at least includes a group identifier of a chat group to which the first terminal belongs, and service data information, where the service data information at least includes identifier information of N second terminals, and N is a positive integer.
When a user wants to send a directed service message to at least one specific group member in a certain chat group through an instant messaging application and wants to make all the group members see the service message, the user can edit corresponding service data information through a terminal (such as a mobile terminal) to which the user belongs, for example, the specific group member can be selected from a group member list through the terminal, and characteristic data of the service is set, for example, if the service is a red packet, the characteristic data of the red packet robbing service can include the number of red packets, the total amount of the red packets and the like. When the terminal detects a determination instruction of the user for the completion of editing the service data information, the terminal may organize the service data information edited by the user and the group identifier of the chat group into a group chat information and send the group chat information to a server (e.g., a server).
S120, determining the service type of the group chat information, and generating corresponding service information according to the service type and the service data information.
It is understood that in embodiments of the present application, the service type may include, but is not limited to, a short message type, a video type, a picture type, a voice type, a red packet type, and the like.
Specifically, after receiving the group chat message sent by the terminal, the group chat message may be analyzed to determine the service type of the message, and then, the corresponding service message may be generated according to the service type and the service data message in the group chat message. For example, taking the red packet service as an example, after determining that the service type of the group chat information is the red packet type, finding the generation rule of the red packet information according to the red packet type, and generating the corresponding red packet information according to the generation rule of the red packet information and the service data information (such as the number of red packets, the total amount of red packets, and the like).
In an embodiment of the present application, a specific implementation process for determining the service type of the group chat message may be as follows: the content format of the group chat message may be analyzed to determine the service type of the group chat message according to the content format of the group chat message, for example, if the content format of the group chat message is a text format, the service type of the group chat message is determined to be a short message type.
In another embodiment of the present application, the specific implementation process for determining the service type of the group chat message may be as follows: the identifier of the service type carried in the group chat information may be used to determine the service type of the group chat information, for example, if the identifier of the red packet type is carried in the group chat information, the service type of the group chat information may be determined to be the red packet type.
S130, the service information is sent to M terminals in the chat group according to the group identification, wherein M is a positive integer and is larger than or equal to N.
Specifically, in the embodiment of the present application, the identification information of the M terminals included in the chat group may be determined according to the group identifier, and the service information may be sent to the M terminals according to the identification information of the M terminals.
S140, receiving operation requests input by the M terminals for the service information, and performing service data processing on the service information according to the operation requests and the identification information of the N second terminals.
In the embodiment of the present application, the operation request may include, but is not limited to, identification information of the M terminals, and the like.
Specifically, after the service information is sent to each terminal in the chat group, the user to which each terminal belongs may perform an input operation, such as a click operation, on the service information through each terminal. When an operation request, such as a click operation request, sent by a terminal and input by a user for service information is received, terminal identification information carried in the operation request can be matched with identification information of the N second terminals, and different service data processing can be respectively carried out on the service information according to a matching result. The process of performing service data processing on the service information will be described in detail below.
Specifically, in the embodiment of the present application, as shown in fig. 2, a specific implementation process of performing service data processing on service information according to an operation request and identification information of N second terminals may include:
s210, judging whether the identification information of the ith terminal exists in the identification information of the N second terminals, wherein i is a positive integer and is more than or equal to 1 and less than or equal to M.
Specifically, after receiving an operation request for service information input sent by the ith terminal, the identification information of the ith terminal carried in the operation request may be matched with the identification information of the N second terminals, so as to determine whether the identification information of the ith terminal exists in the identification information of the N second terminals. That is, each time an operation request for service information input sent by one terminal is received, it may be determined whether the identification information of the terminal carried in the currently received operation request exists in the identification information of the N second terminals.
S220, if the identification information of the ith terminal exists in the identification information of the N second terminals, distributing control authority to the ith terminal, and processing service data of the service information according to the control authority.
And S230, if the identification information of the ith terminal does not exist in the identification information of the N second terminals, generating prompt information, and sending the prompt information to the ith terminal to remind the ith terminal that the control authority aiming at the service information does not exist.
It should be noted that, in the embodiment of the present application, the control right may be understood as a right to data processing of the service information. That is, when it is determined that the identification information of the ith terminal exists in the identification information of the N second terminals, the ith terminal may be assigned with a right capable of controlling data processing of the service information, so as to achieve the purpose that the terminal can perform service data processing on the service information.
In an embodiment of the present application, the service information may include, but is not limited to, a number of services and a total amount of services, and before receiving an operation request input by the M terminals for the service information, the service data processing method may further include: and generating a plurality of random numbers according to the number of the services and the total amount of the services, wherein the number of the random numbers is the same as the number of the services. That is, before receiving the operation requests input by the M terminals for the service information, the random numbers may be generated in the same number as the number of services according to the total amount of services, for example, if the number of services is 5 and the total amount of services is 10, the random numbers may be randomly generated in 5 numbers according to the total amount of services 10. It is understood that, in order to make the generated random numbers have the same size as much as possible or have a small difference, the random numbers may be randomly generated according to a certain rule according to the total amount of the business to optimize the size of the random numbers.
In the embodiment of the present application, if the random number is generated in advance, that is, the random number is generated at random before receiving an operation request input by the ith terminal for service information, as shown in fig. 3, a specific implementation process of performing service data processing on the service information according to the control authority may include:
s310, determining the time information of the operation request input by the ith terminal to the service information, and determining the random number corresponding to the ith terminal according to the time information.
And S320, generating result prompt information according to the random number corresponding to the ith terminal, and sending the result prompt information to the ith terminal for displaying according to the identification information of the ith terminal.
That is to say, the sequence of the input operation of each terminal on the service information can be determined according to the time information of the operation request input by the ith terminal on the service information, and the random number corresponding to each terminal can be determined according to the sequence. For example, the pre-generated random number may be stored in an array, when the sequence of the input operation performed by the ith terminal on the service information is first, it may be determined that the random number corresponding to the ith terminal is the first random number in the array, and then, the result prompt information may be generated by the first random number, and the result prompt information may be sent to the ith terminal for display according to the identification information of the ith terminal.
The foregoing is described with reference to the random number as generated in advance, it is understood that the random number may also be generated in the process of performing service data processing on service information according to the control authority after the control authority is assigned to the terminal, and a detailed interface will be described in this case.
In another embodiment of the present application, the service information may include a total amount of the service. In the embodiment of the present application, as shown in fig. 4, a specific implementation process of performing service data processing on service information according to a control authority may include:
s410, assume that the counter K is 0.
And S420, generating a random number corresponding to the ith terminal according to the control authority and the total amount of the service, and generating result prompt information according to the random number.
That is, after determining that the identification information of one terminal exists in the identification information of the N second terminals and assigning the control authority to the terminal, a random number corresponding to the terminal may be randomly generated according to the control authority and the total amount of the service, and corresponding result prompt information may be generated according to the random number.
And S430, sending the result prompt information to the ith terminal for displaying according to the identification information of the ith terminal, and recording the counter K as K + 1.
That is, each time the result presentation information generated based on the random number is transmitted to the corresponding terminal, the counter may be incremented by 1 so as to determine whether the random number can be generated for the terminal when the terminal having the control authority performs the input operation on the service information as the subsequent determination reference. Specifically, in the embodiment of the present application, the service information further includes a service number, as shown in fig. 5, that is, based on the service number shown in fig. 4, before generating the random number corresponding to the ith terminal according to the control authority and the total amount of the service, the method may further include:
s510, calculating the sum of the random numbers generated currently, and calculating the current remaining total amount of the service according to the sum of the random numbers and the total amount of the service.
Specifically, all currently generated random numbers are summed to obtain a currently generated random number sum, and a difference between the total amount of the service and the random number sum is calculated, and the difference can be used as the current remaining total amount of the service.
And S520, comparing the sum of the random numbers with the total amount of the service.
That is, the sum of the random numbers may be compared with the total amount of the service, and when the sum of the random numbers is equal to the total amount of the service, a prompt message may be generated and sent to the current terminal to remind the terminal that the total amount of the service has been completely allocated. For example, taking the red packet service as an example, when the sum of the random numbers is equal to the total amount of the service (i.e., the total amount of the red packet), it may be considered that all the red packets have been robbed, and at this time, corresponding prompt information may be generated to prompt the corresponding terminal that all the red packets have been robbed.
S530, if the sum of the random numbers is less than the total amount of the services, whether the counter is equal to the difference between the number of the services and the value 1 is judged.
And S540, if the counter is not equal to the difference value, generating a random number corresponding to the ith terminal according to the control authority and the current remaining total amount of the service.
And S550, if the counter is equal to the difference value, generating result prompt information according to the control authority and the current remaining total amount of the service.
That is, when the counter is judged not to be equal to the difference value, a random number can be randomly generated from the current remaining total amount of the service according to the control authority; when the counter is judged to be equal to the difference value, the current remaining total amount of the service can be used as the random number of the current terminal, and corresponding result prompt information is generated according to the random number.
In order to enable those skilled in the art to understand the present application more clearly, the following takes the service as a red packet snatching service as an example, that is, the service data processing method of the embodiment of the present application is applied to a red packet snatching scene of group chat in instant messaging application, and is described.
For example, suppose user a wants to send a directed red envelope to at least one group member (e.g., user B, user C, user D) through a group chat of an instant messaging application, it can be understood that the group member may or may not be a friend of user a. When receiving the group chat information sent by the user a, the group chat information may include the group identifier of the chat group to which the user a belongs, the number of the red packets is 2, the total amount of the red packets is 10 yuan, and the identifier information of the terminals to which the user B, the user C, and the user D belong. Then, it may be determined that the service type of the group chat message sent by the user a is a red packet type, and corresponding red packet information is generated according to the red packet type, the number of the red packets is 2, and the total amount of the red packets is 10 yuan, for example, 2 red packets are generated, and the total amount of the 2 red packets is 10 yuan, and the red packet information is sent to each terminal in the chat group according to the group identifier, and each terminal performs a red packet robbing operation on the red packet information, for example, clicks the red packet information to implement the red packet robbing operation. As shown in fig. 6, when receiving a red packet robbing operation request input by each terminal for red packet information, it may be determined whether the identification information of the current terminal exists in the identification information of the terminals to which the user B, the user C, and the user D belong, and if so, the current user is assigned with an authority, that is, the group red packet robbing may be performed; and if the current user does not exist, the current user is not given the group red packet robbing authority, namely the group red packet cannot be robbed. From this, can realize under the group chats the mode, through very simple and convenient operation, directly send the red envelope to specific crowd for this specific crowd can rob this group red envelope according to fortune, and, through directional red envelope of sending for specific crowd under the witness of other crowd members in chatting the crowd, promoted the enjoyment that the user used the product, and then improved the viscidity between user and the product.
The service data processing method of the embodiment of the application can receive group chat information sent by a first terminal, wherein the group chat information comprises a group identifier of a chat group to which the first terminal belongs and service data information, then the service type of the group chat information can be determined, corresponding service information is generated according to the service type and the service data information, the service information is sent to each terminal in the chat group according to the group identifier, and then when an operation request input by each terminal for the service information is received, the service data processing can be carried out on the service information according to the operation request and the identifier information of a second terminal in the service data information. The method and the device realize that the authority for processing the service data aiming at the service information is directly distributed to the specific crowd through very simple and convenient operation in the group chat mode, so that the specific crowd has the authority to process the service data of the service information, and the service information is directionally sent to the specific crowd under the witnesses of other group members in the chat group, thereby improving the enjoyment of using products by users and improving the viscosity between the users and the products.
Corresponding to the service data processing methods provided in the foregoing several embodiments, an embodiment of the present invention further provides a service data processing apparatus, and since the service data processing apparatus provided in the embodiment of the present invention corresponds to the service data processing methods provided in the foregoing several embodiments, the implementation of the foregoing service data processing method is also applicable to the service data processing apparatus provided in this embodiment, and is not described in detail in this embodiment. Fig. 7 is a block diagram of a service data processing apparatus according to an embodiment of the present application. As shown in fig. 7, the service data processing apparatus may include: the system comprises a first receiving module 100, a determining module 200, a first generating module 300, a sending module 400, a second receiving module 500 and a service data processing module 600.
Specifically, the first receiving module 100 may be configured to receive group chat information sent by a first terminal, where the group chat information at least includes a group identifier of a chat group to which the first terminal belongs, and service data information, where the service data information at least includes identifier information of N second terminals, and N is a positive integer.
The determination module 200 may be used to determine the traffic type of the group chat information.
The first generating module 300 may be configured to generate corresponding service information according to the service type and the service data information.
The sending module 400 may be configured to send the service information to M terminals in the chat group according to the group identifier, where M is a positive integer and is greater than or equal to N.
Specifically, in one embodiment of the present application, as shown in fig. 8, the sending module 400 may include a determining unit 410 and a sending unit 420. Wherein, the determining unit 410 may be configured to determine, according to the group identifier, the identifier information of the M terminals included in the chat group. The sending unit 420 may be configured to send the service information to the M terminals according to the identification information of the M terminals.
The second receiving module 500 may be configured to receive operation requests input by the M terminals for service information.
The service data processing module 600 may be configured to perform service data processing on the service information according to the operation request and the identification information of the N second terminals.
It should be noted that, in an embodiment of the present application, the operation request may include identification information of the M terminals. In an embodiment of the present application, as shown in fig. 9, the service data processing module 600 may include: a judging unit 610, a right assigning unit 620, a service data processing unit 630, a generating unit 640, and a transmitting unit 650.
The determining unit 610 may be configured to determine whether the identification information of the ith terminal exists in the identification information of the N second terminals, where i is a positive integer and is greater than or equal to 1 and less than or equal to M.
The right assigning unit 620 may be configured to assign a control right to the ith terminal when the determining unit 610 determines that the identification information of the ith terminal exists in the identification information of the N second terminals.
The service data processing unit 630 may be configured to perform service data processing on the service information according to the control authority.
The generating unit 640 may be configured to generate the prompt information when the determining unit 610 determines that the identification information of the ith terminal does not exist in the identification information of the N second terminals.
The sending unit 650 may be configured to send a prompt message to the ith terminal to remind the ith terminal that the control authority for the service information is not available.
In one embodiment of the present application, the service information may include the number of services and the total amount of services. In an embodiment of the present application, before the second receiving module 500 receives operation requests of the M terminals for service information input, as shown in fig. 10, the service data processing apparatus may further include: a second generating module 700, where the second generating module 700 is configured to generate a plurality of random numbers according to the number of services and the total amount of the services, where the number of the random numbers is the same as the number of the services.
In the embodiment of the present application, the specific implementation process of the service data processing unit 630 performing service data processing on the service information according to the control authority may be as follows: determining time information of an operation request input by the ith terminal to the service information, and determining a random number corresponding to the ith terminal according to the time information; and generating result prompt information according to the random number corresponding to the ith terminal, and sending the result prompt information to the ith terminal for displaying according to the identification information of the ith terminal.
In another embodiment of the present application, the service information may include a total amount of the service. In the embodiment of the present application, a specific implementation process of the service data processing unit 630 performing service data processing on the service information according to the control authority may be as follows: assume that counter K is 0; generating a random number corresponding to the ith terminal according to the control authority and the total amount of the service, and generating result prompt information according to the random number; and sending the result prompt information to the ith terminal for displaying according to the identification information of the ith terminal, and recording a counter K which is K + 1.
In an embodiment of the present application, the service information may further include a service number, the service data processing unit 630 may be further configured to calculate a sum of currently generated random numbers before generating a random number corresponding to the ith terminal according to the control authority and the total amount of the service, calculate a current remaining total amount of the service according to the sum of the random numbers and the total amount of the service, generate a random number corresponding to the ith terminal according to the control authority and the current remaining total amount of the service when the sum of the random numbers is smaller than the total amount of the service and the counter is not equal to a difference between the service number and the value 1, and generate result prompt information according to the control authority and the current remaining total amount of the service when the counter is equal to the difference.
The service data processing device of the embodiment of the application can receive group chat information sent by a first terminal through a first receiving module, wherein the group chat information comprises a group identifier of a chat group to which the first terminal belongs and service data information, a determining module determines the service type of the group chat information, a first generating module generates corresponding service information according to the service type and the service data information, a sending module sends the service information to each terminal in the chat group according to the group identifier, and when a second receiving module receives an operation request input by each terminal aiming at the service information, a service data processing module carries out service data processing on the service information according to the operation request and the identifier information of a second terminal in the service data information. The method and the device realize that the authority for processing the service data aiming at the service information is directly distributed to the specific crowd through very simple and convenient operation in the group chat mode, so that the specific crowd has the authority to process the service data of the service information, and the service information is directionally sent to the specific crowd under the witnesses of other group members in the chat group, thereby improving the enjoyment of using products by users and improving the viscosity between the users and the products.
In the description of the present application, it is to be understood that the terms "first", "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.