A method and device for processing business requests

By quickly generating pending teams in the teaming stage of resource sharing services and responding to user requests in a timely manner, and using circular buffers for batch processing in the allocation of activity tasks, the low processing efficiency and poor user experience in the existing technology are solved. The problem has been achieved to achieve more efficient resource sharing business processing.

CN113763101BActive Publication Date: 2025-02-25BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110019668.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-07
Publication Date
2025-02-25
Estimated Expiration
2041-01-07

AI Technical Summary

Technical Problem

The existing technology cannot process user requests in a timely manner during the teaming stage of resource sharing services, resulting in large system resource consumption and poor user experience with low user levels; in the allocation of activity tasks, the use of lock mechanism leads to low processing efficiency.

Method used

During the teaming stage, quickly determine and generate pending participating teams, and respond to user requests in a timely manner; during the allocation of activity tasks, the circular buffer is used to batch allocate activity tasks in a lock-free thread-safe way.

Benefits of technology

Improve user experience, and quickly generate pending participating teams by responding to user requests in a timely manner; improve overall processing efficiency, and reduce performance bottlenecks caused by locking mechanisms by batch allocation of activity tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113763101B_ABST
    Figure CN113763101B_ABST
Patent Text Reader

Abstract

This invention discloses a business request processing method and apparatus, relating to the field of computer technology. One specific embodiment of the method includes: receiving a user's resource sharing request; generating a team of users to be processed based on preset attribute values ​​of the request; storing the user requests in the teams into a circular buffer; when preset conditions are met, obtaining at least one team of users to be processed from the circular buffer, and creating an activity task based on the team of users to be processed, so that the team of users to be processed can achieve resource sharing by executing the activity task. This embodiment can quickly determine and generate teams of users to be processed based on user requests during the team formation stage of resource sharing, and respond to all user requests in a timely manner, improving user experience; and the use of a circular buffer in the activity task allocation stage allows for batch allocation of activity tasks to users based on user requests in a lock-free, thread-safe manner, improving overall processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for processing a business request. Background Art

[0002] The development of Internet technology has affected people's consumption patterns. Resource-sharing consumption patterns (such as group buying) are widely used. In resource-sharing consumption patterns, there are limits on the number of people in a group and some group requirements (such as the number of people in a team must reach the upper limit of the team before users in the team can make a purchase). Resource-sharing consumption patterns can usually be divided into two stages: the team formation stage, and the stage of assigning activity tasks to users in the team. In the prior art, in the team formation stage, all user requests are often accepted first but not processed immediately. The user level is considered to determine whether the team formation is successful. In the stage of assigning activity tasks, a general waiting queue is usually used, and a lock mechanism is used to process user requests one by one.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] In the team formation stage, if the accepted requests are not processed immediately, a large number of user requests will continue to consume system resources, and the success of the team formation is determined based on the user's level, so the team to be joined can be generated later, which may cause poor user experience for some users who made requests earlier but have lower levels. In addition, the failure to provide timely feedback to users on whether the team formation is successful may also cause poor user experience.

[0005] In the stage of allocating active tasks, using a general waiting queue and a lock mechanism to process user requests one by one can easily lead to low processing efficiency. Summary of the invention

[0006] In view of this, an embodiment of the present invention provides a business request processing method and device, which can quickly determine and generate a team to be processed according to user requests in the team formation stage of the resource sharing business, and respond to all user requests in a timely manner, thereby improving the user experience; and using a circular buffer in the activity task allocation stage, so that activity tasks can be allocated to users in batches according to user requests in a lock-free thread-safe manner, thereby improving the overall processing efficiency.

[0007] To achieve the above object, according to one aspect of an embodiment of the present invention, a service request processing method is provided, comprising:

[0008] Receive a user's resource sharing request, and generate a team to be processed based on the preset attribute value of the request;

[0009] Storing requests of users in the team in a circular buffer;

[0010] When the preset conditions are met, at least one to-be-processed participating team in the circular buffer is obtained, and an activity task is created based on the to-be-processed participating team, so that the to-be-processed participating team can realize resource sharing by executing the activity task.

[0011] Optionally, before receiving the user resource sharing request, the method further includes:

[0012] Obtain resource sharing business information;

[0013] Converting the resource sharing service information into service parameter data;

[0014] A service entry is created for the resource sharing service based on the service parameter data.

[0015] Optionally, the service parameter data at least includes: resource sharing service identifier, start time, end time, resource item identifier, total inventory of resource items, upper limit of number of people in a team, and upper limit of number of teams;

[0016] Before generating a to-be-processed group-participating team according to the preset attribute value of the request, the method further includes: when it is detected that the current time reaches the start time, opening the service entrance to receive a user resource sharing request; and

[0017] When it is detected that the current time reaches the end time or it is detected that the number of teams to be processed reaches the upper limit of the number of teams, the business entrance is closed to stop receiving user resource sharing requests.

[0018] Optionally, the preset attribute value includes: user identification, team identification of the target team requested by the user, and target position information in the target team; the target position includes: team leader position and team member position;

[0019] The step of generating a to-be-processed participating team according to the preset attribute value of the request includes:

[0020] Generating a correspondence between the team identifier and the user identifier in a first-level cache according to the request;

[0021] Determine whether the team data of the target team exists in the secondary cache; if not, create the team data of the target team in the secondary cache based on the corresponding relationship; if yes, update the corresponding relationship to the team data of the target team; the team data includes: the corresponding relationship between the team identifier and the user identifier of the user in the team;

[0022] When the number of corresponding relationships in the target team data reaches the upper limit of the number of people in the team, the target team is used as the participating team to be processed.

[0023] Optionally, the service request processing method provided by the present invention further includes: before reaching the end time, further including:

[0024] When there is second team data in the secondary cache whose number of corresponding relationships does not reach the upper limit of the number of people in the team, the correspondence between the user identifier and the team identifier in the second team data is adjusted so that after adjustment, there is at most one team whose number of corresponding relationships does not reach the upper limit of the number of people in the team.

