Request processing method, device, electronic device and storage medium

By pre-creating multiple chat rooms and dynamically assigning users, the problem of incompatibility between real-time and completeness is solved when there are too many users in the chat room, achieving a balance between real-time and completeness, and reducing distribution pressure.

CN115987932BActive Publication Date: 2025-01-21BEIJING IQIYI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211634636.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-19
Publication Date
2025-01-21
Estimated Expiration
2042-12-19

AI Technical Summary

Technical Problem

When there are many chat rooms, real-time and integrity cannot be achieved. The message loss strategy is usually used to ensure real-time, which causes users to flush out their speeches and unable to view their speeches effectively. And when users send custom pictures, they will generate concurrent pulls of the same picture. The distribution pressure of pictures.

Method used

By pre-creating a preset second number of chat rooms and selecting a preset first number of chat rooms as active chat rooms, when receiving a chat room joining request, respond and assign the target user to the first active chat room, Avoid concentrating too many users in one chat room.

Benefits of technology

It ensures the real-time and completeness of chat room speeches, avoids the problem of screen swiping when users speak, and reduces the concurrent pull pressure when users send custom pictures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115987932B_ABST
    Figure CN115987932B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a request processing method, device, electronic device and storage medium, the method comprising: receiving a chat room joining request, and in response to the chat room joining request, determining the target user corresponding to the chat room joining request; and searching for the currently preset first number of chat rooms in use, and determining the first chat room in use from the preset first number of chat rooms in use; wherein the preset first number of chat rooms in use includes the preset first number of chat rooms selected from the pre-created preset second number of chat rooms; and assigning the target user to the first chat room in use. In this way, the user is split and assigned to the preset first number of chat rooms in use, and the user is unaware of it, which can ensure the real-time and integrity of the chat room speech, and avoid the problem of the user's speech swiping the screen and the user being unable to effectively view the speech. In addition, the user sends a custom picture, which reduces the distribution pressure of concurrently pulling the same picture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a request processing method, device, electronic device and storage medium. Background Art

[0002] Currently, many Internet websites provide chat room platforms, which open a chat room for users to log in and exchange information with each other. Of course, there are also many communication software that provide chat room functions, and also open a chat room for users to log in and exchange information with each other. Among them, the speech of a user in the chat room can be seen by other users, and there are many users in the chat room, and most of them are strangers.

[0003] When there are many users in the chat room, if too many users speak at the same time, real-time performance and integrity cannot be achieved at the same time. Usually, the message loss strategy is adopted to ensure real-time performance, and users' speeches fill the screen and users cannot effectively view their speeches. Furthermore, if users are supported to send custom pictures, the same picture will be pulled concurrently, causing distribution pressure. Summary of the invention

[0004] In order to solve the above-mentioned technical problem that when there are many users in the chat room and too many users speak at the same time, real-time and integrity cannot be achieved at the same time, and the message loss strategy is usually adopted to ensure real-time, and the user's speech is swiped on the screen, and the user cannot effectively view the speech. Furthermore, if users are supported to send custom pictures, the same picture will be pulled concurrently to generate distribution pressure. The embodiment of the present invention provides a request processing method, device, electronic device and storage medium. The specific technical solution is as follows:

[0005] In a first aspect of an embodiment of the present invention, a request processing method is first provided, the method comprising:

[0006] receiving a chat room joining request, and in response to the chat room joining request, determining a target user corresponding to the chat room joining request; and,

[0007] Searching for a preset first number of chat rooms in use, and determining a first chat room in use from the preset first number of chat rooms in use;

[0008] Wherein, the preset first number of chat rooms in use includes the preset first number of chat rooms selected from the pre-created preset second number of chat rooms;

[0009] The target user is assigned to the first active chat room.

[0010] In an optional implementation, before determining the first chat room in use from the preset first number of chat rooms in use, the method further includes:

[0011] Determining whether the target user has ever joined a second chat room in use, wherein the second chat room in use includes any one of the preset first number of chat rooms in use;

[0012] In the case that the target user has never joined the second chat room in use, the step of determining the first chat room in use from the preset first number of chat rooms in use is performed.

[0013] In an optional implementation, before determining the first chat room in use from the preset first number of chat rooms in use, the method further includes:

[0014] Obtaining the number of attempts of the target user to join the chat room, and determining whether the number of attempts is less than or equal to a preset number threshold;

[0015] When the number of attempts is less than or equal to the preset number threshold, the step of determining the first active chat room from the preset first number of active chat rooms is performed.

[0016] In an optional implementation, determining the first active chat room from the preset first number of active chat rooms includes:

[0017] Searching for an in-use chat room whose number of users does not exceed the chat room user number threshold and whose chat room identifier is the smallest from the preset first number of in-use chat rooms;

[0018] The chat room in use whose number of users does not exceed the chat room user number threshold and whose chat room identifier is the smallest is determined as the first chat room in use.

[0019] In an optional embodiment, the method further comprises:

