A business processing system, method, device, equipment and medium
By introducing a packet identification management mechanism in the service processing system, user identification is divided into different packets, and the user identification of these packets is distributed to multiple second devices, the problems of push reminder service efficiency and stability are solved, and efficient parallel processing and load balancing are achieved.
Patent Information
- Application Number
- CN202111413056.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2041-11-25
AI Technical Summary
The prior art is difficult to effectively improve the efficiency and stability of push reminder services, especially when the number of users surges, resulting in a decline in service efficiency and impact on stability.
By introducing a packet identification management mechanism in the service processing system, the first device assigns a packet identification to the user identification according to the preset packet value and divides the user identification into different packets. Then, the user IDs of different packets are dispersed onto a plurality of second devices, causing the plurality of second devices to provide services in parallel.
The parallel processing of multiple second devices is achieved, and the efficiency of providing services to different users in the same location is improved, the load of the second device is reduced, the impact of the difference in user identification number on the load is avoided, and the stability of the service is improved.
Smart Images

Figure CN114116218B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of big data processing technology, and in particular to a business processing system, method, device, equipment and medium. Background Art
[0002] With the rapid development of mobile communication technology, there are more and more types of applications, and each application can provide more and more services. Among them, many applications provide push reminder services, such as live broadcast reminder notifications, user prayer reminders, commodity rush reminders, etc. Due to the sharp increase in the number of users using the Internet in recent years, more and more users use the push reminder service on the application, resulting in higher and higher requirements for the efficiency and stability of the push reminder service provided by the application. Therefore, how to improve the efficiency and stability of the push reminder service is a technical problem that needs to be solved urgently. Summary of the invention
[0003] Embodiments of the present invention provide a business processing system, method, apparatus, device and medium for improving the efficiency and stability of push reminder services.
[0004] An embodiment of the present invention provides a service processing system, the system comprising: a first device, at least two second devices;
[0005] The first device is used to obtain a first message, the first message is used to indicate a request for providing a service; the first message includes a user identifier; and determine a time corresponding to the user identifier and a group identifier to which the user identifier belongs, the time representing a time when the service is provided to a user of the user identifier, the group identifier is determined according to a preset group value, and the preset group value is a positive integer greater than or equal to 2; determine each group identifier corresponding to the time according to the time and the group identifiers to which each user identifier corresponding to the time belongs;
[0006] The at least two second devices are used to obtain at least one group identifier corresponding to the time; based on the user identifier contained in the at least one group identifier, a second message is sent, and the second message is used to provide the service; wherein the at least one group identifier obtained by different second devices is different.
[0007] An embodiment of the present invention provides a service processing method, which is applied to a first device and includes:
[0008] Acquire a first message, where the first message is used to indicate a request for providing a service; the first message includes a user identifier;
[0009] And determine the time corresponding to the user identifier and the group identifier to which the user identifier belongs. The time represents the time when the service is provided to the user corresponding to the user identifier, and the group identifier is determined according to a preset group value, where the preset group value is a positive integer greater than or equal to 2;
[0010] According to the time and the group identifiers to which the respective user identifiers corresponding to the time belong, determine the respective group identifiers corresponding to the time, so that at least two second devices obtain at least one group identifier corresponding to the time; based on the user identifiers included in the at least one group identifier, send a second message, where the second message is used to provide the service; where the at least one group identifier obtained by different second devices is different.
[0011] An embodiment of the present invention provides a service processing method, which is applied to a second device, and the method includes:
[0012] Obtain at least one group identifier corresponding to a target time from a first device; where the at least one group identifier is determined according to a preset group value, and the preset group value is a positive integer greater than or equal to 2;
[0013] Based on the user identifiers included in the at least one group identifier, send a second message, where the second message is used to provide the service; where the at least one group identifier obtained by different second devices is different.
[0014] An embodiment of the present invention provides a service processing device, which is applied to a first device, and the device includes:
[0015] An acquisition unit, configured to acquire a first message, where the first message is used to indicate a request to provide a service; the first message includes a user identifier;
[0016] A first processing unit, configured to determine the time corresponding to the user identifier and the group identifier to which the user identifier belongs. The time represents the time when the service is provided to the user corresponding to the user identifier, and the group identifier is determined according to a preset group value, where the preset group value is a positive integer greater than or equal to 2;
[0017] A second processing unit, configured to determine the respective group identifiers corresponding to the time according to the time and the group identifiers to which the respective user identifiers corresponding to the time belong, so that at least two second devices obtain at least one group identifier corresponding to the time; based on the user identifiers included in the at least one group identifier, send a second message, where the second message is used to provide the service; where the at least one group identifier obtained by different second devices is different.
[0018] An embodiment of the present invention provides a service processing device, which is applied to a second device. The device includes:
[0019] An acquisition module, configured to acquire at least one packet identifier corresponding to a target time from a first device; wherein, the at least one packet identifier is determined according to a preset packet value, and the preset packet value is a positive integer greater than or equal to 2;
[0020] A processing module, configured to send a second message based on the user identifiers included in the at least one packet identifier, where the second message is used to provide the service; wherein, the at least one packet identifier obtained by different second devices is different.
[0021] An embodiment of the present invention provides an electronic device, which includes a processor. When the processor executes a computer program stored in a memory, it implements the steps of the service processing method applied to the first device as described above, or implements the steps of the service processing method applied to the second device as described above.
[0022] An embodiment of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of the service processing method applied to the first device as described above, or implements the steps of the service processing method applied to the second device as described above.
[0023] Since the first device can assign packet identifiers to the acquired user identifiers according to a preset packet value, and divide the acquired user identifiers into different groups according to the packet identifiers, so as to realize dividing different user identifiers corresponding to the same location information into different groups, that is, dividing different users at the same location into different groups. Subsequently, the user identifiers of different groups are distributed to multiple second devices, and the multiple second devices can parallelly send second messages based on the user identifiers included in the at least one acquired packet, so as to realize providing services for different users at the same location through multiple second devices in parallel, and improve the efficiency of providing services for different users at the same location. Since each second device only processes the received user identifiers, and the packet identifiers obtained by different second devices are different, it is realized that multiple second devices all provide services for different users at the same location, and any second device only provides services for some users at this location, reducing the load of this second device, avoiding the influence of the quantity difference of user identifiers at different locations on the load of the second device, and also avoiding the computing power consumed and network resources wasted in the process of the second device determining the user identifiers to be served after acquiring all the user identifiers to be served at this time, reducing the computing power requirement for the second device, and being beneficial to improving the stability of providing services for users at the same location at a certain time. Description of the Drawings
[0024] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other accompanying drawings can be obtained based on these drawings without creative efforts.
[0025] Figure 1 Structural schematic diagram of a service processing system provided by an embodiment of the present invention;
[0026] Figure 2 Interface schematic diagram provided by an embodiment of the present invention;
[0027] Figure 3 Interface schematic diagram provided by an embodiment of the present invention;
[0028] Figure 4 Scene schematic diagram of a prayer reminder provided by an embodiment of the present invention;
[0029] Figure 5 Scene schematic diagram of a service processing flow provided by an embodiment of the present invention;
[0030] Figure 6 Scene schematic diagram of sending a second message provided by an embodiment of the present invention;
[0031] Figure 7 Display interface schematic diagram of a prayer reminder provided by an embodiment of the present invention;
[0032] Figure 8 Schematic diagram of a service processing process provided by an embodiment of the present invention;
[0033] Figure 9 Another schematic diagram of a service processing process provided by an embodiment of the present invention;
[0034] Figure 10 Structural schematic diagram of a service processing device provided by an embodiment of the present invention;
[0035] Figure 11 Another structural schematic diagram of a service processing device provided by an embodiment of the present invention;
[0036] Figure 12 Structural schematic diagram of an electronic device provided by an embodiment of the present invention;
[0037] Figure 13 Another structural schematic diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0038] The present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0039] Those skilled in the art know that the implementation manner of the present invention can be realized as a system, a device, an equipment, a method or a computer program product. Therefore, the present invention can be specifically realized in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0040] In this article, it should be understood that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction and does not have any limiting meaning.
[0041] For the convenience of understanding, some concepts involved in the embodiments of the present invention are explained below:
[0042] Distributed timed task: A timed task that sends scattered (such as at different times, different locations, etc.) and unreliable executable scheduled tasks to a unified device to manage, schedule, and distribute all scheduled tasks through this device.
[0043] Codis: A distributed Redis solution. For upper-layer applications, there is no obvious difference between connecting to Codis Proxy and connecting to a native Redis Server. Upper-layer applications can use it just like using a stand-alone Redis. Codis will handle tasks such as request forwarding and data migration at the bottom layer.
[0044] In a possible application scenario, taking the provided service as a push reminder service as an example, when it is necessary to provide a push reminder service to different users in different cities at a certain time point, such as pushing to all users in multiple cities at a certain time, it is necessary to filter out the user identifiers of all users who need to use this push reminder service at this time point from all users, and then send reminder messages based on these user identifiers to provide services for these users. Since the sent reminder messages generally have timeliness, it is required to send the reminder messages to the smart devices of users who need to receive the push reminder service within a certain time range. For example, taking the service as a daily prayer reminder as an example, when sending reminder messages based on the user identifiers of users requesting this service each time, it is necessary to start sending reminder messages 15 minutes before each user's prayer and complete sending reminder messages based on all user identifiers requesting this service 5 minutes before each user's prayer.
[0045] Currently, a push reminder service can be provided by means of multi-point distributed timed push. Specifically, a message requesting the push reminder service (denoted as the request message) is pre-sent to a unified device (denoted as the first device). Among them, the request message will contain a user identifier and location information. After receiving the request message, the first device parses the request message to obtain the user identifier and location information. Determine the time corresponding to the user identifier. For each time corresponding to each saved user identifier, according to the respective user identifiers corresponding to the time and the location information corresponding to each user identifier, all scheduled tasks for that time are established. Any scheduled task includes a user identifier corresponding to that time and the location information corresponding to the user identifier. When an electronic device (denoted as the second device) that needs to provide a push reminder service provides a push reminder service at a certain time, the first device sends sharding parameters to each second device. The sharding parameters include the total number of second devices and the device serial number corresponding to the second device that receives the sharding parameters. For each second device, after receiving the sharding parameters, the second device obtains all the scheduled tasks corresponding to that time from the first device, and then takes the modulus of the location information included in the obtained scheduled tasks according to the total number. The scheduled tasks with the same modulus result as the device serial number of the second device are determined as the scheduled tasks that the second device needs to execute. Based on the user identifier included in the scheduled tasks that the second device needs to execute, a reminder message is sent. For this method, only the scheduled tasks with different location information can be distributed to different second devices for execution, and all the scheduled tasks with the same location information can only be executed by the same second device, resulting in the computing power of the second device affecting the efficiency of executing the scheduled tasks for a certain location information, that is, reducing the efficiency of providing a push reminder service for users at a certain location. Moreover, the difference in the number of scheduled tasks with different location information will affect the load of the second device, resulting in some second devices having an excessive load and some second devices having a relatively small load. The second device with an excessive load takes a longer time to provide a push reminder service, resulting in the possibility that the second device may not be able to execute all the scheduled tasks within a certain time range, reducing the stability of the push reminder service. In addition, each second device needs to obtain all the scheduled tasks corresponding to that time from the first device and then screen out the scheduled tasks that it needs to execute from all the scheduled tasks. This process requires a large amount of computing power and time of the second device, reducing the efficiency of the push reminder service.
[0046] To solve the above problems, embodiments of the present invention provide a service processing system, method, device, equipment, and medium. Since the first device can assign a group identifier to the obtained user identifier according to a preset grouping value, and divide the obtained user identifiers into different groups according to the group identifier, so as to realize dividing different user identifiers corresponding to the same location information into different groups, that is, dividing different users at the same location into different groups. Subsequently, the user identifiers of different groups are distributed to multiple second devices, and the multiple second devices can concurrently send second messages based on the user identifiers included in at least one obtained group, thereby realizing providing services for different users at the same location through multiple second devices in parallel, and improving the efficiency of providing services for different users at the same location. Since each second device only processes the received user identifiers, and the group identifiers obtained by different second devices are different, it is realized that multiple second devices all provide services for different users at the same location, and any second device only provides services for some users at this location, reducing the load of this second device, avoiding the influence of the quantity difference of user identifiers at different locations on the load of the second device, and also avoiding the computing power consumption and wasted network resources in the process of the second device determining the user identifiers to be served after obtaining all the user identifiers to be served at this time, reducing the computing power requirement for the second device, and being beneficial to improving the stability of providing services for users at the same location at a certain time.
[0047] It should be noted that the application scenarios cited in the above embodiments are only for conveniently illustrating the proposed exemplary scenarios, and are not a limitation on the application scenarios of a service processing system, method, device, equipment, and medium provided by embodiments of the present invention. Those skilled in the art should know that a service processing system, method, device, equipment, and medium provided by embodiments of the present invention can be applied to all application scenarios that require data push, such as, for example, application upgrade, limited-time flash sale of goods, etc.
[0048] Embodiment 1:
[0049] Figure 1 FIG. is a schematic structural diagram of a service processing system provided by an embodiment of the present invention. The system includes: a first device 11, at least two second devices 12;
[0050] The first device 11 is configured to obtain a first message for indicating a request to provide a service. The first message includes a user identifier, and determine the time corresponding to the user identifier and the group identifier to which the user identifier belongs. The time represents the time for providing the service to the user corresponding to the user identifier, and the group identifier is determined according to a preset grouping value which is a positive integer greater than or equal to 2. According to the time and the group identifiers to which the respective user identifiers corresponding to the time belong, determine the respective group identifiers corresponding to the time.
[0051] The at least two second devices 12 are configured to obtain at least one group identifier corresponding to the time, and send a second message for providing the service based on the user identifiers included in the at least one group identifier. Different second devices 12 obtain different at least one group identifier.
[0052] In an embodiment of the present invention, the service processing system includes a first device 11 for managing user identifiers requesting to provide a service, and a plurality of second devices 12 for providing the service.
[0053] Wherein, the first device 11 and the second device 12 are both electronic devices, and the electronic device can be an intelligent device such as a mobile terminal or a computer, or a server, etc.
[0054] When a user hopes that a certain application installed on an intelligent device can provide a certain service, the user can input a request operation to the intelligent device. The service can be a service such as a reminder for starting a group purchase of goods or a prayer reminder. After receiving the request operation, the intelligent device obtains the user identifier, generates a message (denoted as the first message) for requesting to provide the service according to the user identifier, and sends the first message to the first device 11.
[0055] Wherein, the user identifier is used to identify the user who needs to receive the service. The user identifier can be represented in the form of numbers, strings, etc. (such as device identifier, device factory serial number, MAC address, etc.), or in other forms, as long as it can uniquely identify the user who needs to receive the service, it can be applied to the embodiment of the present invention. In the specific implementation process, it can be flexibly set according to actual needs and will not be specifically described here.
[0056] It should be noted that there are many ways for the user to input the request operation. For example, the user can input it by voice, or by operating virtual buttons displayed on the display interface of the intelligent device. The specific way of inputting the request instruction can be flexibly set according to actual needs and will not be specifically limited here.
[0057] In one example, the smart device can also generate a first message based on the location information to identify the location where the user identified by the user identification is located according to the location information. The location information can be determined according to the real-time positioning of the smart device or the location manually configured by the user. In the specific implementation process, it can be flexibly set according to actual needs and will not be elaborated here.
[0058] After receiving the first message, the first device 11 can parse the first message to obtain the user identification carried in the first message. Then, obtain the time corresponding to the user identification and the group identification to which the user identification belongs, so as to facilitate the subsequent second device 12 to send a second message according to the time corresponding to the user identification and the group identification to which the user identification belongs, that is, to provide services for the user identified by the user identification at the time corresponding to the user identification.
[0059] Taking the service as a daily prayer reminder and the user who requests the service has a need for 5 prayer reminders per day as an example, after the user runs the target application (such as the BIGO LIVE live application) through the smart device, the user can operate the prayer reminder setting icon displayed on the main interface of the target application to request that the target application can provide the service of daily prayer reminder. Figure 2 This is a schematic diagram of an interface provided by an embodiment of the present invention. As Figure 2 shown, the interface displays location information, the preset time for each prayer corresponding to the location information, and a prayer reminder setting icon. For example, as Figure 2 shown, the location information is China Guangzhou, and the preset times for each prayer corresponding to the location information are: the preset time for Fajr is 5:17, the preset time for Dhuhr is 12:35, the preset time for Asr is 16:00, the preset time for Maghrib is 18:37, and the preset time for Isha’a is 19:47. Optionally, the interface also displays the current date (such as Figure 2 shown as Tuesday, March 18, 2020 and Tuesday, Rajab 22, 1441), the sunrise time and sunset time corresponding to the location information, the number of days the current user has prayed (such as Figure 2 shown as You have prayed for XX days), and the preset time corresponding to the next prayer (such as Figure 2Information such as the Next Prayer (12:35 Dhuhr) and the remaining time for the next user's prayer (Time Remaining in Dhuhr 35 mins) is shown. After the intelligent device receives an operation on the prayer reminder switch icon, it can generate a first message and send it to the first device 11 according to the user identification and location information of the user. Figure 3 This is a schematic diagram of an interface provided by an embodiment of the present invention. When the intelligent device detects an operation by the user on Figure 2 the shown prayer reminder setting icon, the interface displayed on the display is switched to the Figure 3 shown prayer reminder setting interface, and a prayer reminder switch icon is displayed in this prayer reminder setting interface. The user can operate on this prayer reminder switch icon to enable or disable the service of daily prayer reminder. After receiving the first message, the first device 11 analyzes the first message to obtain the user identification and location information carried in the first message. Then, it determines the time corresponding to the user identification and the group identification to which the user identification belongs, so as to facilitate the subsequent second device 12 to send a second message according to the time corresponding to the user identification and the group identification to which the user identification belongs, that is, to provide services for the user with the user identification at the time corresponding to the user identification.
[0060] In a possible implementation manner, the first device 11 obtaining the time corresponding to the user identification includes the following two methods:
[0061] Method 1: When the user configures the time information for providing services during the input request operation, the intelligent device can obtain the time information configured by the user after receiving the request operation and generate a first message. Subsequently, after receiving the first message, the first device 11 analyzes the first message to obtain the time information included in the first message. Based on this, if the first message carries time information, the time corresponding to the user identification can be determined according to the time information.
[0062] Method 2: Considering that there will be time differences between locations with different longitudes and latitudes, which will affect the time to provide services to users in different locations. For example, if a fajr prayer reminder service is provided to users, for different locations, the second device 12 needs to provide the fajr prayer reminder service to users in that location during the period from dawn to sunrise at that location. Exemplarily, if the location is Xinjiang, the time to provide the fajr prayer reminder service to users in Xinjiang is 8:17, and if the location is Beijing, the time to provide the fajr prayer reminder service to users in Beijing is 5:17, etc. Therefore, the time to provide services to users in different locations can be preset, that is, the corresponding relationship between time and location can be preconfigured, which can reduce the workload consumed by users to customize the time to provide services. After receiving a request operation, the intelligent device can obtain the user identifier and location information, generate a first message based on the user identifier and location information, and send it to the first device 11. After receiving the first message, the first device 11 parses the first message to obtain the user identifier and location information included in the first message. According to the preconfigured corresponding relationship between time and location, the time corresponding to the location information is determined, and according to the time corresponding to the location information, the time corresponding to the user identifier is determined.
[0063] In a possible implementation manner, the time for the second device 12 to provide services to users is different. For example, a product group opening reminder service is provided at 20:00 in the evening, and a fajr prayer reminder service is provided to users at 5:17 in the morning, etc. Therefore, for different services, the corresponding relationship between time and location under the service can be preconfigured, so that the second device 12 can more accurately provide different services to users in different locations, improving the user experience. Among them, the corresponding relationship between time and location under different services can be completely different or partially different, and can be flexibly set according to actual needs in the specific implementation process.
[0064] It should be noted that the time corresponding to the user identifier represents the time to provide services to the user represented by the user identifier.
[0065] After obtaining the user identifier included in the first message, the first device 11 can also group the user identifiers so that the user identifiers corresponding to the same location information can be divided into different groups, that is, different users at the same location are divided into different groups, effectively avoiding the situation that the second device 12 provides services for all users at the same location and increasing the load pressure on the second device 12, and reducing the impact of the number difference of users at different locations on the load of different second devices 12. Based on this, a grouping value is preset, and this grouping value represents the number of different groups into which the user identifier can be divided, and this grouping value is a positive integer greater than or equal to 2. Subsequently, after the first device 11 obtains the user identifier, it can determine the group identifier to which the user identifier belongs through this grouping value. This group identifier represents the group where the user identifier is located.
[0066] When determining the group identifier to which the user identifier belongs according to this grouping value, a value can be randomly determined from the preset grouping values and this value is determined as the group identifier corresponding to the user, or through a hash algorithm, the user identifier is mapped to a value within the range of [0, the preset grouping value], and according to the mapped value, the group identifier corresponding to the user is determined.
[0067] In one example, if the first message contains location information, the group identifier to which the user identifier belongs can also be determined according to this location information and the preset grouping value, so that each group can be further refined, ensuring that the user identifiers belonging to the same group all correspond to the same location information, ensuring that the user identifiers in each group corresponding to the same location information are as uniform as possible, which is convenient for the subsequent second device 12 to send the second message based on the user identifiers within the group. For example, if the location information included in the first message is BEIJING, then according to BEIJING and the preset grouping value N, the group identifier to which the user identifier A belongs is determined to be BEIJING_1. Among them, N is a positive integer greater than or equal to 2.
[0068] It should be noted that considering that the number of users at different locations is different, the grouping value corresponding to this location information can be set for different location information. Among them, the grouping values corresponding to different location information can be completely different, partially different, or completely the same.
[0069] After determining the time corresponding to the user identifier and the group identifier to which the user identifier belongs based on the above embodiments, obtain the group identifiers to which each user identifier belongs corresponding to this time, and then determine the group identifiers corresponding to this time according to this time and the obtained group identifiers. This can facilitate quickly determining the group identifiers that need to be served at this time in the subsequent process, and further facilitate the second device 12 to quickly obtain the user identifiers belonging to these group identifiers, improving the service efficiency of the second device 12.
[0070] Figure 4 FIG. is a schematic diagram of a prayer reminder scenario provided by an embodiment of the present invention. Taking Figure 2 the service shown as a prayer reminder notification and the target application as a prayer system as an example, after the user runs the prayer system through the smart device, the user can operate the prayer reminder setting icon displayed on the main interface of the prayer system to turn on the service of the prayer reminder notification, that is, request the service of providing the prayer reminder notification. After receiving the operation of the user, the smart device can generate a first message according to the user identifier and location information of the user and send it to the first device 11. After receiving the first message, the first device 11 parses the first message to obtain the user identifier and location information carried in the first message. Then, according to the location information and the preset grouping value, determine the group identifier to which the user identifier belongs. And determine the time corresponding to the user identifier. After the first device 11 determines the user identifier to facilitate the subsequent second device 12 to determine the time corresponding to the group identifier to which the user identifier belongs and the group identifier to which the user identifier belongs, save the time corresponding to the group identifier to which the user identifier belongs and the group identifier to which the user identifier belongs into the database.
[0071] In an actual application scenario, if only a single second device 12 is used to provide services to a user, problems such as missed pushes and poor stability may occur during the process of the second device 12 providing the service corresponding to a certain time. For example, during the process of the second device 12 providing the service corresponding to a certain time, a fault occurs, resulting in the interruption of the service corresponding to that time, and further possibly causing the service corresponding to that time to be unable to continue to be executed normally, resulting in the problem that the service corresponding to that time is missed; during the process of the second device 12 providing the service corresponding to a certain time, problems such as time zone drift or excessive load occur, resulting in a delay in the service that should be provided at a certain time, and further causing the service corresponding to that time to be unable to be executed normally, resulting in the problem that the service corresponding to that time is missed; due to the relatively slow service speed of a single second device 12, when there are many users requesting services at a certain time, it is easy to occur that the push exceeds the specified time range. Based on this, in the embodiment of the present invention, at least two second devices 12 are included in the service processing system to ensure that during the process of providing services to users, the problem of being unable to provide services to the user due to a problem with a certain second device 12 will not occur. When it is necessary to provide the service corresponding to a certain time, at least two second devices 12 in the service processing system can respectively obtain at least one grouping identifier corresponding to that time, and the grouping identifiers obtained by different second devices 12 are different. Taking the existence of two second devices 12 as an example, the two second devices 12 are the second device 121 and the second device 122 respectively, and all the grouping identifiers corresponding to a certain time are BEIJING_1, BEIJING_2, BEIJING_3, and BEIJING_4 respectively. Then the second device 121 can obtain two grouping identifiers corresponding to that time, which are BEIJING_1 and BEIJING_2 respectively, and the second device 122 can obtain the other two grouping identifiers corresponding to that time, which are BEIJING_3 and BEIJING_4 respectively. For the at least two second devices 12, the second device 12 sends a second message based on the user identifier included in the at least one grouping identifier obtained. Among them, the second message is used to provide the service.
[0072] In a specific implementation process, for the at least two second devices 12, the second device 12 can obtain the user identifier included in the at least one grouping identifier from the first device 11, and then send a second message based on the obtained user identifier.
[0073] In one example, the service processing system further includes a third device, which is used to determine when to obtain the packet identifier that needs to provide services, send a first query request when it is necessary to obtain the packet identifier that needs to provide services, and send the obtained packet identifier to multiple second devices 12 respectively, so as to reduce the workload of the first device 11 and the multiple second devices 12. Among them, the third device can send the first query request according to a preset period (for example, 1 minute, etc.), or send the first query request at a preset time point (for example, 16:00, 20:00, etc.). Of course, it can also send the first query request after receiving a query operation. In the specific implementation process, it can be flexibly set according to actual needs.
[0074] In order to accurately determine the packet identifier that needs to provide services, in the embodiments of the present invention, for each time that needs to provide services, a preset service condition is configured for this time. The preset service condition corresponding to this time may be that the time difference between the current time and this time reaches a preset duration threshold (for example, 15 minutes, etc.), and the current time is this time, etc. When the first device 11 receives the first query request sent by the third device, it can obtain the current time, for example, obtain the time when the first query request is received, etc. Then it is determined whether the current time meets the preset service condition corresponding to any time when the service has not been provided. If it is determined that the current time meets the preset service condition corresponding to any time when the service has not been provided, it means that multiple second devices 12 are required to provide services. Then, according to the pre-configured correspondence between time and packet identifier, the packet identifier corresponding to the satisfied time is obtained and sent to the third device. If it is determined that the current time does not meet the preset service condition corresponding to any time when the service has not been provided, it means that multiple second devices 12 are not required to provide services at present, and then wait for the next first query request.
[0075] After the third device receives the packet identifier sent by the first device 11, the third device can process the obtained packet identifier, so that multiple second devices 12 can obtain at least one packet identifier, and send a second message based on the user identifier included in the at least one packet identifier.
[0076] In a possible implementation manner, the third device can allocate the received packet identifier to determine at least one packet identifier sent to multiple second devices 12.
[0077] In another possible implementation, the third device can also send the received packet identifier to a message queue (such as a Codis queue, a Kafka message queue, a Rocket Message Queue, etc.). Subsequently, multiple second devices 12 can sequentially obtain the packet identifier from this message queue, which can avoid the third device continuously storing the packet identifier before multiple second devices 12 obtain it, occupying a large amount of storage space, and also avoid situations where the third device fails to allocate the received packet identifier in a timely manner, or multiple second devices 12 fail to obtain at least one packet identifier from the third device in a timely manner, which may reduce the service efficiency.
[0078] Figure 5 FIG. is a schematic diagram of a scenario of a service processing flow provided by an embodiment of the present invention. As Figure 5 shown, the preset period is 1 minute, the packet value corresponding to Beijing is N, where N is a positive integer greater than or equal to 2. The third device obtains the packet identifier that needs to provide services at the current moment from the first device 11 every minute and writes the obtained packet identifier into the Codis queue. For example, if the users in Beijing need to provide services at the current moment, the data of each packet identifier BeiJing_0, BeiJing_1->BeiJing_(N - 1) of the users in Beijing is written into the Codis queue.
[0079] After the third device sends the packet identifiers at a certain time to the message queue corresponding to that time, at least two second devices 12 can sequentially obtain the packet identifiers that they need to provide services from the message queue corresponding to that time, that is, obtain the corresponding at least one packet identifier.
[0080] In the specific implementation process, when the at least two second devices 12 sequentially obtain the packet identifiers that they need to provide services from the message queue corresponding to that time, they sequentially take out the packet identifier at the head of the queue from the message queue corresponding to that time. And whenever the at least two second devices 12 obtain a packet identifier from the message queue corresponding to that time, they delete the packet identifier from the message queue corresponding to that time until the message queue is empty, that is, no packet identifier can be obtained from the head of the message queue.
[0081] In a possible implementation, it is possible that a certain packet does not contain a user identifier, resulting in a situation where any subsequent second device 12 cannot obtain the user identifier included in the packet identifier from the first device 11 after obtaining the packet identifier. Therefore, if the at least two second devices 12 cannot obtain the user identifier included in a certain packet identifier from the first device 11, they can re-obtain the packet identifier at the head of the queue from the message queue corresponding to that time and send a second message based on the user identifier included in the re-obtained packet identifier.
[0082] Since the user identifier included in the packet identifier is obtained from the first device 11 through this packet identifier, each user identifier will only be obtained once, reducing the request pressure on the first device 11. Moreover, the number of user identifiers included in each packet identifier is relatively uniform, so that the resources of each second device 12 can be fully utilized, avoiding the problem that some second devices 12 are overloaded. In addition, since each second device 12 sequentially obtains packet identifiers from the message queue, the number of second devices 12 in this service processing system can be dynamically expanded according to the current demand to meet the increasing service efficiency requirements.
[0083] Any second device 12 can obtain at least one packet identifier. For each obtained packet identifier, the second device 12 can obtain the user identifier included in the packet identifier from the first device 11, generate a service start message according to the packet identifier, and send the service start message to the first device 11 to notify the first device 11 that the current second device 12 has started to send the second message based on the user identifier included in the packet identifier. Subsequently, the second device 12 sends the second message based on the user identifier included in the packet identifier. After the second device 12 has sent the second message based on all the user identifiers included in the packet identifier, a service end message can be generated according to the packet identifier and sent to the first device 11 to notify the first device 11 that the current second device 12 has completed sending the second message based on the user identifier included in the packet identifier, which can facilitate the first device 11 to timely obtain the progress of the service provided by each second device 12.
[0084] In an actual application scenario, there may be a problem that a certain second device 12 fails or is overloaded during the process of providing services for a certain packet identifier, resulting in the second device 12 being unable to continue sending the second message based on the user identifier of the packet identifier. Therefore, in the embodiment of the present invention, for each packet identifier, the first device 11 can monitor in real time the duration of the second device 12 providing services for the users of the packet identifier, so as to determine whether there are problems such as failure or overload of the second device 12 providing services for the users of the packet identifier according to the service duration, and when it is determined that the second device 12 has a problem, reassign the packet identifier to other healthy second devices 12, so as to send the second message based on the user identifier included in the packet identifier through other healthy second devices 12, which can avoid the problem of missed push when sending the second message based on the user identifier included in a certain packet identifier.
[0085] In one example, the first device 11 may determine the duration for which the second device 12 provides services for the user of the packet identifier based on the time difference between the time when it receives a service start message carrying a certain packet identifier and the time when it receives a service end message carrying the same packet identifier. When the first device 11 determines that it has not received a service end message carrying the packet identifier within a preset time after receiving a service start message carrying the packet identifier, it indicates that there may be a problem with the second device 12 that provides services for the user of the packet identifier. In this case, the first device 11 may send the packet identifier to the third device, so that the third device can re-add the packet identifier to the message queue, facilitating other second devices 12 to obtain the packet identifier from the message queue and send a second message based on the user identifier of the packet identifier, that is, to provide services for the user of the packet identifier.
[0086] In a possible application scenario, it may occur that after a certain second device 12 has sent a second message based on some of the user identifiers included in a packet identifier, problems such as a malfunction or excessive load of the second device 12 occur. As a result, when subsequent other second devices 12 send a second message based on the user identifiers included in the packet identifier, they may repeatedly send a second message based on some of the user identifiers included in the packet identifier, which not only wastes the computing resources and time of the second device 12 but also reduces the user experience. Therefore, in the embodiment of the present invention, the service processing system further includes an electronic device (denoted as the fourth device) for storing user data of users for whom services have been completed. The user data of users for whom services have been completed may include a completion identifier corresponding to each user identifier, and the completion identifier is used to indicate that a second message has been sent based on the user identifier. Before any subsequent second device 12 sends a second message based on each obtained user identifier, it may send a query request (denoted as the second query request) corresponding to the user identifier to the fourth device to determine whether a second message has been sent based on the user identifier through the second query request. After receiving the second query request sent by any second device 12, the fourth device may determine the response content of the second query request and send it according to the stored user data of users for whom services have been completed, that is, the completion identifier corresponding to each stored user identifier. After receiving the response content of the second query request, the second device 12 may determine whether to send a second message based on the user identifier according to the corresponding content, thereby avoiding multiple second devices 12 from repeatedly sending a second message based on a certain user identifier, saving the computing resources and time of the second device 12, and improving the user experience.
[0087] In the specific implementation process, after any second device 12 obtains all the user identifiers included in any packet identifier, for all the user identifiers included in the packet identifier, a second query request is generated according to the user identifier and sent to the fourth device. After receiving the second query request, the fourth device parses the second query request to obtain the user identifier carried in the second query request. The fourth device determines whether it stores the completion identifier corresponding to the user identifier carried in the second query request according to the completion identifier respectively corresponding to each stored user identifier. If it is determined that the completion identifier corresponding to the user identifier carried in the second query request is stored, it indicates that the second message has been sent based on the user identifier carried in the second query request, and then the preset first response content is determined as the response content of the second query request and sent. If it is determined that the completion identifier corresponding to the user identifier carried in the second query request is not stored, it indicates that the second message has not been sent based on the user identifier carried in the second query request, and then the preset second response content is determined as the response content of the second query request and sent.
[0088] After the second device 12 receives the response content of the second query request sent by the fourth device, if it is determined according to the response content that the completion identifier corresponding to the user identifier is not stored, the second device 12 sends the second message based on the user identifier, and after sending the second message, sends the completion identifier corresponding to the user identifier to the fourth device so that the fourth device stores the completion identifier corresponding to the user identifier. If it is determined according to the response content that the completion identifier corresponding to the user identifier is stored, the second device 12 obtains the next user identifier in the packet identifier.
[0089] Since a packet identifier may include multiple user identifiers, when the second device 12 sends the second message based on each user identifier, the above steps are all executed until all the user identifiers included in the packet identifier are processed, that is, it is determined that the second message has been sent based on all the user identifiers included in the packet identifier.
[0090] Figure 6 It is a schematic diagram of the scenario for sending the second message provided by the embodiment of the present invention. As Figure 6 shown, the at least two second devices 12 take out the packet identifier at the head of the queue from the codis queue, that is, consume the packet identifier from the codis queue, obtain the user identifiers included in the packet identifier from the first device 11, and then send the prayer reminder message based on the obtained user identifiers in an asynchronous thread pool processing manner. Through the service processing system provided by the embodiment of the present invention, more than 20 million second messages can be pushed per day on average, improving the efficiency and stability of the push reminder service. Figure 7A schematic diagram of a display interface for prayer reminder provided by an embodiment of the present invention. When the intelligent device receives the prayer reminder message sent by the second device 12, it can control the display to display an interface as shown in Figure 7 to notify and remind the user.
[0091] It should be noted that the above first device 11, second device 12, third device, and fourth device can be the same electronic device or different electronic devices. In the specific implementation process, flexible settings can be made according to actual needs.
[0092] Since the first device 11 can assign a grouping identifier to the obtained user identifier according to a preset grouping value, and divide the obtained user identifiers into different groups according to the grouping identifier, so as to realize dividing different user identifiers corresponding to the same location information into different groups, that is, dividing different users at the same location into different groups. Subsequently, the user identifiers of different groups are dispersed to multiple second devices 12, and the multiple second devices 12 can parallelly send a second message based on the user identifiers included in at least one obtained group, so as to realize providing services for different users at the same location by multiple second devices 12 in parallel, and improve the efficiency of providing services for different users at the same location. Since each second device 12 only processes the received user identifiers, and the grouping identifiers obtained by different second devices 12 are different, it is realized that multiple second devices 12 all provide services for different users at the same location, and any second device 12 only provides services for some users at this location, reducing the load of this second device 12, avoiding the influence of the quantity difference of user identifiers at different locations on the load of the second device 12, and also avoiding the computing power consumed and network resources wasted in the process of the second device 12 determining the user identifiers to be served after obtaining all the user identifiers to be served at this time, reducing the computing power requirement for the second device 12, which is beneficial to improving the stability of providing services for users at the same location at a certain time.
[0093] Embodiment 2:
[0094] An embodiment of the present invention provides a service processing method, which is applied to the first device. Figure 8 A schematic diagram of a service processing process provided by an embodiment of the present invention, and this process includes:
[0095] S801: Obtain a first message, where the first message is used to indicate a request for providing a service; the first message includes a user identifier.
[0096] S802: Determine the time corresponding to the user identifier and the group identifier to which the user identifier belongs. The time represents the time when the service is provided to the user corresponding to the user identifier, and the group identifier is determined according to a preset grouping value, where the preset grouping value is a positive integer greater than or equal to 2.
[0097] S803: According to the time and the group identifiers to which the respective user identifiers corresponding to the time belong, determine the group identifiers corresponding to the time, so that at least two second devices obtain at least one group identifier corresponding to the time; based on the user identifiers included in the at least one group identifier, send a second message, where the second message is used to provide the service; among them, the at least one group identifier obtained by different second devices is different.
[0098] It should be noted that for the principle of the service processing method provided in the embodiments of the present invention to solve technical problems, reference can be made to the description in Embodiment 1 above, and repeated parts will not be elaborated.
[0099] Further, the determining the time corresponding to the user identifier includes:
[0100] If the first message includes time information, determine the time corresponding to the user identifier according to the time information; or
[0101] If the first message includes location information, determine the time corresponding to the location information according to the pre-configured correspondence between time and location, and determine the time corresponding to the user identifier according to the time corresponding to the location information.
[0102] Further, the determining the group identifier to which the user identifier belongs includes:
[0103] If the first message includes location information, determine the group identifier to which the user identifier belongs according to the location information and the preset grouping value.
[0104] Further, the system further includes: a third device;
[0105] The method further includes:
[0106] Receive a first query request sent by the third device; the first query request is used to obtain a group identifier;
[0107] If it is determined that the current time meets the preset service condition corresponding to the time, send the group identifiers corresponding to the time to the third device, so that the third device writes the received group identifiers into the message queue corresponding to the time; the at least two second devices obtain at least one group identifier corresponding to the time from the message queue corresponding to the time.
[0108] Further, the method further includes:
[0109] Receiving a service start message carrying a packet identifier sent by the at least two second devices after obtaining at least one packet identifier corresponding to the time and before sending a second message based on the user identifier included in the at least one packet identifier; and
[0110] Receiving a service end message carrying the packet identifier sent by the at least two second devices after sending the second message based on the user identifier included in the packet identifier.
[0111] Further, the method further includes:
[0112] If a service end message carrying the packet identifier is not received within a preset time period after receiving the service start message carrying the packet identifier, sending the packet identifier to the third device.
[0113] Since the first device can assign a packet identifier to the obtained user identifier according to a preset packet value, and divide the obtained user identifiers into different groups according to the packet identifier, so as to realize dividing different user identifiers corresponding to the same location information into different groups, that is, dividing different users at the same location into different groups. Subsequently, the user identifiers of different groups are dispersed to multiple second devices, and the multiple second devices can parallelly send second messages based on the user identifiers included in at least one obtained packet, so as to realize providing services for different users at the same location through multiple second devices in parallel, and improve the efficiency of providing services for different users at the same location. Since each second device only processes the received user identifiers, and the packet identifiers obtained by different second devices are different, it is realized that multiple second devices all provide services for different users at the same location, and any second device only provides services for some users at this location, reducing the load of the second device, avoiding the influence of the quantity difference of user identifiers at different locations on the load of the second device, and also avoiding the computing power consumed and network resources wasted in the process of the second device obtaining all user identifiers to be served at this time and then determining the user identifiers to be served by the second device, reducing the computing power requirement for the second device, and being beneficial to improving the stability of providing services for users at the same location at a certain time.
[0114] Embodiment 3:
[0115] An embodiment of the present invention provides a service processing method, which is applied to a second device, Figure 9 which is another schematic diagram of a service processing process provided by an embodiment of the present invention, and the process includes:
[0116] S901: Obtain at least one packet identifier corresponding to the target time from the first device; wherein, the at least one packet identifier is determined according to a preset packet value, and the preset packet value is a positive integer greater than or equal to 2.
[0117] S902: Based on the user identifiers included in the at least one packet identifier, send a second message, where the second message is used to provide the service; wherein, the at least one packet identifier obtained by different second devices is different.
[0118] It should be noted that for the principle of the service processing method provided in the embodiments of the present invention to solve technical problems, reference can be made to the description in Embodiment 1 above, and repeated parts will not be elaborated.
[0119] Further, the obtaining of at least one packet identifier corresponding to the time includes:
[0120] Obtain at least one packet identifier corresponding to the target time from the message queue corresponding to the target time; wherein, the message queue corresponding to the target time is that a third device sends a first query request to the first device; the first query request is used to obtain a packet identifier; after receiving the first query request, if the first device determines that the current time meets the preset service condition corresponding to the target time, it sends each packet identifier corresponding to the target time to the third device; the third device writes the received packet identifiers into the message queue corresponding to the target time.
[0121] Further, the obtaining of at least one packet identifier corresponding to the target time from the message queue corresponding to the target time includes:
[0122] Obtain a packet identifier from the head position of the message queue corresponding to the target time, and delete the obtained packet identifier from the head position.
[0123] Further, after obtaining at least one packet identifier corresponding to the target time and before sending the second message based on the user identifiers included in the at least one packet identifier, the method further includes:
[0124] For the at least one packet identifier, send a service start message carrying the packet identifier to the first device;
[0125] After sending the second message based on the user identifier included in the packet identifier, the method further includes:
[0126] Send a service end message carrying the packet identifier to the first device.
[0127] Further, after obtaining at least one group identifier corresponding to the time and before sending a second message based on the user identifiers included in the at least one group identifier, the method further includes:
[0128] Sending a second query request carrying the user identifier to a fourth device for the user identifiers included in the at least one group identifier;
[0129] Receiving response information sent by the fourth device;
[0130] If it is determined according to the response information that there is no completion identifier corresponding to the user identifier saved, then sending the second message based on the user identifier;
[0131] Sending the completion identifier corresponding to the user identifier to the fourth device.
[0132] Since the first device can assign group identifiers to the obtained user identifiers according to a preset grouping value, and divide the obtained user identifiers into different groups according to the group identifiers, so as to realize dividing different user identifiers corresponding to the same location information into different groups, that is, dividing different users at the same location into different groups. Subsequently, the user identifiers of different groups are dispersed to multiple second devices, and the multiple second devices can send second messages in parallel based on the user identifiers included in at least one obtained group, so as to realize providing services for different users at the same location through multiple second devices in parallel, and improve the efficiency of providing services for different users at the same location. Since each second device only processes the received user identifiers, and the group identifiers obtained by different second devices are different, it is realized that multiple second devices all provide services for different users at the same location, and any second device only provides services for some users at this location, reducing the load of this second device, avoiding the influence of the quantity difference of user identifiers at different locations on the load of the second device, and also avoiding the computing power consumed and network resources wasted in the process of the second device determining the user identifiers to be served after obtaining all the user identifiers to be served at this time, reducing the computing power requirement for the second device, which is beneficial to improving the stability of providing services for users at the same location at a certain time.
[0133] Embodiment 4:
[0134] The embodiment of the present invention further provides a service processing device, and the device is applied to a first device, Figure 10 The following is a schematic structural diagram of a service processing device provided by the embodiment of the present invention, and the structure includes:
[0135] An obtaining unit 1001, configured to obtain a first message, where the first message is used to indicate a request for providing a service; the first message includes a user identifier.
[0136] A first processing unit 1002, configured to determine the time corresponding to the user identifier and the group identifier to which the user identifier belongs, where the time represents the time when the service is provided to the user corresponding to the user identifier, and the group identifier is determined according to a preset group value, and the preset group value is a positive integer greater than or equal to 2.
[0137] A second processing unit 1003, configured to determine the group identifiers corresponding to the time according to the time and the group identifiers to which the respective user identifiers corresponding to the time belong, so that at least two second devices obtain at least one group identifier corresponding to the time; and send a second message based on the user identifiers included in the at least one group identifier, where the second message is used to provide the service; and at least one group identifier obtained by different second devices is different.
[0138] It should be noted that for the principle of the service processing device provided in the embodiments of the present invention to solve technical problems, reference may be made to the descriptions in the above Embodiments 1-2, and repeated parts will not be elaborated.
[0139] Since the first device can allocate group identifiers to the obtained user identifiers according to a preset group value, and divide the obtained user identifiers into different groups according to the group identifiers, so as to realize dividing different user identifiers corresponding to the same location information into different groups, that is, dividing different users at the same location into different groups. Subsequently, the user identifiers of different groups are scattered to multiple second devices, and the multiple second devices can parallelly send second messages based on the user identifiers included in at least one obtained group, so as to realize providing services to different users at the same location by multiple second devices in parallel, and improve the efficiency of providing services to different users at the same location. Since each second device only processes the received user identifiers, and the group identifiers obtained by different second devices are different, it is realized that multiple second devices all provide services to different users at the same location, and any second device only provides services to some users at this location, reducing the load of the second device, avoiding the influence of the quantity difference of user identifiers at different locations on the load of the second device, and also avoiding the computing power consumed and network resources wasted in the process of the second device determining the user identifiers to be served after obtaining all the user identifiers to be served at this time, reducing the computing power requirement for the second device, and being beneficial to improving the stability of providing services to users at the same location at a certain time.
[0140] Embodiment 5:
[0141] The embodiments of the present invention further provide a service processing device, and the device is applied to a second device. Figure 11 Shown in the following is a schematic structural diagram of still another service processing device provided in the embodiments of the present invention, and the structure includes:
[0142] An acquisition module 1101, configured to acquire at least one packet identifier corresponding to a target time from a first device; wherein, the at least one packet identifier is determined according to a preset packet value, and the preset packet value is a positive integer greater than or equal to 2.
[0143] A processing module 1102, configured to send a second message based on the user identifiers included in the at least one packet identifier, where the second message is used to provide the service; wherein, at least one packet identifier obtained by different second devices is different.
[0144] It should be noted that for the principle of the service processing device provided by the embodiments of the present invention to solve technical problems, reference can be made to the descriptions in the above-mentioned Embodiments 1-2, and repeated parts will not be elaborated.
[0145] Since the first device can allocate packet identifiers to the obtained user identifiers according to the preset packet value, and divide the obtained user identifiers into different groups according to the packet identifiers, so as to realize dividing different user identifiers corresponding to the same location information into different groups, that is, dividing different users at the same location into different groups. Subsequently, the user identifiers of different groups are scattered to multiple second devices, and the multiple second devices can parallelly send the second message based on the user identifiers included in at least one obtained packet, so as to realize providing services for different users at the same location by multiple second devices in parallel, and improve the efficiency of providing services for different users at the same location. Since each second device only processes the received user identifiers, and the packet identifiers obtained by different second devices are different, it is realized that multiple second devices all provide services for different users at the same location, and any second device only provides services for some users at this location, reducing the load of the second device, avoiding the influence of the quantity difference of user identifiers at different locations on the load of the second device, and also avoiding the computing power consumed and network resources wasted in the process of the second device determining the user identifiers to be served after obtaining all the user identifiers to be served at this time, reducing the computing power requirement for the second device, and being beneficial to improving the stability of providing services for users at the same location at a certain time.
[0146] Embodiment 6:
[0147] Figure 12 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. The electronic device includes: a processor 1201, a communication interface 1202, a memory 1203, and a communication bus 1204. Among them, the processor 1201, the communication interface 1202, and the memory 1203 communicate with each other through the communication bus 1204;
[0148] The memory 1203 stores a computer program, which, when executed by the processor 1201, causes the processor 1201 to perform the following steps:
[0149] Obtain a first message for indicating a request to provide a service; the first message includes a user identifier;
[0150] And determine the time corresponding to the user identifier and the group identifier to which the user identifier belongs. The time represents the time for providing the service to the user corresponding to the user identifier, and the group identifier is determined according to a preset grouping value, where the preset grouping value is a positive integer greater than or equal to 2;
[0151] According to the time and the group identifiers to which the respective user identifiers corresponding to the time belong, determine the respective group identifiers corresponding to the time, so that at least two second devices obtain at least one group identifier corresponding to the time; based on the user identifiers included in the at least one group identifier, send a second message for providing the service; wherein, the at least one group identifier obtained by different second devices is different.
[0152] Since the principle of the above electronic device for solving problems is similar to the service processing method, the implementation of the above electronic device can refer to the implementation of the method, and the repeated parts will not be described again.
[0153] Embodiment 7:
[0154] Figure 13 This is another schematic structural diagram of an electronic device provided by an embodiment of the present invention. The electronic device includes: a processor 1301, a communication interface 1302, a memory 1303, and a communication bus 1304. Among them, the processor 1301, the communication interface 1302, and the memory 1303 complete mutual communication through the communication bus 1304;
[0155] The memory 1303 stores a computer program, which, when executed by the processor 1301, causes the processor 1301 to perform the following steps:
[0156] Obtain at least one group identifier corresponding to a target time from a first device; wherein, the at least one group identifier is determined according to a preset grouping value, and the preset grouping value is a positive integer greater than or equal to 2;
[0157] Based on the user identifiers included in the at least one group identifier, send a second message for providing the service; wherein, the at least one group identifier obtained by different second devices is different.
[0158] Since the principle of the above electronic device for solving problems is similar to the business processing method, the implementation of the above electronic device can refer to the implementation of the method, and the repeated parts will not be elaborated.
[0159] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0160] The communication interface 1302 is used for communication between the above electronic device and other devices.
[0161] The memory may include a Random Access Memory (RAM), and may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0162] The above processor may be a general-purpose processor, including a central processing unit, a Network Processor (NP), etc.; it may also be a Digital Signal Processing (DSP), an application-specific integrated circuit, a field programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0163] Since the first device can assign a group identifier to the obtained user identifiers according to a preset grouping value, and divide the obtained user identifiers into different groups according to the group identifier, so as to divide different user identifiers corresponding to the same location information into different groups, that is, divide different users at the same location into different groups. Subsequently, the user identifiers of different groups are dispersed to multiple second devices, and the multiple second devices can concurrently send a second message based on the user identifiers included in at least one obtained group, so as to concurrently provide services for different users at the same location through the multiple second devices, improving the efficiency of providing services for different users at the same location. Since each second device only processes the received user identifiers and the group identifiers obtained by different second devices are different, it is realized that multiple second devices all provide services for different users at the same location, and any second device only provides services for some users at this location, reducing the load of this second device, avoiding the influence of the quantity difference of user identifiers at different locations on the load of the second device, and also avoiding the computing power consumed and network resources wasted in the process of the second device determining the user identifiers to be served after obtaining all the user identifiers to be served at this time, reducing the computing power requirement for the second device, which is beneficial to improving the stability of providing services for users at the same location at a certain time.
[0164] Embodiment 8:
[0165] Based on the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program executable by a processor is stored. When the program runs on the processor, the processor is caused to execute the following steps:
[0166] Obtain a first message, where the first message is used to indicate a request for providing a service; the first message includes a user identifier;
[0167] And determine the time corresponding to the user identifier and the group identifier to which the user identifier belongs. The time represents the time for providing the service to the user corresponding to the user identifier, and the group identifier is determined according to a preset grouping value, and the preset grouping value is a positive integer greater than or equal to 2;
[0168] According to the time and the group identifiers to which the respective user identifiers corresponding to the time belong, determine the respective group identifiers corresponding to the time, so that at least two second devices obtain at least one group identifier corresponding to the time; based on the user identifiers included in the at least one group identifier, send a second message, where the second message is used to provide the service; wherein, the at least one group identifier obtained by different second devices is different.
[0169] Since the principle of the computer-readable storage medium for solving problems is similar to the service processing method in the above embodiments, the specific implementation can refer to the implementation of the server selection method.
[0170] Since the first device can assign a group identifier to the obtained user identifiers according to a preset grouping value, and divide the obtained user identifiers into different groups according to the group identifier, so as to realize dividing different user identifiers corresponding to the same location information into different groups, that is, dividing different users at the same location into different groups. Subsequently, the user identifiers of different groups are dispersed to multiple second devices, and the multiple second devices can concurrently send a second message based on the user identifiers included in at least one obtained group, so as to realize providing services for different users at the same location through multiple second devices in parallel, and improve the efficiency of providing services for different users at the same location. Since each second device only processes the received user identifiers, and the group identifiers obtained by different second devices are different, it is realized that multiple second devices all provide services for different users at the same location, and any second device only provides services for some users at this location, reducing the load of this second device, avoiding the influence of the quantity difference of user identifiers at different locations on the load of the second device, and also avoiding the computing power consumption and wasted network resources in the process of the second device determining the user identifiers to be served after obtaining all the user identifiers to be served at this time, reducing the computing power requirement for the second device, and being beneficial to improving the stability of providing services for users at the same location at a certain time.
[0171] Embodiment 9:
[0172] Based on the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, in which a computer program executable by a processor is stored. When the program runs on the processor, the processor is caused to execute the following steps when executing:
[0173] Obtain at least one group identifier corresponding to the target time from the first device; wherein, the at least one group identifier is determined according to a preset grouping value, and the preset grouping value is a positive integer greater than or equal to 2;
[0174] Send a second message based on the user identifiers included in the at least one group identifier, where the second message is used to provide the service; wherein, the at least one group identifier obtained by different second devices is different.
[0175] Since the principle of the computer-readable storage medium for solving problems is similar to the service processing method in the above embodiments, the specific implementation can refer to the implementation of the server selection method.
[0176] Since the first device can assign grouping identifiers to the obtained user identifiers according to preset grouping values, and divide the obtained user identifiers into different groups according to the grouping identifiers, so as to divide different user identifiers corresponding to the same location information into different groups, that is, divide different users at the same location into different groups. Subsequently, the user identifiers of different groups are dispersed to multiple second devices, and the multiple second devices can send second messages in parallel based on the user identifiers included in at least one obtained group, so as to provide services for different users at the same location through multiple second devices in parallel, improving the efficiency of providing services for different users at the same location. Since each second device only processes the received user identifiers, and the grouping identifiers obtained by different second devices are different, multiple second devices can provide services for different users at the same location, and any second device only provides services for some users at this location, reducing the load of this second device, avoiding the impact of the quantity difference of user identifiers at different locations on the load of the second device, and also avoiding the computing power consumed and network resources wasted in the process of the second device determining the user identifiers to be served after obtaining all the user identifiers to be served at this time, reducing the computing power requirement for the second device, which is beneficial to improving the stability of providing services for users at the same location at a certain time.
[0177] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0178] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the specified functions in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0179] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means embodying the functionality specified in the flowchart(s) Figure 1 a flowchart or flowcharts and / or block diagram(s) Figure 1 a block diagram or block diagrams.
[0180] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functionality specified in the flowchart(s) Figure 1 a flowchart or flowcharts and / or block diagram(s) Figure 1 a block diagram or block diagrams.
[0181] Obviously, those skilled in the art can make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to cover these changes and modifications.
Claims
1. A service processing system, characterized in that, the system includes: a first device and at least two second devices; the first device is configured to obtain a first message, where the first message is used to indicate a request for providing a service; the first message includes a user identifier; and determine the time corresponding to the user identifier and the group identifier to which the user identifier belongs, where the time represents the time for providing the service to the user corresponding to the user identifier, and the group identifier is determined according to a preset grouping value, and the preset grouping value is a positive integer greater than or equal to 2; determine the respective group identifiers corresponding to the time according to the time and the group identifiers to which the respective user identifiers corresponding to the time belong; the at least two second devices are configured to obtain at least one group identifier corresponding to the time; and send a second message based on the user identifiers included in the at least one group identifier, where the second message is used to provide the service; wherein, the at least one group identifier obtained by different second devices is different; wherein, the system further includes: a third device; the third device is configured to send a first query request to the first device; the first query request is used to obtain a group identifier; the first device is further configured to receive the first query request; if it is determined that the current time meets the preset service condition corresponding to the time, then send the respective group identifiers corresponding to the time to the third device; the third device is further configured to write the received group identifier into the message queue corresponding to the time; the at least two second devices are specifically configured to obtain at least one group identifier corresponding to the time from the message queue corresponding to the time.
2. The system according to claim 1, characterized in that, the first device is specifically configured to, if the first message includes time information, determine the time corresponding to the user identifier according to the time information; or, if the first message includes location information, determine the time corresponding to the location information according to the pre-configured correspondence between time and location, and determine the time corresponding to the user identifier according to the time corresponding to the location information.
3. The system according to claim 1, characterized in that, the first device is specifically configured to, if the first message includes location information, determine the group identifier to which the user identifier belongs according to the location information and the preset grouping value.
4. The system according to claim 1, characterized in that, the at least two second devices are specifically configured to sequentially obtain group identifiers from the head position of the message queue corresponding to the time, and delete the obtained group identifiers from the head position.
5. The system according to claim 1, characterized in that, the at least two second devices are further configured to, if the user identifier included in the group identifier cannot be obtained from the first device, re-obtain the group identifier at the head position from the message queue corresponding to the time, and send a second message based on the user identifier included in the re-obtained group identifier.
6. The system according to claim 1, characterized in that, The at least two second devices are further configured to, after obtaining at least one packet identifier corresponding to the time and before sending a second message based on the user identifier included in the at least one packet identifier, send a service start message carrying the packet identifier to the first device for each of the at least one packet identifier; and after sending the second message based on the user identifier included in the packet identifier, send a service end message carrying the packet identifier to the first device.
7. The system according to claim 6, wherein, the first device is further configured to, if it does not receive a service end message carrying the packet identifier within a preset time period after receiving the service start message carrying the packet identifier, send the packet identifier to the third device.
8. The system according to any one of claims 4-7, wherein, the system further includes: a fourth device; the at least two second devices are further configured to, after obtaining at least one packet identifier corresponding to the time and before sending a second message based on the user identifier included in the at least one packet identifier, send a second query request carrying the user identifier to the fourth device for each user identifier included in the at least one packet identifier; receive response information sent by the fourth device; if it is determined according to the response information that the completion identifier corresponding to the user identifier is not saved, send the second message based on the user identifier; and send the completion identifier corresponding to the user identifier to the fourth device; the fourth device is configured to receive and save the completion identifier corresponding to each user identifier respectively; receive the second query request; and determine and send the response content of the second query request according to the saved completion identifier corresponding to each user identifier respectively.
9. A service processing method, wherein, the method is applied to a first device, and the method includes: obtaining a first message, where the first message is used to indicate a request for providing a service; the first message includes a user identifier; and determining the time corresponding to the user identifier and the packet identifier to which the user identifier belongs, where the time represents the time for providing the service to the user corresponding to the user identifier, and the packet identifier is determined according to a preset packet value, and the preset packet value is a positive integer greater than or equal to 2; determining the packet identifiers corresponding to the time according to the time and the packet identifiers to which the respective user identifiers corresponding to the time belong, so that at least two second devices obtain at least one packet identifier corresponding to the time; and sending a second message based on the user identifier included in the at least one packet identifier, where the second message is used to provide the service; wherein, the at least one packet identifier obtained by different second devices is different; the method further includes: receiving a first query request sent by a third device; the first query request is used to obtain a packet identifier; If it is determined that the current time meets the preset service conditions corresponding to the time, each grouping identifier corresponding to the time is sent to the third device, so that the third device writes the received grouping identifier into the message queue corresponding to the time; the at least two second devices obtain at least one grouping identifier corresponding to the time from the message queue corresponding to the time.
10. A service processing method, characterized in that, the method is applied to a second device, and the method includes: obtaining at least one grouping identifier corresponding to a target time from a first device; wherein, the at least one grouping identifier is determined according to a preset grouping value, and the preset grouping value is a positive integer greater than or equal to 2; sending a second message based on the user identifiers included in the at least one grouping identifier, the second message being used to provide a service; wherein, the at least one grouping identifier obtained by different second devices is different; wherein, the obtaining at least one grouping identifier corresponding to the time includes: obtaining at least one grouping identifier corresponding to the target time from the message queue corresponding to the target time; wherein, the message queue corresponding to the target time is that the third device sends a first query request to the first device; the first query request is used to obtain a grouping identifier; after receiving the first query request, if the first device determines that the current time meets the preset service conditions corresponding to the target time, the first device sends each grouping identifier corresponding to the target time to the third device; the third device writes the received grouping identifier into the message queue corresponding to the target time.
11. A service processing apparatus, characterized in that, the apparatus is applied to a first device, and the apparatus includes: an obtaining unit, configured to obtain a first message, the first message being used to indicate a request to provide a service; the first message includes a user identifier; a first processing unit, configured to determine the time corresponding to the user identifier and the grouping identifier to which the user identifier belongs, the time representing the time for providing the service to the user corresponding to the user identifier, and the grouping identifier is determined according to a preset grouping value, and the preset grouping value is a positive integer greater than or equal to 2; a second processing unit, configured to determine each grouping identifier corresponding to the time according to the time and the grouping identifiers to which the respective user identifiers corresponding to the time belong, so that at least two second devices obtain at least one grouping identifier corresponding to the time; and send a second message based on the user identifiers included in the at least one grouping identifier, the second message being used to provide the service; wherein, the at least one grouping identifier obtained by different second devices is different; The obtaining unit is further configured to receive a first query request sent by a third device; the first query request is used to obtain a group identifier; if it is determined that the current time meets the preset service condition corresponding to the time, the obtaining unit sends each group identifier corresponding to the time to the third device, so that the third device writes the received group identifier into the message queue corresponding to the time; at least two second devices obtain at least one group identifier corresponding to the time from the message queue corresponding to the time.
12. A service processing device characterized in that the device is applied to a second device, and the device includes: an obtaining module, configured to obtain at least one group identifier corresponding to a target time from a first device; wherein, the at least one group identifier is determined according to a preset grouping value, and the preset grouping value is a positive integer greater than or equal to 2; a processing module, configured to send a second message based on the user identifiers included in the at least one group identifier, where the second message is used to provide a service; wherein, at least one group identifier obtained by different second devices is different; wherein, the obtaining module is specifically configured to obtain at least one group identifier corresponding to the target time from the message queue corresponding to the target time; wherein, the message queue corresponding to the target time is that the third device sends a first query request to the first device; the first query request is used to obtain a group identifier; after receiving the first query request, if the first device determines that the current time meets the preset service condition corresponding to the target time, the first device sends each group identifier corresponding to the target time to the third device; the third device writes the received group identifier into the message queue corresponding to the target time.
13. An electronic device characterized in that the electronic device includes a processor, and the processor is configured to implement the steps of the service processing method as claimed in claim 9 or the steps of the service processing method as claimed in claim 10 when executing a computer program stored in a memory.
14. A computer-readable storage medium characterized in that it stores a computer program, and when the computer program is executed by a processor, it implements the steps of the service processing method as claimed in claim 9 or the steps of the service processing method as claimed in claim 10.
Citation Information
Patent Citations
Business request allocation method and device, computer equipment and storage medium
CN112131006A