[0025] Optionally, after creating or updating the team data of the target team in the secondary cache, the method further includes: returning a notification message of success or failure in joining the team to the corresponding user according to the result of whether the team data is successfully created or updated;

[0026] After the pending group joining team is generated, the method further includes: returning a notification message of successful group formation to users in the pending group joining team; and

[0027] After detecting that the current time reaches the end time, a notification message of group formation failure is returned to the users in the team whose number of corresponding relationships does not reach the upper limit of the number of people in the team.

[0028] Optionally, before storing the requests of the users in the team into the circular buffer, the method further comprises:

[0029] Read the total inventory n of the resource item, determine an integer power value m of 2 that is greater than n; create a circular buffer with m data slots for the resource sharing service;

[0030] The step of storing the requests of the users in the team into a circular buffer comprises:

[0031] The user's request in the team data is stored in the data slot of the circular buffer.

[0032] Optionally, when a preset condition is met, obtaining at least one to-be-processed participating team in the circular buffer, and creating an activity task based on the to-be-processed participating team, includes:

[0033] Determine whether there is a creation time of the activity task; if not, use the start time as the comparison time; if so, use the most recent creation time of the activity task as the comparison time;

[0034] Determine whether the number of requests stored in the circular buffer reaches a preset value within a preset time period after the comparison moment; wherein the preset value is an integer multiple of the upper limit of the number of people in the team;

[0035] If so, when the preset value is reached, all the waiting groups in the circular buffer are obtained, and respective activity tasks are created for the target users in all the waiting groups;

[0036] If not, at a time of a preset length after the comparison time, all the waiting groups in the circular buffer are obtained, and respective activity tasks are created for the target users in all the waiting groups.

[0037] Optionally, after creating an activity task based on the to-be-processed participating team, the method further includes:

[0038] Taking out the request of the target user in the pending group joining team from the circular buffer;

[0039] When the target user successfully executes the activity task, a notification message of successful execution is returned to the target user, and a corresponding activity task record is generated;

[0040] When the target user fails to execute the activity task, a notification message of execution failure is returned to the user.

[0041] According to another aspect of an embodiment of the present invention, a service request processing device is provided, including:

[0042] A team generation module is used to receive a user's resource sharing request and generate a team to be processed according to a preset attribute value of the request;

[0043] A request storage module, used for storing requests of users in the team into a circular buffer;

[0044] The activity task creation module is used to obtain at least one pending participating team in the circular buffer when a preset condition is met, and create an activity task based on the pending participating team, so that the pending participating team can realize resource sharing by executing the activity task.

[0045] Optionally, before receiving the user resource sharing request, the team generating module further includes:

[0046] Obtain resource sharing business information;

[0047] Converting the resource sharing service information into service parameter data;

[0048] A service entry is created for the resource sharing service based on the service parameter data.

[0049] Optionally, the service parameter data at least includes: resource sharing service identifier, start time, end time, resource item identifier, total inventory of resource items, upper limit of number of people in a team, and upper limit of number of teams;

[0050] Before the team generation module generates the to-be-processed team according to the preset attribute value of the request, the module further includes: when it is detected that the current time reaches the start time, opening the service entrance to receive a user resource sharing request; and

[0051] When it is detected that the current time reaches the end time or it is detected that the number of teams to be processed reaches the upper limit of the number of teams, the business entrance is closed to stop receiving user resource sharing requests.

[0052] Optionally, the preset attribute value includes: user identification, team identification of the target team requested by the user, and target position information in the target team; the target position includes: team leader position and team member position;

[0053] The team generation module generates a to-be-processed group participation team according to the preset attribute value of the request, including:

[0054] Generating a correspondence between the team identifier and the user identifier in a first-level cache according to the request;

[0055] Determine whether the team data of the target team exists in the secondary cache; if not, create the team data of the target team in the secondary cache based on the corresponding relationship; if yes, update the corresponding relationship to the team data of the target team; the team data includes: the corresponding relationship between the team identifier and the user identifier of the user in the team;

[0056] When the number of corresponding relationships in the target team data reaches the upper limit of the number of people in the team, the target team is used as the participating team to be processed.

[0057] Optionally, the team generation module is further used to: before reaching the end time, further include:

[0058] When there is second team data in the secondary cache whose number of corresponding relationships does not reach the upper limit of the number of people in the team, the correspondence between the user identifier and the team identifier in the second team data is adjusted so that after the adjustment, there is at most one team whose number of corresponding relationships does not reach the upper limit of the number of people in the team.

[0059] Optionally, after creating or updating the team data of the target team in the secondary cache, the team generating module is further used to: return a notification message of success or failure in joining the team to the corresponding user according to the result of whether the team data is successfully created or updated;

[0060] After the pending group joining team is generated, the method further includes: returning a notification message of successful group formation to users in the pending group joining team; and

[0061] After detecting that the current time reaches the end time, a notification message of group formation failure is returned to the users in the team whose number of corresponding relationships does not reach the upper limit of the number of people in the team.

[0062] Optionally, before storing the request of the user in the team into the circular buffer, the request storing module further includes:

[0063] Read the total inventory n of the resource item, determine an integer power value m of 2 that is greater than n; create a circular buffer with m data slots for the resource sharing service;

[0064] The step of storing the requests of the users in the team into a circular buffer comprises:

[0065] The user's request in the team data is stored in the data slot of the circular buffer.

[0066] Optionally, when a preset condition is met, the activity task creation module obtains at least one pending team in the circular buffer, and creates an activity task based on the pending team, including:

[0067] Determine whether there is a creation time of the activity task; if not, use the start time as the comparison time; if so, use the most recent creation time of the activity task as the comparison time;