[0020] If no in-use chat room whose number of users does not exceed the chat room user number threshold and whose chat room identifier is the smallest is found, searching for a spare chat room other than the in-use chat rooms of the preset first number in the pre-created preset second number of chat rooms;

[0021] Selecting a preset third number of standby chat rooms from the standby chat rooms;

[0022] Determining the preset third number of standby chat rooms as the preset third number of chat rooms in use, and determining a third chat room in use from the preset third number of chat rooms in use;

[0023] The target user is assigned to the third active chat room.

[0024] In an optional implementation, allocating the target user to the first active chat room includes:

[0025] Performing an auto-increment process on the number of users of the first chat room in use, and determining whether the number of users after the auto-increment exceeds a threshold value of the number of users of the chat room;

[0026] When the number of users after the self-increment does not exceed the threshold number of chat room users, the target user is allocated to the first chat room in use.

[0027] In an optional embodiment, the method further comprises:

[0028] When the number of users after the increase exceeds the threshold of the number of users in the chat room, the number of users after the increase is automatically reduced;

[0029] The number of attempts of the target user to join the chat room is automatically incremented, and the process jumps to the step of obtaining the number of attempts of the target user to join the chat room.

[0030] In an optional embodiment, the method further comprises:

[0031] If the target user has joined the second chat room in use, obtaining a time when the target user leaves the second chat room in use;

[0032] Counting the time between the departure time and the current time, and determining whether the departure time is greater than a preset departure time threshold;

[0033] When the absence duration is not greater than the preset absence duration threshold, assigning the target user to the second active chat room; and

[0034] The binding relationship between the target user and the second active chat room is maintained, and the leaving time is cleared.

[0035] In an optional embodiment, the method further comprises:

[0036] In the case where the absence time is greater than the preset absence time threshold, releasing the binding relationship between the target user and the second active chat room, and clearing the absence time; and

[0037] Jump to the step of determining a first active chat room from the preset first number of active chat rooms.

[0038] In an optional embodiment, the method further comprises:

[0039] When the number of attempts is greater than the preset number threshold, searching for a spare chat room other than the preset first number of chat rooms in use in the pre-created preset second number of chat rooms;

[0040] Selecting a preset fourth number of standby chat rooms from the standby chat rooms;

[0041] Determining the preset fourth number of standby chat rooms as the preset fourth number of chat rooms in use, and determining a fourth chat room in use from the preset fourth number of chat rooms in use;

[0042] The target user is assigned to the fourth active chat room.

[0043] In an optional embodiment, the method further comprises:

[0044] In the case where the number of the standby chat rooms is reduced, determining whether the number of the standby chat rooms is less than a preset chat room number threshold;

[0045] When the chat room quantity of the backup chat rooms is less than the preset chat room quantity threshold, a preset fifth number of backup chat rooms is created.

[0046] In a second aspect of an embodiment of the present invention, a request processing device is further provided, the device comprising:

[0047] A request receiving module, used for receiving a chat room joining request;

[0048] A user determination module is configured to determine, in response to the chat room joining request, a target user corresponding to the chat room joining request; and

[0049] A chat room search module, used to search for a preset first number of currently used chat rooms;

[0050] A chat room determination module, configured to determine a first chat room in use from the preset first number of chat rooms in use;

[0051] The preset first number of in-use chat rooms includes a preset first number of standby chat rooms selected from a preset second number of pre-created standby chat rooms;

[0052] The user allocation module is used to allocate the target user to the first active chat room.

[0053] In a third aspect of an embodiment of the present invention, there is further provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0054] Memory, used to store computer programs;

[0055] The processor is used to implement any request processing method described in the first aspect when executing a program stored in the memory.

[0056] In a fourth aspect of an embodiment of the present invention, a storage medium is further provided, wherein instructions are stored in the storage medium, and when the storage medium is run on a computer, the computer executes any one of the request processing methods described in the first aspect above.

[0057] In a fifth aspect of the embodiments of the present invention, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute any of the request processing methods described above.

[0058] The technical solution provided by the embodiment of the present invention receives a chat room joining request, responds to the chat room joining request, determines the target user corresponding to the chat room joining request, and searches for the currently preset first number of chat rooms in use, and determines the first chat room in use from the preset first number of chat rooms in use, wherein the preset first number of chat rooms in use includes the preset first number of chat rooms selected from the pre-created preset second number of chat rooms, and assigns the target user to the first chat room in use. By pre-creating the preset second number of chat rooms, and selecting the preset first number of chat rooms from the pre-created preset second number of chat rooms as the preset first number of chat rooms in use, when a chat room joining request is subsequently received, responds to the chat room joining request, determines the target user and the first chat room in use, and assigns the target user to the first chat room in use, so that the user is split and assigned to the preset first number of chat rooms in use, the user is unaware, and the real-time and integrity of the chat room speech can be ensured, and the problem of the user's speech swiping the screen and the user being unable to effectively view the speech is avoided. In addition, the user sends a custom picture, which reduces the distribution pressure of concurrently pulling the same picture. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0060] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0061] Figure 1 A schematic diagram of an implementation flow of a request processing method shown in an embodiment of the present invention;