[0068] Determine whether the number of requests stored in the circular buffer reaches a preset value within a preset time period after the comparison moment; wherein the preset value is an integer multiple of the upper limit of the number of people in the team;

[0069] If so, when the preset value is reached, all the waiting groups in the circular buffer are obtained, and respective activity tasks are created for the target users in all the waiting groups;

[0070] If not, at a time of a preset length after the comparison time, all the waiting groups in the circular buffer are obtained, and respective activity tasks are created for the target users in all the waiting groups.

[0071] Optionally, after creating an activity task based on the to-be-processed participating team, the activity task creation module is further used to:

[0072] Taking out the request of the target user in the pending group joining team from the circular buffer;

[0073] When the target user successfully executes the activity task, a notification message of successful execution is returned to the target user, and a corresponding activity task record is generated;

[0074] When the target user fails to execute the activity task, a notification message of execution failure is returned to the user.

[0075] According to another aspect of an embodiment of the present invention, there is provided an electronic device for processing a service request, comprising:

[0076] one or more processors;

[0077] a storage device for storing one or more programs,

[0078] When the one or more programs are executed by the one or more processors, the one or more processors implement the service request processing method provided by the present invention.

[0079] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the service request processing method provided by the present invention is implemented.

[0080] An embodiment of the above invention has the following advantages or beneficial effects: because it adopts a technical means of determining and generating the to-be-processed participating teams according to user requests in the team formation stage, and making timely responses, and using a circular buffer in the activity task allocation stage to batch allocate activity tasks to users according to the team as the minimum granularity, it overcomes the technical problems in the prior art of not being able to respond to user requests in a timely manner in the team formation stage and using a lock mechanism to process user requests one by one in the activity task allocation stage, resulting in low processing efficiency, thereby achieving the technical effect of timely responding to user requests to improve user experience and batch allocating activity tasks to improve overall efficiency.

[0081] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0083] Figure 1 is a schematic diagram of the main process of a service request processing method according to the first embodiment of the present invention;

[0084] Figure 2 It is a schematic diagram of the main process of a method for generating a to-be-processed group participating team in a business request processing method according to a second embodiment of the present invention;

[0085] Figure 3 is a schematic diagram of main modules of a service request processing device according to a third embodiment of the present invention;

[0086] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0087] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0088] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0089] Figure 1 FIG. 1 is a schematic diagram of the main flow of a method for processing a service request according to a first embodiment of the present invention. Figure 1 As shown, including:

[0090] Step S101, receiving a user resource sharing request, and generating a to-be-processed group-joining team according to a preset attribute value of the request;

[0091] Step S102, storing the requests of the users in the team into a circular buffer;

[0092] Step S103: when a preset condition is met, obtaining at least one pending participating team in the circular buffer, and creating an activity task based on the pending participating team, so that the pending participating team can realize resource sharing by executing the activity task.

[0093] Resource sharing services can include group shopping, group travel, group class purchase and other activities. Resource sharing services can be divided into two stages: generating a pending group (forming a team) and executing activity tasks.

[0094] The process of user participation and resource sharing can be seen as a group of users first successfully participating in the activity business according to a certain process (such as successfully forming a team), and then completing the designated activity tasks, so that resource sharing can be achieved. Among them, the activity tasks can be set according to different resource sharing businesses, such as: for group shopping business, the activity tasks can be the order payment tasks assigned to each user; for group travel business, the activity tasks can be the tasks assigned to each user to confirm travel-related matters and pay travel-related expenses; for group purchase and class business, the activity tasks can be the tasks assigned to each user to confirm course-related matters and pay course-related expenses.

[0095] In the method provided by the present invention, in the stage of generating pending participating teams (forming teams), the received user requests can be quickly processed to determine whether the user has successfully entered the pending participating team, and then feedback can be quickly given to the user based on this to improve the user experience; in the stage of executing active tasks (such as: purchasing), a circular buffer can be used to obtain at least one pending participating team in a lock-free thread-safe manner, and active tasks can be created for users in the team with the team as the minimum granularity, so that users in the team can execute and complete the active tasks in the same batch to realize resource sharing (such as: group purchase), thereby improving the overall efficiency of resource sharing business and improving user experience.

[0096] In some embodiments, before receiving a user resource sharing request, the method further includes:

[0097] Acquire resource sharing service information; convert the resource sharing service information into service parameter data; and create a service entry for the resource sharing service based on the service parameter data.

[0098] Furthermore, in some embodiments,

[0099] The service parameter data at least includes: resource sharing service identifier, start time, end time, resource item identifier, total inventory of resource items, upper limit of the number of people in the team, and upper limit of the number of teams;

[0100] Before generating a to-be-processed group-participating team according to the preset attribute value of the request, the method further includes: when it is detected that the current time reaches the start time, opening the service entrance to receive a user resource sharing request; and

[0101] When it is detected that the current time reaches the end time or it is detected that the number of teams to be processed reaches the upper limit of the number of teams, the business entrance is closed to stop receiving user resource sharing requests.

[0102] Resource sharing business (e.g., group buying business) information may be data information specified by the creator or organizer of the activity, such as: activity name, activity start and end time, target item types corresponding to the activity, inventory quantity of each item, quantity limit when purchasing items (e.g., must purchase at a certain ratio, or purchase a certain quantity limit of a certain item); number limit of people in a group, expected number of groups / total number of people participating in the activity;

[0103] Among them, the total number of participants in the activity can be set to be larger than the pre-occupied inventory of the items according to actual business needs. For example, the total number of participants in the activity can be set to be a times the pre-occupied inventory of the items, where a is a custom coefficient greater than 1, thereby increasing the possibility of all items being sold out; the total number of participants in the activity can also be set to be smaller than the pre-occupied inventory of the items according to actual business needs, thereby increasing the possibility that users who join the group team will eventually make a successful purchase.

[0104] It can be converted into business parameter data based on resource sharing business information:

[0105] You can convert the activity start and end time in the activity information into start time parameters and end time parameters; and find the corresponding activity ID according to the activity name;

[0106] The total inventory of resource items is calculated based on the target item types corresponding to the activity, the pre-occupied inventory quantity of each item, and the restrictions when purchasing items; for example, if there is only one target item, the standard pre-occupied inventory quantity parameter can be considered as the total inventory of the item; if there are multiple target items, the quotient of the pre-occupied inventory quantity of each item and the restricted quantity can be calculated based on the pre-occupied inventory quantity of each item and the restricted quantity, and the minimum value of all quotients is used as the total inventory of resource items;

[0107] The number of people in the participating team in the event information can be used as the upper limit of the number of people in the team; the final upper limit of the number of teams can be determined based on the expected number of group joining teams / the total number of people participating in the event.

[0108] Then, a business entry can be created for the group buying business according to the business parameter data, and the business entry can be used to control receiving user requests and stopping receiving user requests according to the start time and the end time, so that no user requests are received outside the activity period.

[0109] In some embodiments, the preset attribute value includes: user identification, team identification of the target team requested by the user, and target position information in the target team; the target position includes: team leader position and team member position;

[0110] The step of generating a to-be-processed participating team according to the preset attribute value of the request includes:

[0111] Generating a correspondence between the team identifier and the user identifier in a first-level cache according to the request;

[0112] Determine whether the team data of the target team exists in the secondary cache; if not, create the team data of the target team in the secondary cache based on the corresponding relationship; if yes, update the corresponding relationship to the team data of the target team; the team data includes: the corresponding relationship between the team identifier and the user identifier of the user in the team;

[0113] When the number of corresponding relationships in the target team data reaches the upper limit of the number of people in the team, the target team is used as the participating team to be processed.

[0114] There are two types of user requests: requests to become team leader and requests to join a team. On the business portal page, two pages and corresponding option buttons can be displayed to users. If the end time has not yet been reached, when it is detected that the number of pending participating teams for the group buying activity has met the upper limit of the number of teams in the business parameters, the business portal can be closed in advance to stop receiving user requests. For the two types of user requests, the process of generating pending participating teams can be:

[0115] (1) For a request to become a team leader, a new team ID is generated (the team ID can indicate the activity ID), and a piece of data is generated in the first-level cache, which includes the correspondence between the team ID and the user ID. The data is then written to the second-level cache (such as Redis). If the write is successful, the team data of the team is generated in the second-level cache: the correspondence between the team ID and the user ID. When multiple users compete for the captain position of the same team, only one data can be written successfully in the process of writing data to the second-level cache, and the rest of the data will fail to be written.

[0116] (2) For a request to join a team, a piece of data is generated in the first-level cache, which includes the correspondence between the team ID and the user ID; the data is then written to the second-level cache (such as Redis). If the writing is successful, the team data of the team is updated in the second-level cache: the correspondence between the team ID and the user ID is added to the existing team data; when multiple users compete for the last player spot in the same team, in the process of writing data into the second-level cache, only one data can be written successfully, and the rest of the data will fail to be written;

[0117] The secondary cache in the above process can use a key-value database, such as Redis. In some practical applications, a secondary cache with persistent storage can be selected to make data more difficult to lose.

[0118] When the number of corresponding relationships in the team data in the secondary cache reaches the upper limit of the number of people in the team in the business parameters, the team can be used as a team to be processed.

[0119] In some practical applications, before generating and processing the participating team, it is also possible to determine whether the same user ID already exists in the team. If so, the writing of team data can be refused and the user's request can be rejected, thereby avoiding waste of team resources or reducing the possibility of some malicious users deliberately grabbing places. It is also possible not to determine whether the same user ID already exists in the team in the above process, but in subsequent steps to limit the allocation of active tasks (such as orders) to the same user ID to reduce the possibility of some malicious users deliberately grabbing places.

[0120] In some embodiments, the service request processing method provided by the present invention further includes: before reaching the end time, further including:

[0121] When there is second team data in the secondary cache whose number of corresponding relationships does not reach the upper limit of the number of people in the team, the correspondence between the user identifier and the team identifier in the second team data is adjusted so that after the adjustment, there is at most one team whose number of corresponding relationships does not reach the upper limit of the number of people in the team.

[0122] In some embodiments, after creating or updating the team data of the target team in the secondary cache, the method further includes: returning a notification message of success or failure in joining the team to the corresponding user according to the result of whether the team data is successfully created or updated;

[0123] After the pending group joining team is generated, the method further includes: returning a notification message of successful group formation to users in the pending group joining team; and

[0124] After detecting that the current time reaches the end time, a notification message of group formation failure is returned to the users in the team whose number of corresponding relationships does not reach the upper limit of the number of people in the team.

[0125] A second preset duration can be set according to actual conditions. When there is still the second preset duration before the end of the activity, it is detected whether there are multiple teams with insufficient numbers. If so, the corresponding relationship between the user identifier and the team identifier in the data of the teams with insufficient numbers can be directly adjusted; or a notification of "whether you agree that the system will re-form a team for you" can be sent to the user first, and after the user confirms, the team is re-formed, that is, the corresponding relationship between the user identifier and the team identifier in the data of the teams with insufficient numbers is adjusted; so that as many users as possible can enter the team to be processed;

[0126] Through the above process, from the user's perspective, they can be informed in a timely manner whether they can successfully join the team, avoiding waiting; and for users whose team is not full, the system can provide an opportunity to regroup, improving the user experience.

[0127] Figure 2 FIG. 1 is a schematic diagram of the main flow of a method for generating a to-be-processed group participating team in a business request processing method according to a second embodiment of the present invention. Figure 2 As shown, including:

[0128] Step S201, receiving a user's team formation request;

[0129] Step S202, determining whether the target bit corresponding to the request still exists in the team data in the secondary cache; wherein the target bit includes: captain bit and player bit; if so, executing step S203; if not, executing step S204;