[0062] Figure 2 It is a schematic diagram of an implementation flow of another request processing method shown in an embodiment of the present invention;

[0063] Figure 3A schematic diagram of an implementation flow of a user allocation method shown in an embodiment of the present invention;

[0064] Figure 4 It is a schematic diagram of an implementation flow of another user allocation method shown in an embodiment of the present invention;

[0065] Figure 5 It is a schematic diagram of an implementation flow of another user allocation method shown in an embodiment of the present invention;

[0066] Figure 6 It is a structural schematic diagram of a request processing device shown in an embodiment of the present invention;

[0067] Figure 7 It is a schematic diagram of the structure of another electronic device shown in an embodiment of the present invention. DETAILED DESCRIPTION

[0068] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0069] In an embodiment of the present invention, when there are many users in a chat room and too many users are speaking at the same time, real-time performance and integrity cannot be achieved at the same time. Usually, a message loss strategy is adopted to ensure real-time performance, and users' speeches fill the screen and users cannot effectively view their speeches. Furthermore, if users are supported to send custom pictures, the same picture will be pulled concurrently, causing distribution pressure.

[0070] Since all the above problems are caused by too many users, the embodiment of the present invention solves the above problems by limiting the number of people in the same chat room. Since it is a group chat among strangers, the users are not aware of the division of users. Therefore, multiple chat rooms are used in the same scene, and then the rule-based allocation method is used to allow users to have a window for communication, which can avoid the above problems.

[0071] Based on the above invention concept, Figure 1 FIG. 1 is a schematic diagram of an implementation flow of a request processing method provided by an embodiment of the present invention. The method is applied to a server and may specifically include the following steps:

[0072] S101, receiving a chat room joining request, and in response to the chat room joining request, determining a target user corresponding to the chat room joining request.

[0073] S102: Search for a preset first number of currently used chat rooms, and determine a first currently used chat room from the preset first number of currently used chat rooms.

[0074] In an embodiment of the present invention, when a scene (such as a live broadcast scene) is created, a batch of chat rooms are pre-created, that is, a preset second number of chat rooms are pre-created, and a preset first number of chat rooms are selected from the pre-created preset second number of chat rooms as the preset first number of chat rooms in use, and the remaining chat rooms in the pre-created preset second number of chat rooms except the preset first number of chat rooms are used as standby chat rooms.

[0075] For example, when a live broadcast scene is created, a batch of chat rooms are pre-created, such as 30 chat rooms, and 10 chat rooms are selected from the 30 pre-created chat rooms as 10 active chat rooms, and the remaining 20 chat rooms except the above 10 chat rooms in the 30 pre-created chat rooms are used as standby chat rooms. Each chat room has a corresponding ID, and the ID may exist in the form of a key, which is not limited in the embodiment of the present invention.

[0076] Based on this, when a user wants to speak live, he can send a chat room joining request through the client, so that the server can receive the chat room joining request and can perform the following operations in response to the chat room joining request: determine the target user corresponding to the chat room joining request; find the currently preset first number of chat rooms in use, and determine the first chat room in use from the preset first number of chat rooms in use. Here, the preset first number of chat rooms in use includes the preset first number of chat rooms selected from the pre-created preset second number of chat rooms.

[0077] For example, user A sends a chat room joining request through the client, so that the server can receive the chat room joining request and can perform the following operations in response to the chat room joining request: parse the relevant user information (such as user nickname, user name, user ID, etc.) carried in the chat room joining request, thereby determining the user A corresponding to the chat room joining request through the relevant user information; search for the current 10 chat rooms in use, and determine the first chat room in use from the 10 chat rooms in use, where the 10 chat rooms in use are 10 chat rooms selected from the pre-created 30 chat rooms, and the remaining 20 chat rooms are used as backup chat rooms.

[0078] S103: Allocate the target user to the first active chat room.

[0079] In the embodiment of the present invention, for a first chat room in use determined from a preset first number of chat rooms in use, the target user may be assigned to the first chat room in use.

[0080] For example, for the first active chat room determined from the 10 active chat rooms, ie, chat room 1 , user A may be assigned to chat room 1 , and user A may speak in chat room 1 from then on.

[0081] Through the above description of the technical solution provided by the embodiment of the present invention, a chat room joining request is received, and in response to the chat room joining request, a target user corresponding to the chat room joining request is determined, and the currently preset first number of chat rooms in use are searched, and a first chat room in use is determined from the preset first number of chat rooms in use, wherein the preset first number of chat rooms in use includes the preset first number of chat rooms selected from the pre-created preset second number of chat rooms, and the target user is assigned to the first chat room in use.

[0082] By pre-creating a preset second number of chat rooms, and selecting a preset first number of chat rooms from the pre-created preset second number of chat rooms as the preset first number of chat rooms in use, when a chat room joining request is subsequently received, in response to the chat room joining request, the target user and the first chat room in use are determined, and the target user is assigned to the first chat room in use. In this way, the users are split and assigned to the preset first number of chat rooms in use without the users' awareness, which ensures the real-time and integrity of the chat room speeches and avoids the problem of users' speeches swiping the screen and the users being unable to effectively view the speeches. In addition, users send custom pictures, which reduces the distribution pressure of concurrently pulling the same picture.