[0130] Step S203, determine whether the user flag in the request has a record of successfully participating in team formation, if yes, execute step S204, if no, execute step S205;

[0131] Step S204: confirming the failure of team formation and feeding back a message of the failure of team formation to the user;

[0132] Step S205: confirm that the team formation is successful, write the corresponding relationship between the user ID and the team ID into the secondary cache (such as Redis), feedback the team formation failure message to the user; and update the user's participation record.

[0133] In some embodiments, before storing the requests of the users in the team into the circular buffer, the method further comprises:

[0134] Read the total inventory n of the resource item, determine an integer power value m of 2 that is greater than n; create a circular buffer with m data slots for the resource sharing service;

[0135] The step of storing the requests of the users in the team into a circular buffer comprises:

[0136] The user's request in the team data is stored in the data slot of the circular buffer.

[0137] In practical applications, setting the number of data slots in the circular buffer to an integer power of 2 can be more conducive to binary-based computer calculations and processing; setting the number of data slots in the circular buffer to be larger than the total inventory n of the items can ensure that there are enough data slots to receive user requests in the waiting group when a large number of user requests are received in a short period of time and a large number of waiting group members are produced, so that the subsequent steps of allocating activity tasks (such as orders) can be carried out as soon as possible to avoid affecting the overall efficiency.

[0138] In some embodiments, when a preset condition is met, obtaining at least one pending participating team in the circular buffer, and creating an activity task (such as an order) based on the pending participating team, includes:

[0139] Determine whether there is a time to create an activity task (such as an order); if not, use the start time as the comparison time; if so, use the most recent time to create an activity task as the comparison time;

[0140] Determine whether the number of requests stored in the circular buffer reaches a preset value within a preset time period after the comparison moment; wherein the preset value is an integer multiple of the upper limit of the number of people in the team;

[0141] If so, when the preset value is reached, all the waiting groups in the circular buffer are obtained, and respective activity tasks are created for the target users in all the waiting groups;

[0142] If not, at a time of a preset length after the comparison time, all the waiting groups in the circular buffer are obtained, and respective activity tasks are created for the target users in all the waiting groups.

[0143] The preset value may be a value that can be flexibly adjusted according to the actual software and hardware conditions; the preset duration may also be a value that can be flexibly adjusted according to the actual group buying activity situation;

[0144] The use of a circular buffer can achieve lock-free thread safety. Compared with the processing method of using a lock mechanism to process user requests one by one in the prior art, the present invention can process user requests in batches and assign active tasks (such as orders) to users in batches, which is more efficient. In the present invention, processing can be performed with the team as the minimum granularity, ensuring that users in the same team can be assigned to active tasks (such as orders) in the same batch, ensuring a certain degree of fairness, and providing a better user experience.

[0145] In some embodiments, after creating an activity task (such as an order) based on the pending participating team, the process further includes:

[0146] Taking out the request of the target user in the pending group joining team from the circular buffer;

[0147] When the target user successfully executes the activity task, a notification message of successful execution is returned to the target user, and a corresponding activity task record is generated; for example, for an order task, when the user completes the purchase according to the order, the user can be considered to have successfully executed the task, and a corresponding order record can be generated;

[0148] When the target user fails to execute the activity task, a notification message of execution failure is returned to the user.

[0149] In some practical applications, for users who fail to perform active tasks, the user's request can be put back into the circular buffer and a failure threshold can be set; when the number of failures in the user's active task reaches the failure threshold, the user's request is abandoned and a notification message of execution failure is returned to the user.

[0150] Figure 3 is a schematic diagram of main modules of a service request processing device according to a third embodiment of the present invention; Figure 3 As shown, the service request processing device 300 includes:

[0151] The team generation module 301 is used to receive a user resource sharing request and generate a to-be-processed group-sharing team according to a preset attribute value of the request;

[0152] A request storage module 302, used to store the requests of the users in the team into a circular buffer;

[0153] The activity task creation module 303 is used to obtain at least one pending team in the circular buffer when a preset condition is met, and create an activity task based on the pending team, so that the pending team can achieve resource sharing by executing the activity task.

[0154] Resource sharing services can include group shopping, group travel, group class purchase and other activities. Resource sharing services can be divided into two stages: generating a pending group (forming a team) and executing activity tasks.

[0155] The process of user participation and resource sharing can be seen as a group of users first successfully participating in the activity business according to a certain process (such as successfully forming a team), and then completing the designated activity tasks, so that resource sharing can be achieved. Among them, activity tasks can be set according to different resource sharing businesses, such as: for group shopping business, activity tasks can be order tasks assigned to each user; for group travel business, activity tasks can be tasks assigned to each user to confirm travel-related matters and pay travel-related expenses; for group purchase and class business, activity tasks can be tasks assigned to each user to confirm course-related matters and pay course-related expenses.

[0156] In the method provided by the present invention, in the stage of generating pending participating teams (forming teams), the received user requests can be quickly processed to determine whether the user has successfully entered the pending participating team, and then feedback can be quickly given to the user based on this to improve the user experience; in the stage of executing active tasks (such as: purchasing), a circular buffer can be used to obtain at least one pending participating team in a lock-free thread-safe manner, and active tasks can be created for users in the team with the team as the minimum granularity, so that users in the team can execute and complete the active tasks in the same batch to realize resource sharing (such as: group purchase), thereby improving the overall efficiency of resource sharing business and improving user experience.

[0157] In some embodiments, the team generation module, before receiving the user resource sharing request, further includes:

[0158] Obtain resource sharing business information;

[0159] Converting the resource sharing service information into service parameter data;

[0160] A service entry is created for the resource sharing service based on the service parameter data.

[0161] Furthermore, in some embodiments,

[0162] The service parameter data at least includes: resource sharing service identifier, start time, end time, resource item identifier, total inventory of resource items, upper limit of the number of people in the team, and upper limit of the number of teams;