[0083] like Figure 2 FIG. 1 is a schematic diagram of an implementation flow of another request processing method provided by an embodiment of the present invention. The method is applied to a server and may specifically include the following steps:

[0084] S201, receiving a chat room joining request, and in response to the chat room joining request, determining a target user corresponding to the chat room joining request.

[0085] In the embodiment of the present invention, this step is similar to the above step S101, and the embodiment of the present invention will not be described in detail here.

[0086] S202, searching for a preset first number of chat rooms in use, and determining whether the target user has ever joined a second chat room in use, wherein the second chat room in use includes any one of the preset first number of chat rooms in use.

[0087] S203: If the target user has never joined the second chat room in use, obtain the number of attempts of the target user to join the chat room, and determine whether the number of attempts is less than or equal to a preset number threshold.

[0088] S204: When the number of attempts is less than or equal to the preset number threshold, searching for an active chat room whose number of users does not exceed the chat room user number threshold and whose chat room identifier is the smallest from a preset first number of active chat rooms.

[0089] S205: Determine the chat room in use whose number of users does not exceed the chat room user number threshold and whose chat room identifier is the smallest as the first chat room in use.

[0090] In an embodiment of the present invention, the currently preset first number of chat rooms in use is searched, wherein the preset first number of chat rooms in use includes the preset first number of chat rooms selected from the pre-created preset second number of chat rooms, meaning that the preset first number of chat rooms are selected from the pre-created preset second number of chat rooms as the preset first number of chat rooms in use, and the rest are used as standby chat rooms.

[0091] For a user, it is possible to temporarily leave a chat room. When the user wants to re-enter the chat room later, in order to ensure the consistency of context, the user needs to be assigned to the same chat room. Based on this, the embodiment of the present invention determines whether the target user has ever joined a second chat room in use, wherein the second chat room in use includes any one of the preset first number of chat rooms in use.

[0092] It should be noted that when a user leaves a chat room, the time at which the user leaves the chat room is recorded. Based on this, it is determined whether there is a time at which the target user leaves the second chat room in use. If so, it means that the target user has joined the second chat room in use. Otherwise, it means that the target user has not joined the second chat room in use. This is not limited in the embodiment of the present invention.

[0093] In the case that the target user has never joined the second active chat room, it means that the chat room joining request is a new chat room joining request rather than a chat room rejoining request. At this time, the number of attempts of the target user to join the chat room is obtained, and it is determined whether the number of attempts is less than or equal to the preset number threshold.

[0094] When the number of attempts is less than or equal to the preset number threshold, a chat room in use whose number of users does not exceed the chat room user number threshold and whose chat room identifier is the smallest can be searched from the preset first number of chat rooms in use, and the chat room in use whose number of users does not exceed the chat room user number threshold and whose chat room identifier is the smallest can be determined as the first chat room in use.

[0095] For example, determine whether the target user has ever joined a second active chat room, where the second active chat room includes any active chat room among a preset first number of active chat rooms. If the target user has never joined the second active chat room, obtain the number of attempts of the target user to join the chat room, and determine whether the number of attempts is less than or equal to 3.

[0096] When the number of attempts is less than or equal to 3, search for the chat room in use whose number of users does not exceed the chat room user number threshold (meaning it is not full) and whose chat room ID is the smallest from the preset first number of chat rooms in use, and determine the chat room in use whose number of users does not exceed the chat room user number threshold and whose chat room ID is the smallest as the first chat room in use.

[0097] It should be noted that the chat room in use whose number of users does not exceed the chat room user number threshold and whose chat room ID is the smallest is determined as the first chat room in use, and subsequent target users are assigned to the first chat room in use. This can ensure that when the number of people is small, new users will be assigned to the chat room in use with the smallest chat room ID (the premise of the smallest chat room ID is not met here. If it is full, it will not participate in the chat room ID comparison), which fully ensures that the popularity of the chat room in use is sufficient.

[0098] In addition, in the embodiment of the present invention, the user may temporarily leave the chat room. When the user wants to re-enter the chat room later, in order to ensure the consistency of context, the user needs to be assigned to the same chat room. Figure 3 FIG. 1 is a schematic diagram of an implementation flow of a user allocation method provided by an embodiment of the present invention. The method is applied to a server and may specifically include the following steps:

[0099] S301: If the target user has joined a second chat room in use, obtain a leaving time of the target user leaving the second chat room in use.

[0100] In an embodiment of the present invention, if the target user has joined the second chat room in use, it means that the user may have temporarily left the chat room and needs to rejoin the chat room again. At this time, the departure time of the target user leaving the second chat room in use is obtained. The departure time here is used to decide whether to allow the user to rejoin the second chat room in use.

[0101] It should be noted that when a user leaves a chat room, the time at which the user leaves the chat room is recorded. Therefore, when the user leaves a second chat room in use, the time at which the user leaves the second chat room in use is recorded to determine whether to allow the user to rejoin the chat room (i.e., the second chat room in use) that the user originally joined. This is not limited in this embodiment of the present invention.

[0102] S302, counting the time between the departure time and the current time, and determining whether the departure time is greater than a preset departure time threshold.

[0103] S303: When the absence time is not greater than a preset absence time threshold, assign the target user to a second active chat room.

[0104] S304, maintaining the binding relationship between the target user and the second active chat room, and clearing the leaving time.

[0105] In an embodiment of the present invention, the time between the leaving time and the current time is counted, and it is determined whether the leaving time is greater than a preset leaving time threshold. If the leaving time is not greater than the preset leaving time threshold, it indicates that the target user temporarily leaves the second chat room in use and re-enters within a given time. At this time, the target user can be assigned to the second chat room in use, and the binding relationship between the target user and the second chat room in use is maintained, and the leaving time is cleared.

[0106] It should be noted that the binding relationship between the target user and the second chat room in use is maintained and the leaving time is cleared, the purpose of which is to prevent the target user from being cleared out of the second chat room in use. In addition, if the target user temporarily leaves the second chat room in use and re-enters within a given time, the personnel in the second chat room in use will always count the target user during this period, which is not limited in the embodiment of the present invention.

[0107] For example, the time interval between the target user's departure time from the second chat room in use and the current time is counted, and it is determined whether the departure time is greater than 1 minute. If the departure time is not greater than 1 minute, it means that the target user temporarily leaves the second chat room in use and re-enters within a given time. At this time, the target user can be assigned to the second chat room in use, and the binding relationship between the target user and the second chat room in use is maintained, and the departure time is cleared.

[0108] S305: When the absence time is greater than a preset absence time threshold, the binding relationship between the target user and the second active chat room is released, and the absence time is cleared.

[0109] S306, jump to the step of determining a first active chat room from a preset first number of active chat rooms.

[0110] In an embodiment of the present invention, when the absence time is greater than a preset absence time threshold, it indicates that the target user has not re-entered within a given time, and at this time, it is deemed that the user has never joined the chat room in use. Thus, the binding relationship between the target user and the second chat room in use is released, the absence time is cleared, and the process jumps to the step of determining the first chat room in use from a preset first number of chat rooms in use.

[0111] It should be noted that, in addition to releasing the binding relationship between the target user and the second chat room in use and clearing the absence time, the number of people in the second chat room in use may also be reduced, that is, reduced by 1, which is not limited in the embodiment of the present invention.

[0112] In addition, in an embodiment of the present invention, when a user attempts to join a chat room a certain number of times, in order to ensure that the user can join the chat room normally, a certain number of standby chat rooms can be selected from the standby chat rooms and converted into active chat rooms, so that the user can be assigned to the active chat room.

[0113] Based on this, Figure 4 FIG. 1 is a schematic diagram of an implementation flow of another user allocation method provided by an embodiment of the present invention. The method is applied to a server and may specifically include the following steps:

[0114] S401: When the number of attempts is greater than a preset number threshold, search for a spare chat room other than a preset first number of chat rooms in use in a preset second number of pre-created chat rooms.

[0115] In the embodiment of the present invention, when the number of attempts is greater than the preset number threshold, it means that multiple consecutive allocations have failed. At this time, a backup chat room other than the preset first number of chat rooms in use in the pre-created preset second number of chat rooms can be searched.

[0116] For example, when the number of attempts is greater than 3, it means that at least 3 consecutive allocations have failed. At this time, 20 spare chat rooms other than the 10 chat rooms in use among the 30 pre-created chat rooms can be searched.

[0117] S402: Select a preset fourth number of backup chat rooms from the backup chat rooms.

[0118] In the embodiment of the present invention, for the backup chat rooms, a preset fourth number of backup chat rooms can be selected from the backup chat rooms. The preset fourth number can be consistent with the preset first number, which is not limited in the embodiment of the present invention.

[0119] For example, for 20 standby chat rooms excluding 10 chat rooms in use among the pre-created 30 chat rooms, 10 standby chat rooms are selected from the 20 standby chat rooms excluding 10 chat rooms in use among the pre-created 30 chat rooms.

[0120] It should be noted that a preset fourth number of standby chat rooms with the smallest chat room IDs may be selected from the standby chat rooms, for example, 10 standby chat rooms with the smallest chat room IDs may be selected from the standby chat rooms, which is not limited in this embodiment of the present invention.

[0121] S403: Determine a preset fourth number of standby chat rooms as a preset fourth number of chat rooms in use, and determine a fourth chat room in use from the preset fourth number of chat rooms in use.

[0122] S404: Allocate the target user to the fourth active chat room.

[0123] In the embodiment of the present invention, the preset fourth number of standby chat rooms are determined as the preset fourth number of active chat rooms, and the fourth active chat room is determined from the preset fourth number of active chat rooms, so that the target user can be assigned to the fourth active chat room.