[0163] Before the team generation module generates the pending participating teams according to the preset attribute values ​​of the request, it also includes: when it is detected that the current time reaches the starting time, opening the service entrance to receive user resource sharing requests; and when it is detected that the current time reaches the ending time or it is detected that the number of the pending participating teams generated reaches the upper limit of the number of teams, closing the service entrance to stop receiving user resource sharing requests.

[0164] Resource sharing business (e.g., group buying business) information may be data information specified by the creator or organizer of the activity, such as: activity name, activity start and end time, target item types corresponding to the activity, inventory quantity of each item, quantity limit when purchasing items (e.g., must purchase at a certain ratio, or purchase a certain quantity limit of a certain item); number limit of people in a group, expected number of groups / total number of people participating in the activity;

[0165] Among them, the total number of participants in the activity can be set to be larger than the pre-occupied inventory of the items according to actual business needs. For example, the total number of participants in the activity can be set to be a times the pre-occupied inventory of the items, where a is a custom coefficient greater than 1, thereby increasing the possibility of all items being sold out; the total number of participants in the activity can also be set to be smaller than the pre-occupied inventory of the items according to actual business needs, thereby increasing the possibility that users who join the group team will eventually make a successful purchase.

[0166] It can be converted into business parameter data based on group buying business information:

[0167] You can convert the activity start and end time in the activity information into start time parameters and end time parameters; and find the corresponding activity ID according to the activity name;

[0168] The total inventory of resource items is calculated based on the target item types corresponding to the activity, the pre-occupied inventory quantity of each item, and the restrictions when purchasing items; for example, if there is only one target item, the standard pre-occupied inventory quantity parameter can be considered as the total inventory of the item; if there are multiple target items, the quotient of the pre-occupied inventory quantity of each item and the restricted quantity can be calculated based on the pre-occupied inventory quantity of each item and the restricted quantity, and the minimum value of all quotients is used as the total inventory of resource items;

[0169] The number of people in the participating team in the event information can be used as the upper limit of the number of people in the team; the final upper limit of the number of teams can be determined based on the expected number of group joining teams / the total number of people participating in the event.

[0170] Then, a business entry can be created for the group buying business according to the business parameter data, and the business entry can be used to control receiving user requests and stopping receiving user requests according to the start time and the end time, so that no user requests are received outside the activity period.

[0171] In some embodiments, the preset attribute value includes: user identification, team identification of the target team requested by the user, and target position information in the target team; the target position includes: team leader position and team member position;

[0172] The team generation module generates a to-be-processed group participation team according to the preset attribute value of the request, including:

[0173] Generating a correspondence between the team identifier and the user identifier in a first-level cache according to the request;

[0174] Determine whether the team data of the target team exists in the secondary cache; if not, create the team data of the target team in the secondary cache based on the corresponding relationship; if yes, update the corresponding relationship to the team data of the target team; the team data includes: the corresponding relationship between the team identifier and the user identifier of the user in the team;

[0175] When the number of corresponding relationships in the target team data reaches the upper limit of the number of people in the team, the target team is used as the participating team to be processed.

[0176] There are two types of user requests: requests to become team leader and requests to join a team. On the business portal page, two pages and corresponding option buttons can be displayed to users. If the end time has not yet been reached, when it is detected that the number of pending participating teams for the group buying activity has met the upper limit of the number of teams in the business parameters, the business portal can be closed in advance to stop receiving user requests. For the two types of user requests, the process of generating pending participating teams can be:

[0177] (1) For a request to become a team leader, a new team ID is generated (the team ID can indicate the activity ID), and a piece of data is generated in the first-level cache, which includes the correspondence between the team ID and the user ID. The data is then written to the second-level cache (such as Redis). If the write is successful, the team data of the team is generated in the second-level cache: the correspondence between the team ID and the user ID. When multiple users compete for the captain position of the same team, only one data can be written successfully in the process of writing data to the second-level cache, and the rest of the data will fail to be written.

[0178] (2) For a request to join a team, a piece of data is generated in the first-level cache, which includes the correspondence between the team ID and the user ID; the data is then written to the second-level cache (such as Redis). If the writing is successful, the team data of the team is updated in the second-level cache: the correspondence between the team ID and the user ID is added to the existing team data; when multiple users compete for the last player spot in the same team, in the process of writing data into the second-level cache, only one data can be written successfully, and the rest of the data will fail to be written;

[0179] The secondary cache in the above process can use a key-value database, such as Redis. In some practical applications, a secondary cache with persistent storage can be selected to make data more difficult to lose.

[0180] When the number of corresponding relationships in the team data in the secondary cache reaches the upper limit of the number of people in the team in the business parameters, the team can be used as a team to be processed.

[0181] In some practical applications, before generating and processing the participating team, it is also possible to determine whether the same user ID already exists in the team. If so, the writing of team data can be refused, and the user's request can be rejected, thereby avoiding waste of team resources or reducing the possibility of some malicious users deliberately grabbing places. It is also possible not to determine whether the same user ID already exists in the team in the above process, but in subsequent steps to limit the allocation of orders for the same user ID to reduce the possibility of some malicious users deliberately grabbing places.

[0182] In some embodiments, the team generation module is further used to: before reaching the end time, further include:

[0183] When there is second team data in the secondary cache whose number of corresponding relationships does not reach the upper limit of the number of people in the team, the correspondence between the user identifier and the team identifier in the second team data is adjusted so that after the adjustment, there is at most one team whose number of corresponding relationships does not reach the upper limit of the number of people in the team.

[0184] In some embodiments, after creating or updating the team data of the target team in the secondary cache, the team generating module is further used to: return a notification message of success or failure to join the team to the corresponding user according to the result of whether the team data is successfully created or updated;

[0185] After the pending group joining team is generated, the method further includes: returning a notification message of successful group formation to users in the pending group joining team; and