[0124] Among them, the chat room in use that is not full and has the smallest chat room identifier can be selected from the preset fourth number of chat rooms in use, and the chat room in use that is not full and has the smallest chat room identifier can be determined as the fourth chat room in use, which is not limited in this embodiment of the present invention.

[0125] In addition, when all the chat rooms in use are allocated, a certain number of spare chat rooms are selected from the spare chat rooms as the chat rooms in use to ensure that users can join the chat rooms normally. Figure 5 FIG. 1 is a schematic diagram of an implementation flow of another user allocation method provided by an embodiment of the present invention. The method is applied to a server and may specifically include the following steps:

[0126] S501: When no active chat room whose number of users does not exceed the chat room user number threshold and whose chat room ID is the smallest is found, search for a spare chat room other than the preset first number of active chat rooms in the pre-created preset second number of chat rooms.

[0127] In the embodiment of the present invention, when no active chat room is found whose number of users does not exceed the chat room user number threshold and whose chat room ID is the smallest, it means that all active chat rooms have been allocated. At this time, a search can be made for a spare chat room other than the active chat rooms of the preset first number in the pre-created preset second number of chat rooms.

[0128] For example, if no active chat room with a minimum chat room ID is found, it means that all 10 active chat rooms have been allocated. At this time, 20 standby chat rooms other than the 10 active chat rooms among the pre-created 30 chat rooms can be searched.

[0129] S502: Select a preset third number of standby chat rooms from the standby chat rooms.

[0130] In the embodiment of the present invention, for the backup chat rooms, a preset third number of backup chat rooms can be selected from the backup chat rooms. The preset third number can be consistent with the preset first number, which is not limited in the embodiment of the present invention.

[0131] For example, for 20 standby chat rooms excluding 10 chat rooms in use among the pre-created 30 chat rooms, 10 standby chat rooms are selected from the 20 standby chat rooms excluding 10 chat rooms in use among the pre-created 30 chat rooms.

[0132] It should be noted that a preset third number of standby chat rooms with the smallest chat room IDs may be selected from the standby chat rooms, for example, 10 standby chat rooms with the smallest chat room IDs may be selected from the standby chat rooms, which is not limited in the embodiment of the present invention.

[0133] S503: Determine a preset third number of standby chat rooms as a preset third number of active chat rooms, and determine a third active chat room from the preset third number of active chat rooms.

[0134] S504: Allocate the target user to a third active chat room.

[0135] In the embodiment of the present invention, the preset third number of standby chat rooms are determined as the preset third number of active chat rooms, and the third active chat room is determined from the preset third number of active chat rooms, so that the target user can be assigned to the third active chat room.

[0136] Among them, the chat room in use that is not full and has the smallest chat room identifier can be selected from the preset third number of chat rooms in use, and the chat room in use that is not full and has the smallest chat room identifier can be determined as the third chat room in use, which is not limited in this embodiment of the present invention.

[0137] In addition, in an embodiment of the present invention, the number of backup chat rooms can also be monitored asynchronously. When the number of backup chat rooms decreases, it is determined whether the number of backup chat rooms is less than a preset chat room number threshold. When the number of backup chat rooms is less than the preset chat room number threshold, a preset fifth number of backup chat rooms is created.

[0138] It should be noted that when the number of spare chat rooms decreases, asynchronous detection is triggered to check whether the number is sufficient. If not, the spare chat rooms are replenished to prevent the chat rooms from being consumed. Because chat room creation is a relatively heavy operation, it is not suitable to create it when needed, which affects performance.

[0139] S206: Perform an auto-increment process on the number of users in the first chat room in use, and determine whether the number of users after the auto-increment exceeds a threshold value of the number of users in the chat room.

[0140] S207: When the number of users after the self-increment does not exceed the threshold number of chat room users, the target user is allocated to the first chat room in use.

[0141] In the embodiment of the present invention, the number of users in the first chat room in use is automatically incremented, which means that the number of users in the first chat room in use is automatically incremented, for example, by 1, and it is determined whether the number of users after the automatic increment exceeds the threshold number of chat room users. If the number of users after the automatic increment does not exceed the threshold number of chat room users, the target user is allocated to the first chat room in use.

[0142] It should be noted that before the target user is assigned to the first chat room in use, the number of users in the first chat room in use is automatically incremented. If the number of users after the automatic increment does not exceed the chat room user number threshold, the target user is assigned to the first chat room in use. This is done in consideration of concurrency, and the embodiment of the present invention does not limit this.

[0143] S208: When the number of users after the increase exceeds the threshold of the number of chat room users, the number of users after the increase is decremented.

[0144] S209, increment the number of attempts of the target user to join the chat room, and jump to the step of obtaining the number of attempts of the target user to join the chat room.

[0145] In an embodiment of the present invention, when the number of users after self-increment exceeds the threshold value of the number of chat room users, it means that the target user cannot be allocated to the first chat room in use, and a self-decrement process is performed on the number of users after self-increment, which means that the number of users in the first chat room in use is decremented, for example, by 1, and the number of attempts of the target user to join the chat room is self-incremented, and the process jumps to the step of obtaining the number of attempts of the target user to join the chat room to complete the reallocation of the target user.

[0146] A preset second number of chat rooms are pre-created, and a preset first number of chat rooms are selected from the pre-created preset second number of chat rooms as the preset first number of chat rooms in use. Subsequently, when a chat room joining request is received, in response to the chat room joining request, a target user is determined and it is determined whether the target user has ever joined the second chat room in use. If the target user has never joined the second chat room in use, the number of attempts of the target user to join the chat room is obtained, and it is determined whether the number of attempts is less than or equal to a preset number threshold. If the number of attempts is less than or equal to the preset number threshold, the user is searched from the preset first number of chat rooms in use. The chat room in use whose number does not exceed the chat room user number threshold and whose chat room identifier is the smallest is taken as the first chat room in use, and the number of users in the first chat room in use is incremented, and it is determined whether the number of users after the increment exceeds the chat room user number threshold. If the number of users after the increment does not exceed the chat room user number threshold, the target user is assigned to the first chat room in use. If the number of users after the increment exceeds the chat room user number threshold, the number of users after the increment is decremented, the number of attempts of the target user to join the chat room is incremented, and the process jumps to the step of obtaining the number of attempts of the target user to join the chat room.

[0147] In this way, users are split and assigned to a preset first number of chat rooms in use. Users are unaware of this, which can ensure the real-time and integrity of chat room speeches, and avoid the problem of users' speeches swiping the screen and users being unable to effectively view their speeches. In addition, users send custom pictures, which reduces the distribution pressure of concurrently pulling the same picture. And in the case where users temporarily leave the chat room in use, users can be assigned to the same chat room to ensure context consistency. In addition, it can be ensured that when the number of people is small, new users will be assigned to the chat room in use with the smallest chat room identifier, fully ensuring that the popularity of the chat room in use is sufficient. Furthermore, the number of users in the first chat room in use is automatically increased. When the number of users after the automatic increase does not exceed the chat room user number threshold, the target user is assigned to the first chat room in use. This is done to take into account the concurrency situation.

[0148] Corresponding to the above method embodiment, the embodiment of the present invention also provides a request processing device, such as Figure 6 As shown, the apparatus may include: a request receiving module 610 , a user determining module 620 , a chat room searching module 630 , a chat room determining module 640 , and a user allocating module 650 .

[0149] A request receiving module 610, for receiving a chat room joining request;

[0150] The user determination module 620 is used to determine a target user corresponding to the chat room joining request in response to the chat room joining request; and

[0151] A chat room search module 630, used to search for a preset first number of currently used chat rooms;

[0152] A chat room determination module 640, configured to determine a first chat room in use from the preset first number of chat rooms in use;

[0153] Wherein, the preset first number of chat rooms in use includes the preset first number of chat rooms selected from the pre-created preset second number of chat rooms;

[0154] The user allocation module 650 is configured to allocate the target user to the first active chat room.

[0155] The embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes a processor 71, a communication interface 72, a memory 73 and a communication bus 74, wherein the processor 71, the communication interface 72, and the memory 73 communicate with each other through the communication bus 74.

[0156] A memory 73, for storing computer programs;

[0157] The processor 71 is used to execute the program stored in the memory 73 to implement the following steps:

[0158] Receive a chat room joining request, and in response to the chat room joining request, determine a target user corresponding to the chat room joining request; and search for a currently preset first number of chat rooms in use, and determine a first chat room in use from the preset first number of chat rooms in use; wherein the preset first number of chat rooms in use includes a preset first number of chat rooms selected from a preset second number of chat rooms pre-created; and assign the target user to the first chat room in use.

[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. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one 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 is used for communication between the above electronic device and other devices.

[0161] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0162] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0163] In another embodiment of the present invention, a storage medium is provided. The storage medium stores instructions. When the storage medium is executed on a computer, the computer executes the request processing method described in any one of the above embodiments.

[0164] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the request processing method described in any one of the above embodiments.

[0165] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a storage medium, or transmitted from one storage medium to another storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0166] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0167] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0168] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A request processing method, characterized in that: The method comprises: receiving a chat room joining request, and in response to the chat room joining request, determining a target user corresponding to the chat room joining request; and, Searching for a preset first number of chat rooms in use, and determining a first chat room in use from the preset first number of chat rooms in use; Wherein, the preset first number of chat rooms in use includes the preset first number of chat rooms selected from the pre-created preset second number of chat rooms; Assigning the target user to the first in-use chat room; Before determining the first chat room in use from the preset first number of chat rooms in use, the method further includes: Determining whether the target user has ever joined a second chat room in use, wherein the second chat room in use includes any one of the preset first number of chat rooms in use; In the case that the target user has never joined the second chat room in use, executing the step of determining the first chat room in use from the preset first number of chat rooms in use; Before determining the first chat room in use from the preset first number of chat rooms in use, the method further includes: Obtaining the number of attempts of the target user to join the chat room, and determining whether the number of attempts is less than or equal to a preset number threshold; When the number of attempts is less than or equal to the preset number threshold, performing the step of determining the first chat room in use from the preset first number of chat rooms in use; When the number of attempts is greater than the preset number threshold, searching for a spare chat room other than the preset first number of chat rooms in use in the pre-created preset second number of chat rooms; Selecting from the standby chat rooms a standby chat room that does not exceed the chat room user number threshold and has the smallest chat room identifier as a preset fourth number of standby chat rooms; The preset fourth number of standby chat rooms is determined as the preset fourth number of chat rooms in use, and a fourth chat room in use is determined from the preset fourth number of chat rooms in use, and the target user is assigned to the fourth chat room in use.