[0186] After detecting that the current time reaches the end time, a notification message of group formation failure is returned to the users in the team whose number of corresponding relationships does not reach the upper limit of the number of people in the team.

[0187] A second preset duration can be set according to actual conditions. When there is still the second preset duration before the end of the activity, it is detected whether there are multiple teams with insufficient numbers. If so, the corresponding relationship between the user identifier and the team identifier in the data of the teams with insufficient numbers can be directly adjusted; or a notification of "whether you agree that the system will re-form a team for you" can be sent to the user first, and after the user confirms, the team is re-formed, that is, the corresponding relationship between the user identifier and the team identifier in the data of the teams with insufficient numbers is adjusted; so that as many users as possible can enter the team to be processed;

[0188] Through the above process, from the user's perspective, they can be informed in a timely manner whether they can successfully join the team, avoiding waiting; and for users whose team is not full, the system can provide an opportunity to regroup, improving the user experience.

[0189] In some embodiments, before storing the request of the user in the team into the circular buffer, the request storage module further includes:

[0190] Read the total inventory n of the resource item, determine an integer power value m of 2 that is greater than n; create a circular buffer with m data slots for the resource sharing service;

[0191] The step of storing the requests of the users in the team into a circular buffer comprises:

[0192] The user's request in the team data is stored in the data slot of the circular buffer.

[0193] In practical applications, setting the number of data slots in the circular buffer to an integer power of 2 can be more conducive to binary-based computer calculations and processing; setting the number of data slots in the circular buffer to be larger than the total inventory n of the items can ensure that there are enough data slots to receive user requests in the waiting group when a large number of user requests are received in a short period of time and a large number of waiting group members are produced, so that the subsequent order allocation steps can be carried out as soon as possible to avoid affecting the overall efficiency.

[0194] In some embodiments, when a preset condition is met, the activity task creation module obtains at least one pending group member team in the circular buffer, and creates an activity task (such as an order) based on the pending group member team, including:

[0195] Determine whether there is a creation time of the activity task; if not, use the start time as the comparison time; if so, use the most recent creation time of the activity task as the comparison time;

[0196] Determine whether the number of requests stored in the circular buffer reaches a preset value within a preset time period after the comparison moment; wherein the preset value is an integer multiple of the upper limit of the number of people in the team;

[0197] If so, when the preset value is reached, all the waiting groups in the circular buffer are obtained, and respective activity tasks are created for the target users in all the waiting groups;

[0198] If not, at a time of a preset length after the comparison time, all the waiting groups in the circular buffer are obtained, and respective activity tasks are created for the target users in all the waiting groups.

[0199] The preset value may be a value that can be flexibly adjusted according to the actual software and hardware conditions; the preset duration may also be a value that can be flexibly adjusted according to the actual group buying activity situation;

[0200] The use of a circular buffer can achieve lock-free thread safety. Compared with the prior art method of using a lock mechanism to process user requests one by one, the present invention can process user requests in batches and assign active tasks (such as orders) to users in batches, which is more efficient. In the present invention, processing can be performed with the team as the minimum granularity, ensuring that users in the same team can be assigned to active tasks (such as orders) in the same batch, ensuring a certain degree of fairness and providing a better user experience.

[0201] In some embodiments, after creating an activity task (such as an order) based on the pending participating team, the activity task creation module is further used to:

[0202] Taking out the request of the target user in the pending group joining team from the circular buffer;

[0203] When the target user successfully executes the activity task, a notification message of successful execution is returned to the target user, and a corresponding activity task record is generated; for example, for an order task, when the user completes the purchase according to the order, the user can be considered to have successfully executed the task, and a corresponding order record can be generated;

[0204] When the target user fails to execute the order task, a notification message of execution failure is returned to the user.

[0205] In some practical applications, for users who fail to perform active tasks, the user's request can be put back into the circular buffer and a failure threshold can be set; when the number of failures in the user's active task reaches the failure threshold, the user's request is abandoned and a notification message of execution failure is returned to the user.

[0206] Figure 4 An exemplary system architecture 400 is shown to which the service request processing method or service request processing apparatus according to the embodiment of the present invention can be applied.

[0207] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0208] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 401, 402, 403, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0209] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0210] Server 405 may be a server that provides various services, such as a backend management server that provides support for shopping websites browsed by users using terminal devices 401, 402, and 403. The backend management server may analyze and process received data such as product information query requests, and feed back the processing results to the terminal device.

[0211] It should be noted that the service request processing method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the service request processing device is generally disposed in the server 405 .

[0212] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0213] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0214] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0215] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0216] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0217] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0218] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0219] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, it may be described as: a processor includes a team generation module, a request storage module, and an activity task creation module. The names of these modules do not constitute a limitation on the modules themselves in some cases. For example, the team generation module may also be described as "a module that receives user requests sent by the connected server and generates a team based on the user requests."

[0220] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs. When the above one or more programs are executed by a device, the device includes: step S101, receiving a user's request for resource sharing, and generating a team to be processed according to the preset attribute value of the request; step S102, storing the request of the user in the team into a circular buffer; step S103, when the preset conditions are met, obtaining at least one team to be processed in the circular buffer, and creating an activity task based on the team to be processed, so that the team to be processed can achieve resource sharing by executing the activity task.

[0221] According to the technical solution of the embodiments of the present invention, because it adopts a technical means of determining and generating the to-be-processed team according to the user request in the team formation stage, and making a timely response, and using a circular buffer in the order allocation stage to allocate orders to users in batches according to the team as the minimum granularity, it overcomes the technical problems of low processing efficiency caused by the failure to respond to user requests in time in the team formation stage and the use of a lock mechanism to process user requests one by one in the order allocation stage in the prior art, thereby achieving the technical effect of responding to user requests in time to improve user experience, and allocating orders in batches to improve overall efficiency.

[0222] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for processing a business request, characterized in that: include: Receive a user resource sharing request, and generate a to-be-processed team according to a preset attribute value of the request, wherein the number of corresponding relationships in the to-be-processed team reaches a preset upper limit of the number of people in the team, and the corresponding relationship is a corresponding relationship between a team identifier and a user identifier of a user in the team; Storing requests of users in the team in a circular buffer; When a preset condition is met, at least one to-be-processed participating team in the circular buffer is obtained, and an activity task is created based on the to-be-processed participating team, so that the to-be-processed participating team can realize resource sharing by executing the activity task; When the preset condition is met, at least one to-be-processed participating team in the circular buffer is obtained, and an activity task is created based on the to-be-processed participating team, including: Determine whether there is a creation time of the activity task; if not, use the start time as the comparison time; if it exists, use the most recent creation time of the activity task as the comparison time; the start time is the start time of the resource sharing activity; Determine whether the number of requests stored in the circular buffer reaches a preset value within a preset time period after the comparison moment; wherein the preset value is an integer multiple of the upper limit of the number of people in the team; If so, when the preset value is reached, all the waiting groups in the circular buffer are obtained, and respective activity tasks are created for the target users in all the waiting groups; If not, at a time of a preset length after the comparison time, all the waiting groups in the circular buffer are obtained, and respective activity tasks are created for the target users in all the waiting groups.

2. The method according to claim 1, characterized in that Before receiving the user resource sharing request, the method further includes: Obtain resource sharing business information; Converting the resource sharing service information into service parameter data; A service entry is created for the resource sharing service based on the service parameter data.

3. The method according to claim 2, characterized in that The service parameter data at least includes: resource sharing service identifier, start time, end time, resource item identifier, total inventory of resource items, upper limit of the number of people in the team, and upper limit of the number of teams; Before generating a to-be-processed group-participating team according to the preset attribute value of the request, the method further includes: when it is detected that the current time reaches the start time, opening the service entrance to receive a user resource sharing request; and When it is detected that the current time reaches the end time or it is detected that the number of teams to be processed reaches the upper limit of the number of teams, the business entrance is closed to stop receiving user resource sharing requests.

4. The method according to claim 3, characterized in that: The preset attribute values ​​include: user identification, team identification of the target team requested by the user, and target position information in the target team; the target position includes: team leader position and team member position; The step of generating a to-be-processed participating team according to the preset attribute value of the request includes: Generating a correspondence between the team identifier and the user identifier in a first-level cache according to the request; Determine whether the team data of the target team exists in the secondary cache; if not, create the team data of the target team in the secondary cache based on the corresponding relationship; if yes, update the corresponding relationship to the team data of the target team; the team data includes: the corresponding relationship between the team identifier and the user identifier of the user in the team; When the number of corresponding relationships in the target team data reaches the upper limit of the number of people in the team, the target team is used as the participating team to be processed.

5. The method according to claim 4, characterized in that Also includes: Before reaching the end time, it also includes: When there is second team data in the secondary cache whose number of corresponding relationships does not reach the upper limit of the number of people in the team, the correspondence between the user identifier and the team identifier in the second team data is adjusted so that after the adjustment, there is at most one team whose number of corresponding relationships does not reach the upper limit of the number of people in the team.

6. The method according to claim 4, characterized in that After the team data of the target team is created or updated in the secondary cache, the method further includes: returning a notification message of success or failure in joining the team to the corresponding user according to the result of whether the team data is successfully created or updated; After the pending group joining team is generated, the method further includes: returning a notification message of successful group formation to users in the pending group joining team; and After detecting that the current time reaches the end time, a notification message of group formation failure is returned to the users in the team whose number of corresponding relationships does not reach the upper limit of the number of people in the team.

7. The method according to claim 3, characterized in that Before storing the requests of the users in the team into the circular buffer, the method further comprises: Read the total inventory n of the resource item, determine an integer power value m of 2 that is greater than n; create a circular buffer with m data slots for the resource sharing service; The step of storing the requests of the users in the team into a circular buffer comprises: The user's request in the team data is stored in the data slot of the circular buffer.

8. The method according to claim 1, characterized in that After creating the activity task based on the pending participating team, it also includes: Taking out the request of the target user in the pending group joining team from the circular buffer; When the target user successfully executes the activity task, a notification message of successful execution is returned to the target user, and a corresponding activity task record is generated; When the target user fails to execute the activity task, a notification message of execution failure is returned to the user.

9. A service request processing device, characterized in that: include: A team generation module is used to receive a user resource sharing request, and generate a pending team according to a preset attribute value of the request, wherein the number of corresponding relationships in the pending team reaches a preset upper limit of the number of people in the team, and the corresponding relationship is a corresponding relationship between a team identifier and a user identifier of a user in the team; A request storage module, used for storing requests of users in the team into a circular buffer; An activity task creation module is used to obtain at least one pending participating team in the circular buffer when a preset condition is met, and create an activity task based on the pending participating team, so that the pending participating team can realize resource sharing by executing the activity task; When the preset conditions are met, the activity task creation module obtains at least one pending team in the circular buffer, and creates an activity task based on the pending team, including: Determine whether there is a creation time of the activity task; if not, use the start time as the comparison time; if it exists, use the most recent creation time of the activity task as the comparison time; the start time is the start time of the resource sharing activity; Determine whether the number of requests stored in the circular buffer reaches a preset value within a preset time period after the comparison moment; wherein the preset value is an integer multiple of the upper limit of the number of people in the team; If so, when the preset value is reached, all the teams to be processed in the circular buffer are obtained, and respective activity tasks are created for the target users in all the teams to be processed; if not, when the preset time period is reached after the comparison moment, all the teams to be processed in the circular buffer are obtained, and respective activity tasks are created for the target users in all the teams to be processed.

10. An electronic device for processing a business request, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.

11. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Intelligent group combining matching system and group combining matching method thereof

    CN106204248A