2. The method according to claim 1, characterized in that The determining the first chat room in use from the preset first number of chat rooms in use comprises: Searching for an in-use chat room whose number of users does not exceed the chat room user number threshold and whose chat room identifier is the smallest from the preset first number of in-use chat rooms; The chat room in use whose number of users does not exceed the chat room user number threshold and whose chat room identifier is the smallest is determined as the first chat room in use.

3. The method according to claim 2, characterized in that The method further comprises: If no in-use chat room whose number of users does not exceed the chat room user number threshold and whose chat room identifier is the smallest is found, searching for a spare chat room other than the in-use chat rooms of the preset first number in the pre-created preset second number of chat rooms; Selecting a preset third number of standby chat rooms from the standby chat rooms; Determining the preset third number of standby chat rooms as the preset third number of chat rooms in use, and determining a third chat room in use from the preset third number of chat rooms in use; The target user is assigned to the third active chat room.

4. The method according to claim 1, characterized in that The step of allocating the target user to the first active chat room includes: Performing an auto-increment process on the number of users of the first chat room in use, and determining whether the number of users after the auto-increment exceeds a threshold value of the number of users of the chat room; When the number of users after the self-increment does not exceed the threshold number of chat room users, the target user is allocated to the first chat room in use.

5. The method according to claim 4, characterized in that The method further comprises: When the number of users after the increase exceeds the threshold of the number of users in the chat room, the number of users after the increase is automatically reduced; The number of attempts of the target user to join the chat room is automatically incremented, and the process jumps to the step of obtaining the number of attempts of the target user to join the chat room.

6. The method according to claim 1, characterized in that The method further comprises: If the target user has joined the second chat room in use, obtaining a time when the target user leaves the second chat room in use; Counting the time between the departure time and the current time, and determining whether the departure time is greater than a preset departure time threshold; When the absence time is not greater than the preset absence time threshold, assigning the target user to the second active chat room; and The binding relationship between the target user and the second active chat room is maintained, and the leaving time is cleared.

7. The method according to claim 6, characterized in that The method further comprises: In the case where the absence time is greater than the preset absence time threshold, releasing the binding relationship between the target user and the second active chat room, and clearing the absence time; and Jump to the step of determining a first active chat room from the preset first number of active chat rooms.

8. The method according to claim 3 or 1, characterized in that: The method further comprises: In the case where the number of the standby chat rooms is reduced, determining whether the number of the standby chat rooms is less than a preset chat room number threshold; When the chat room quantity of the standby chat rooms is less than the preset chat room quantity threshold, a preset fifth number of standby chat rooms is created.

9. A request processing device, characterized in that: The device comprises: A request receiving module, used for receiving a chat room joining request; A user determination module is configured to determine, in response to the chat room joining request, a target user corresponding to the chat room joining request; and A chat room search module, used to search for a preset first number of currently used chat rooms; A chat room determination module, configured to determine a first chat room in use from the preset first number of chat rooms in use; Wherein, the preset first number of chat rooms in use includes the preset first number of chat rooms selected from the pre-created preset second number of chat rooms; Before determining the first chat room in use from the preset first number of chat rooms in use, the method further includes: Determining whether the target user has ever joined a second chat room in use, wherein the second chat room in use includes any one of the preset first number of chat rooms in use; In the case that the target user has never joined the second chat room in use, executing the step of determining the first chat room in use from the preset first number of chat rooms in use; Before determining the first chat room in use from the preset first number of chat rooms in use, the method further includes: Obtaining the number of attempts of the target user to join the chat room, and determining whether the number of attempts is less than or equal to a preset number threshold; When the number of attempts is less than or equal to the preset number threshold, performing the step of determining the first chat room in use from the preset first number of chat rooms in use; When the number of attempts is greater than the preset number threshold, searching for a spare chat room other than the preset first number of chat rooms in use in the pre-created preset second number of chat rooms; Selecting from the standby chat rooms a standby chat room that does not exceed the chat room user number threshold and has the smallest chat room identifier as a preset fourth number of standby chat rooms; Determine the preset fourth number of standby chat rooms as the preset fourth number of chat rooms in use, determine a fourth chat room in use from the preset fourth number of chat rooms in use, and assign the target user to the fourth chat room in use; The user allocation module is used to allocate the target user to the first active chat room.

10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 8 when executing a program stored in a memory.

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

Citation Information

Patent Citations

  • Chat room offline processing method and system for improving user experience

    CN110460637A

  • Virtual chat rooms

    US20170339081A1