Account grouping adjustment method and device, storage medium and electronic device
By adjusting the number of account groups and service combinations in the game server chat channel, the problem of excessive access was solved, load balancing was achieved, and the processing efficiency of the chat service was improved.
Patent Information
- Application Number
- CN202211336861.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-28
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2042-10-28
AI Technical Summary
In the game server's chat channels, some account groups experienced excessive access, leading to an unbalanced load, a problem that current technologies have not been able to effectively resolve.
By obtaining the access volume of account groups within a preset time period, the number of account groups is adjusted to meet the target access volume conditions, ensuring that the access volume of each account group is balanced, and caching and reading operations are performed using independent service groups.
This implemented load balancing for account groups, reducing the problem of excessive access and improving the processing efficiency of the chat service.
Smart Images

Figure CN116999861B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a method and apparatus for adjusting account groups, a storage medium, and an electronic device. Background Technology
[0002] To ensure the normal operation of different applications, application servers typically need to have a variety of services with different functions to support the operation of the applications. For example, during the operation of a game server program, its main functions are carried by several services with different functions and their corresponding service entities. Among them, the chat service is one of the important functional services, which mainly carries the social and interactive functions of players.
[0003] As the gaming industry continues to expand, the computational complexity and network load of game servers are gradually increasing. During the online operation and service provision of game servers, chat services, due to their large data throughput and the significant amount of player-customized content, have always been one of the key challenges in game server development.
[0004] In related technologies, the main service of the game server is typically used to handle message sending and reading in the chat channel. Accounts within the game application's chat channel are pre-divided into a fixed number of account groups, and each account group has a fixed capacity for access. When the number of messages in the chat channel increases dramatically, the access volume of some account groups within that chat channel will also increase, leading to the technical problem of excessive access volume for some account groups within the chat channel.
[0005] There is currently no effective solution to the above problems. Summary of the Invention
[0006] This application provides a method, apparatus, storage medium, and electronic device for adjusting account groups, in order to at least solve the technical problem of excessive access volume to account groups in a target message channel.
[0007] According to one aspect of the embodiments of this application, a method for adjusting account groups is provided, comprising: obtaining the access volume of N account groups within a preset time period to obtain N access volumes, wherein accounts in a target message channel of a target application are divided into N account groups, N is 1 or a positive integer greater than or equal to 2, each access volume represents the cached data volume and read data volume generated by the corresponding account group, the cached data volume is the data volume used to cache messages sent by the account group, and the read data volume is the data volume used to read messages sent by the cached account group; and searching for access volumes in the N account groups based on the N access volumes. The query identifies account groups whose access volume does not meet the target access volume condition. The target access volume condition is used to trigger an adjustment of the number of account groups in the target message channel if it is not met. If an account group whose access volume does not meet the target access volume condition is found, the number of account groups in the target message channel is adjusted from N account groups to M account groups, where M is a positive integer different from N. The access volume of the M account groups meets the target access volume condition within a preset time period. Messages sent by accounts in each account group in the target message channel are allowed to be read by accounts in the same account group, but are prohibited from being read by accounts in different account groups.
[0008] Optionally, the above-mentioned method of finding account groups whose visit volume does not meet the target visit volume condition among N account groups based on N visit volumes includes: finding account groups whose visit volume meets a first visit volume condition among N account groups based on N visit volumes, wherein the first visit volume condition is used to trigger an increase in the number of account groups in the target message channel when it is met; if an account group whose visit volume meets the first visit volume condition is found, the found account group whose visit volume meets the first visit volume condition is determined as an account group whose visit volume does not meet the target visit volume condition; finding account groups whose visit volume meets a second visit volume condition among N account groups based on N visit volumes, wherein the second visit volume condition is used to trigger a decrease in the number of account groups in the target message channel when it is met; if an account group whose visit volume meets the second visit volume condition is found, the found account group whose visit volume meets the second visit volume condition is determined as an account group whose visit volume does not meet the target visit volume condition.
[0009] Optionally, the above-mentioned method of finding account groups whose access volume meets the first access volume condition among N account groups based on N access volumes includes: performing the following steps for the i-th account group among the N account groups, where 1≤i≤N: if the access volume of the i-th account group includes P access volumes, searching for access volumes greater than a preset first access volume threshold among the P access volumes, where P access volumes are the access volumes of the i-th account group within P sub-durations, the preset duration includes P sub-durations, and P is 1 or a positive integer greater than or equal to 2; if the number of times access volumes greater than the first access volume threshold are found is greater than or equal to a preset first number of times threshold, the i-th account group is determined as the account group whose access volume meets the first access volume condition.
[0010] Optionally, the above-mentioned method of finding account groups whose access volume meets the second access volume condition among N account groups based on N access volumes includes: performing the following steps for the i-th account group among the N account groups, where 1≤i≤N: if the access volume of the i-th account group includes P access volumes, searching for access volumes less than a preset second access volume threshold among the P access volumes, where P access volumes are the access volumes of the i-th account group within P sub-durations, the preset duration includes P sub-durations, and P is 1 or a positive integer greater than or equal to 2; if the number of times access volumes less than the second access volume threshold are found is greater than or equal to the preset second number threshold and N is greater than 1, then the i-th account group is determined as the account group whose access volume meets the second access volume condition.
[0011] Optionally, when an account group whose access volume does not meet the target access volume condition is found, adjusting the number of accounts in the target message channel from N account groups to M account groups includes: if an account group whose access volume meets the first access volume condition is found among the N account groups, increasing the number of accounts in the target message channel from N account groups to M account groups, where M is a positive integer greater than N; or if an account group whose access volume meets the first access volume condition is found among the N account groups and N is less than a first preset number threshold, increasing the number of accounts in the target message channel from N account groups to M account groups, where M is a positive integer greater than N; or if an account group whose access volume meets the first access volume condition is found among the N account groups and N is greater than or equal to a first preset number threshold, increasing the number of accounts in the target message channel from N account groups to M account groups, where M is a positive integer greater than N; or if an account group whose access volume meets the first access volume condition is found among the N account groups and N is greater than or equal to a first preset number threshold, increasing the number of accounts in the target message channel from N account groups to M account groups, where M is a positive integer greater than N; or if an account group whose access volume meets the first access volume condition is found among the N account groups and N is greater than or equal to a first preset number threshold, increasing the number of accounts in the target message channel from N account groups to M account groups. If the number of accounts in the target message channel is equal to the first preset threshold, the number of accounts in the target message channel will be increased from N account groups to M account groups according to a preset ratio, where M is a positive integer greater than N, and the difference between M and N is less than or equal to the product of the number of account groups whose access volume meets the first access volume condition and the preset ratio; or if an account group whose access volume meets the first access volume condition is found in the N account groups, and N is greater than or equal to the first preset threshold and less than or equal to the second preset threshold, the number of accounts in the target message channel will be increased from N account groups to M account groups according to a preset ratio, where M is a positive integer greater than N, and the difference between M and N is less than or equal to the product of the number of account groups whose access volume meets the first access volume condition and the preset ratio.
[0012] Optionally, increasing the number of accounts in the target message channel from N account groups to M account groups includes: re-dividing the accounts in the target message channel into M account groups; or, if the number of account groups that meet the first access volume condition is Q account groups and Q is a positive integer less than N, re-dividing the accounts in the Q account groups into R account groups, and determining the account groups other than the Q account groups and the R account groups in the N account groups as M account groups, where R is a positive integer greater than Q; or, if the number of account groups that meet the first access volume condition is Q account groups and Q is a positive integer less than N, re-dividing the accounts in the T account groups and the Q account groups into R account groups, and determining the account groups other than the Q account groups and the T account groups in the N account groups and the R account groups as M account groups, where R is a positive integer greater than (Q+T), and the T account groups are a subset of the account groups other than the Q account groups in the N account groups.
[0013] Optionally, when an account group whose access volume does not meet the target access volume condition is found, adjusting the accounts in the target message channel from N account groups to M account groups includes: when an account group whose access volume meets the second access volume condition is found in the N account groups, reducing the accounts in the target message channel from N account groups to M account groups, where M is a positive integer less than N.
[0014] Optionally, reducing the number of accounts in the target message channel from N account groups to M account groups includes: re-dividing the accounts in the target message channel into M account groups; or, if the number of account groups that meet the second access volume condition is Q account groups, and Q is a positive integer less than or equal to N, re-dividing the accounts in the Q account groups into R account groups, and determining the account groups other than the Q account groups and the R account groups from the N account groups as M account groups, where R is a positive integer less than Q; or, if the number of account groups that meet the second access volume condition is Q account groups, and Q is a positive integer less than or equal to N, re-dividing the accounts in the T account groups and the Q account groups into R account groups, and determining the account groups other than the Q account groups and the T account groups from the N account groups and the R account groups as M account groups, where R is a positive integer less than (Q+T), and the T account groups are a subset of the account groups other than the Q account groups from the N account groups.
[0015] Optionally, obtaining the access volume of N account groups within a preset time period to obtain N access volumes includes: obtaining the access volume of N account groups within a preset time period through the first group of services in the target application to obtain N access volumes, wherein the first group of services is independent of the main service of the target application, the first group of services is used to cache messages sent by accounts in the N account groups, and read the cached messages sent by accounts in the N account groups, and the main service is used to process the business logic of the target application; finding account groups whose access volume does not meet the target access volume condition in the N account groups based on the N access volumes includes: finding account groups whose access volume does not meet the target access volume condition in the N account groups through the first group of services; adjusting the accounts in the target message channel from N account groups to M account groups when an account group whose access volume does not meet the target access volume condition is found includes: adjusting the accounts in the target message channel from N account groups to M account groups through the first group of services and / or the main service when an account group whose access volume does not meet the target access volume condition is found.
[0016] Optionally, the above method further includes: when adjusting the accounts in the target message channel from N account groups to M account groups, configuring the first group of services to cache messages sent by accounts in the M account groups; or when adjusting the accounts in the target message channel from N account groups to M account groups, where M is a positive integer greater than N, adjusting the services deployed for the target message channel from the first group of services to the second group of services, wherein the second group of services is independent of the main service, the second group of services is used to cache messages sent by accounts in the M account groups, and to read the cached messages sent by accounts in the M account groups, and the number of services in the first group of services is less than the number of services in the second group of services; or when adjusting the accounts in the target message channel from N account groups to M account groups, where M is a positive integer less than N, adjusting the services deployed for the target message channel from the first group of services to the third group of services, wherein the third group of services is independent of the main service, the third group of services is used to cache messages sent by accounts in the M account groups, and the number of services in the first group of services is greater than the number of services in the third group of services.
[0017] Optionally, the above method further includes: obtaining a read message request sent by the target account in the target message channel, wherein the default message language in the target message channel is a mainstream language, and non-mainstream languages are languages different from the mainstream language; in response to the read message request, determining the second account group in which the target account belongs in the target message channel; obtaining the cached historical message set of the second account group, wherein the historical message set includes a message set in the mainstream language and a message set in the non-mainstream language; determining the message set to be transmitted in the historical message set according to the language type of the target account, wherein the language type of the target account indicates that the target account is an account using a mainstream language, or indicates that the target account is an account using a non-mainstream language; and sending the message set to be transmitted to the target account.
[0018] Optionally, determining the message set to be transmitted in the historical message set based on the language type of the target account includes: if the language type of the target account indicates that the target account is an account using a mainstream language, selecting a first number of mainstream language messages and a second number of non-mainstream language messages from the historical message set, wherein the first number is greater than the second number, and the message set to be transmitted includes the first number of mainstream language messages and the second number of non-mainstream language messages; if the language type of the target account indicates that the target account is an account using a non-mainstream language, selecting a third number of mainstream language messages and a fourth number of non-mainstream language messages from the historical message set, wherein the ratio of the first number to the second number is greater than the ratio of the third number to the fourth number, and the message set to be transmitted includes the third number of mainstream language messages and the fourth number of non-mainstream language messages.
[0019] Optionally, the above method further includes: obtaining the target message sent by the AI account controlled by the AI program in the target message channel; determining the first account group in the target message channel according to the identifier of the AI account, wherein the accounts in the first account group include the AI account and a group of user accounts; caching the target message sent by the AI account in the message queue corresponding to the first account group, wherein the message queue is used to cache the messages sent by each account in the first account group, and the messages cached in the message queue are set to be readable by at least a group of user accounts in the first account group.
[0020] According to another aspect of the embodiments of this application, an account grouping adjustment device is also provided, comprising: a first acquisition unit, configured to acquire the access volume of N account groups within a preset time period, thereby obtaining N access volumes, wherein accounts in the target message channel of the target application are divided into N account groups, N being 1 or a positive integer greater than or equal to 2, each access volume representing the cached data volume and read data volume generated by the corresponding account group, wherein the cached data volume is the data volume used to cache messages sent by the account group, and the read data volume is the data volume used to read messages sent by the cached account group; and a first processing unit, configured to adjust the N account groups according to the N access volumes. The first processing unit searches for account groups whose access volume does not meet the target access volume condition. The target access volume condition is used to trigger an adjustment of the number of account groups in the target message channel if it is not met. The second processing unit is used to adjust the number of account groups in the target message channel from N to M when an account group whose access volume does not meet the target access volume condition is found. Here, M is a positive integer different from N. The access volume of the M account groups meets the target access volume condition within a preset time period. Messages sent by accounts in each account group in the target message channel are allowed to be read by accounts in the same account group, but are prohibited from being read by accounts in different account groups.
[0021] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, which is configured to execute the above-described account grouping adjustment method when running.
[0022] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0023] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the account grouping adjustment method through the computer program.
[0024] Through the embodiments provided in this application, based on the N access volumes of N account groups within a preset time period, account groups whose access volumes do not meet the target access volume condition are identified, and the accounts in the target message channel are adjusted from N account groups to M account groups. In other words, when the access volumes of some account groups in the N account groups do not meet the target access volume condition, by adjusting the number of account groups, the access volumes of the adjusted M account groups all meet the target access volume condition within the preset time period. In particular, when the access volumes of some account groups that do not meet the target access volume condition increase dramatically, by adjusting the number of account groups, the access volumes of some account groups are reduced, solving the problem of excessive access volumes of account groups in the target message channel, and achieving the technical effect of load balancing of account groups. Attached Figure Description
[0025] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0026] Figure 1 This is a schematic diagram illustrating an application scenario of an optional account grouping adjustment method according to an embodiment of this application;
[0027] Figure 2 This is a flowchart (a) of an optional account grouping adjustment method according to an embodiment of this application;
[0028] Figure 3 This is a schematic diagram of an optional target message input page according to an embodiment of this application;
[0029] Figure 4 This is a schematic diagram illustrating the sending and reading of messages between an optional main service and a microservice according to an embodiment of this application;
[0030] Figure 5 This is a schematic diagram of an optional account grouping adjustment strategy according to an embodiment of this application;
[0031] Figure 6 This is a schematic diagram (a) of an optional account grouping adjustment method according to an embodiment of this application;
[0032] Figure 7 This is a schematic diagram illustrating the relationship between an optional target message channel and an account group according to an embodiment of this application;
[0033] Figure 8 This is a flowchart (II) of an optional account grouping adjustment method according to an embodiment of this application;
[0034] Figure 9 This is a schematic diagram (II) of an optional account grouping adjustment method according to an embodiment of this application;
[0035] Figure 10 This is a schematic diagram (iii) of an optional account grouping adjustment method according to an embodiment of this application;
[0036] Figure 11 This is a schematic diagram of an optional message sent by a player according to an embodiment of this application;
[0037] Figure 12 This is a flowchart of an optional method for implementing non-mainstream language anti-interference according to an embodiment of this application;
[0038] Figure 13 This is an overall schematic diagram of an optional account grouping adjustment method according to an embodiment of this application;
[0039] Figure 14 This is a schematic diagram of an optional target message channel ID according to an embodiment of this application;
[0040] Figure 15 This is a schematic diagram illustrating the code implementation process of an optional fast consistent hash algorithm according to an embodiment of this application;
[0041] Figure 16 This is a schematic diagram of an optional account grouping adjustment device according to an embodiment of this application;
[0042] Figure 17 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of this application. Detailed Implementation
[0043] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0044] First, the terms used or related in the embodiments of this application are described as follows. It should be understood that the following description is one interpretation of the terms and not the only interpretation:
[0045] Service: A service is a function of a game server during operation that provides a service interface to the outside world. The service content includes logical functions, data processing, etc. As a relatively independent functional module, a service entity can be an independently running process, thread, lightweight coroutine, or a portion of its code logic. One service can correspond to multiple service entities.
[0046] Microservices: A single application is divided into a set of small services that coordinate and cooperate with each other to provide end-value to the user. Each service runs in its own independent process, and services communicate with each other using lightweight communication mechanisms (such as RPC, HTTP RESTful APIs, etc.). Microservices have advantages such as ease of deployment, ease of modification, good scalability, and low coupling.
[0047] Chat service: In this embodiment of the application, it refers to the player chat function embedded in the game. Players send messages (text, voice, emoticons, etc.) to the game server through the game client, and the game server pushes these messages to the designated chat target, or broadcasts them in the chat channel to all other game players who are following the message;
[0048] Chat Channels: Based on functionality, chat content is divided into different channels for sending and receiving, such as world channels, region channels, and language channels. Messages in each channel are independent and visible only within that channel. Game players can clearly see the channel they are speaking in;
[0049] Chat splitting: This involves splitting the same channel into separate streams to facilitate traffic allocation and load balancing. Messages on each split are independent and visible only to that specific stream. Game players are unaware of these splits.
[0050] Channel Mainstream Language / Non-Mainstream Language: Certain channels, such as regional channels or language channels, will set their mainstream language. For example, the mainstream language of an English channel is English. Chat messages in other languages are considered non-mainstream language messages. Non-mainstream language messages may have a certain impact on the message quality of this channel.
[0051] Game Main Service: The main logic server process of the game, mainly used to carry out the operation of the main game logic;
[0052] Message processing process: mainly used to handle the sending and receiving of chat messages, such as the server process chatsvr in games that specifically provides chat microservices.
[0053] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0054] According to one aspect of the embodiments of this application, a method for adjusting account groups is provided. As an optional implementation, the above-described method for adjusting account groups can be applied, but is not limited to, to applications such as... Figure 1 The application scenarios shown are as follows. In, for example... Figure 1 In the application scenario shown, terminal device 102 can communicate with server 106 via network 104, but is not limited to this. Server 106 can perform operations on database 108, such as write or read data operations. Terminal device 102 may include, but is not limited to, a human-computer interaction screen, a processor, and a memory. The human-computer interaction screen may be used to display target messages sent by accounts in the target message channel of the target application on terminal device 102, screens after channel switching, etc. The processor may be used to respond to the human-computer interaction operations, execute corresponding operations, or generate corresponding instructions and send the generated instructions to server 106. The memory is used to store relevant processing data, such as the access volume of N account groups within a preset time period, target access volume conditions, etc.
[0055] As an optional approach, the following steps in the account grouping adjustment method can be executed on server 106: Step S102, obtain the access volume of N account groups within a preset time period to obtain N access volumes, wherein the accounts in the target message channel of the target application are divided into N account groups, where N is 1 or a positive integer greater than or equal to 2, and each access volume represents the amount of cached data and read data generated by the corresponding account group. The amount of cached data is the amount of data used to cache the messages sent by the account group, and the amount of read data is the amount of data used to read the messages sent by the cached account group; Step S104, based on the N access volumes, adjust the access volume of the N accounts... In step S106, if an account group whose access volume does not meet the target access volume condition is found, the number of account groups in the target message channel is adjusted from N account groups to M account groups, where M is a positive integer different from N. The access volume of the M account groups meets the target access volume condition within a preset time period. Messages sent by accounts in each account group in the target message channel are allowed to be read by accounts in the same account group, but are prohibited from being read by accounts in different account groups.
[0056] Using the above method, when the access volume of some account groups in N account groups does not meet the target access volume condition, by adjusting the number of account groups, the access volume of the adjusted M account groups all meet the target access volume condition within a preset time period. In particular, when the access volume of some account groups that do not meet the target access volume condition increases sharply, by adjusting the number of account groups, the access volume of some account groups is reduced, thus solving the problem of excessive access volume of account groups in the target message channel and achieving the technical effect of load balancing of account groups.
[0057] To address the issue of excessive access volume to account groups within the target message channel, this application proposes a method for adjusting account groups. Figure 2 This is a flowchart of an account grouping adjustment method according to an embodiment of this application, the process including the following steps:
[0058] Step S202: Obtain the access volume of N account groups within a preset time period to obtain N access volumes. Among them, the accounts in the target message channel of the target application are divided into N account groups, where N is 1 or a positive integer greater than or equal to 2. Each access volume represents the amount of cached data and read data generated by the corresponding account group. The amount of cached data is the amount of data used to cache the messages sent by the account group, and the amount of read data is the amount of data used to read the messages sent by the cached account group.
[0059] To make the above account grouping adjustment method easier to understand, the embodiments of this application all use a game server as an example for explanation.
[0060] like Figure 3 As shown, suppose a player opens a chat window in the game and selects a corresponding chat channel to send a message. These chat channels include, but are not limited to, "World," "Region A," "Country B," and "EN." Players can switch channels through settings. Each channel corresponds to a specific classification standard; for example, "World" is a public channel for all players to speak together, "Region A" is a regional channel, "Country B" is a country / region channel, and "EN" is an English language channel.
[0061] For any chat channel selected by a player, it includes a certain number of players, and all accounts within the chat channel are divided into N account groups based on the player's account ID (UID). Players within each account group can chat with each other by sending and reading messages.
[0062] Step S204: Based on N access counts, find account groups in the N account groups whose access counts do not meet the target access count condition. The target access count condition is used to trigger an adjustment of the number of account groups in the target message channel if the access count is not met.
[0063] Step S206: If an account group whose access volume does not meet the target access volume condition is found, the accounts in the target message channel are adjusted from N account groups to M account groups, where M is a positive integer different from N. The access volume of the M account groups meets the target access volume condition within a preset time period. Messages sent by accounts in each account group in the target message channel are allowed to be read by accounts in the same account group, but are prohibited from being read by accounts in different account groups.
[0064] Suppose that the number of visits to an account group in 1 minute is V. Then V can be, but is not limited to, a set of data. For example, the number of visits to the account group is counted every 10 seconds, resulting in a total of 6 visits in 1 minute.
[0065] As an optional example, the above method of obtaining the access volume of N account groups within a preset time period yields N access volume data points, including:
[0066] The first set of services in the target application obtains the access volume of N account groups within a preset time period, resulting in N access volumes. The first set of services is independent of the main service of the target application. The first set of services is used to cache messages sent by accounts in the N account groups and read the cached messages sent by accounts in the N account groups. The main service is used to process the business logic of the target application.
[0067] Based on N visits, find account groups among N account groups whose visits do not meet the target visit volume condition, including: through the first group service, based on N visits, find account groups among N account groups whose visits do not meet the target visit volume condition;
[0068] If an account group is found whose access volume does not meet the target access volume condition, the accounts in the target message channel will be adjusted from N account groups to M account groups. This includes: if an account group is found whose access volume does not meet the target access volume condition, the accounts in the target message channel will be adjusted from N account groups to M account groups through the first group service and / or the main service.
[0069] The following is combined with Figure 4 Describe the specific process of sending and reading messages to players within an account group.
[0070] (a) Sending a message
[0071] like Figure 4 As shown, the game server is assumed to include, but is not limited to, a main service (game main service) for running game logic and a microservice for carrying chat functionality. The main service and the microservice (first group of services) are independent of each other and communicate with each other via HTTP or RPC.
[0072] like Figure 4 As shown in (a), assuming there are n players in the chat channel, and each player corresponds to a UID, when the identifier is UID... i Players in Figure 3 After entering chat message Mg1 in the input box shown and clicking the send button, chat message Mg1 will be identified by its UID. i The player's client sends the information to the game server's main service. The main service performs a series of asynchronous checks, such as profanity checks and language recognition. Then, the main service determines the final result based on the player's UID. i The data caching queue Q corresponding to account grouping 1-1 The calculation is performed, and then the chat message Mg1 is forwarded to one of the deployed microservices in the form of an HTTP / RPC request. The microservice finds the data cache queue Q corresponding to the channel and account group. 1-1 And cache the chat message Mg1 to the data cache queue Q. 1-1 middle.
[0073] It should be noted that player accounts UID1, UID2...UIDn can be divided into N account groups, and each account group corresponds to one data cache queue. Messages sent by accounts in each account group can only be read by accounts in the same account group and are prohibited from being read by accounts in different account groups.
[0074] Additionally, in the account UID i When sending a message, the main service will use the UID. i Locate the microservice 1 corresponding to the player's account group and notify microservice 1 to process the chat message Mg1 sent by the player.
[0075] (ii) Reading messages
[0076] like Figure 4 As shown in (b), assuming that during the game, the player will periodically read the chat data from various chat channels, the specific reading process includes: when account UID2 enters... Figure 3 When the chat page is displayed, the client containing account UID2 requests the main service to read the chat data for the corresponding channel. The main service then uses the account UID that sent the chat data to... i The data caching queue Q corresponding to account grouping 1-1 The calculation is performed and sent to the corresponding microservice 1 in the form of an HTTP / RPC request to read the data cache queue Q corresponding to the most recent account group. 1-1 The chat data Mg1 is stored in the system and then sent back to the client where the account UID2 is located, and the chat message Mg1 is displayed in the corresponding chat channel.
[0077] Obviously, it's easy to understand that the access volume for each account group includes both the amount of cached data generated and the amount of data read by that account group. For example, the data cache queue Q... 1-1 The amount of cached data and the amount of data read are the access volume of the corresponding account group.
[0078] It should be noted that when an account group whose access volume does not meet the target access volume condition is found, the entity that performs the adjustment of the accounts in the target message channel from N account groups to M account groups can be, but is not limited to, the first group service (microservice), the main service, or the first group service (microservice) and the main service.
[0079] For example, during the message reading phase, when the main service sends the client's request to the corresponding microservice via an HTTP / RPC request based on the player's UID, the microservice only sends back the channel ID and account group ID where the message was retrieved, without sending back the total number of account groups in the current chat channel. Therefore, if an account group whose access volume does not meet the target access volume condition is found and sent back to the main service, the microservice can adjust the number of account groups. Conversely, when the main service sends the client's request to the corresponding microservice via an HTTP / RPC request based on the player's UID, the microservice sends back not only the channel ID and account group ID where the message was retrieved, but also the total number of account groups in the current chat channel. Therefore, if an account group whose access volume does not meet the target access volume condition is found and sent back to the main service, the main service can adjust the number of account groups.
[0080] During the message reading phase, when the main service sends the client's request to the corresponding microservice via an HTTP / RPC request based on the player's UID, the microservice only sends back the channel ID where the message was retrieved, the account group ID, and the original total number of account groups to the main service. It does not send back the adjusted total number of account groups in the current chat channel to the main service. Therefore, when the microservice finds account groups whose access volume does not meet the target access volume condition and sends the results back to the main service, the main service and the microservice can jointly adjust the number of account groups.
[0081] Through the embodiments provided in this application, when the access volume of some account groups in N account groups does not meet the target access volume condition, by adjusting the number of account groups, the access volume of the adjusted M account groups all meet the target access volume condition within a preset time period. In particular, when the access volume of some account groups that do not meet the target access volume condition increases dramatically, by adjusting the number of account groups, the access volume of some account groups is reduced, thus solving the problem of excessive access volume of account groups in the target message channel and achieving the technical effect of load balancing of account groups.
[0082] As an optional example, the above method also includes:
[0083] If the accounts in the target message channel are adjusted from N account groups to M account groups, the first group of services is configured to cache messages sent by accounts in the M account groups; or
[0084] When the accounts in the target message channel are adjusted from N account groups to M account groups, where M is a positive integer greater than N, the services deployed for the target message channel are moved from the first group of services to the second group of services. The second group of services is independent of the main service. The second group of services is used to cache messages sent by accounts in the M account groups and to read messages sent by accounts in the cached M account groups. The number of services in the first group is less than the number of services in the second group; or
[0085] When the accounts in the target message channel are adjusted from N account groups to M account groups, where M is a positive integer less than N, the services deployed for the target message channel are adjusted from the first group of services to the third group of services. The third group of services is independent of the main service and is used to cache messages sent by accounts in the M account groups. The number of services in the first group of services is greater than the number of services in the third group of services.
[0086] In this application embodiment, a set of services deployed in the target message channel can be executed through a set of message processing processes, including but not limited to a set of message processing processes. The message processing processes are mainly used to carry out the function of sending and receiving chat messages. The message processing processes include, but are not limited to, server processes that provide chat microservices in games, such as message microservice processes (chatsvr).
[0087] For example, the first group of message microservice processes executes the first group of services, the second group of message microservice processes executes the second group of services, and the third group of message microservice processes executes the third group of services.
[0088] It is easy to understand that when an account group whose access volume does not meet the target access volume condition is found, the accounts in the target message channel are adjusted from N account groups to M account groups. The number of services in the first group of services (microservices) used to handle the chat function may change with the degree of change in the number of account groups.
[0089] For example, when M is greater than N, the number of services in the microservices increases; when M is less than N, the number of services in the first group of services decreases. In other words, the number of services in the first group increases as the number of account groups in the target message channel increases, and decreases as the number of account groups in the target message channel decreases. In other words, the number of services in the first group increases as the number of messages sent by the player increases, and decreases as the number of messages sent by the player decreases.
[0090] The number of message microservices in the first group changes with the number of services in the first group. For example, when the number of services in the first group increases, the number of message microservice processes in the first group also increases; when the number of services in the first group decreases, the number of message microservice processes in the first group also decreases.
[0091] It should be noted that if the difference between M and N is small, and if the services in the first group of services can be used to cache the messages sent by the accounts in the M account groups, then the number of services in the first group of services should remain unchanged.
[0092] By adopting the above method, the number of services in the first group of services used to cache messages sent by accounts in M account groups is dynamically adjusted according to the adjusted number of account groups. This ensures that each service (microservice) in the first group of services is kept within a reasonable range, avoids service crashes caused by sudden increases in data volume, and achieves load balancing of each microservice.
[0093] Furthermore, by adjusting the number of account groups, unused resources or space in the original service can be used as backups to better handle abnormal downtime. Additionally, more monitoring methods can be employed to detect problems early, and stateful service backups can be added, allowing stateful services to quickly switch to backup services in abnormal situations, reducing service loss.
[0094] As an optional example, the above method of finding account groups whose visit volume does not meet the target visit volume condition among N account groups based on N visit volume also includes:
[0095] Based on N access counts, find account groups among N account groups whose access counts meet the first access count condition. The first access count condition is used to trigger an increase in the number of account groups in the target message channel when it is met. If an account group whose access counts meet the first access count condition is found, the account group whose access counts meet the first access count condition is determined as an account group whose access counts do not meet the target access count condition.
[0096] Based on N access counts, search for account groups among N account groups whose access counts meet the second access count condition. The second access count condition is used to trigger a reduction in the number of account groups in the target message channel when it is met. If an account group whose access counts meet the second access count condition is found, then the account group whose access counts meet the second access count condition is identified as an account group whose access counts do not meet the target access count condition.
[0097] like Figure 5As shown, assuming that there are 2 out of 6 visits > 80k (configuration parameter), or 1 visit > 120k (configuration parameter), the visit volume of this account group within 1 minute is determined to meet the first visit volume condition; if there are 2 out of 6 visits < 80k (configuration parameter) and the number of account groups on this chat channel is greater than 1, the visit volume of this account group within 1 minute is determined to meet the second visit volume condition; otherwise, the visit volume of this account group within 1 minute is determined to meet the target visit volume condition.
[0098] When an account group meets either the first or second visitor count condition, the number of account groups in the chat channel will be adjusted from N to M. For example, when the first visitor count condition is met, the number of account groups will be increased; when the second visitor count condition is met, the number of account groups will be decreased. The implementation process of increasing or decreasing the number of account groups will be described in detail below with specific examples.
[0099] For example, such as Figure 6 As shown in (a), assume that the account IDs of the n players in the chat channel are UID1, UID2, ..., UID1. n Account group 1 includes 3 players with account identifiers UID1, UID2, and UID3, account group 2 includes 3 players with account identifiers UID4, UID5, and UID6, and so on.
[0100] Assuming the account identifier is UID i The player entered message Mg i At that time, the message Mg is calculated using a consistent hash algorithm. i The selected account is grouped as group 1, and message Mg is sent. i The data is cached in the data cache queue Q1. If, based on the target access volume condition and the first access volume condition, it is determined that the access volume of account group 1 meets the first access volume condition, then the number of account groups in the chat channel is increased. Figure 6 As shown in (b), account group 4 has been added.
[0101] For example, suppose UID3 sends message Mg i At that time, the message Mg is calculated using a consistent hash algorithm. i The selected account is grouped as group 1, and message Mg is sent. i Cache the message in the data cache queue Q1. i After caching to the data cache queue Q1, if the access volume of account group 1 meets the first access volume condition, then a new account group 4 is created, and UID3 and UID6 from the original group 1 are switched to the newly created account group 4; when UID3 sends message Mg i+1At that time, the message Mg is calculated using a consistent hash algorithm. i+1 If the selected account group is group 4, then message Mg will be sent. i+1 Cache it in the data storage queue Q4.
[0102] By adding account group 4, the number of visits to the adjusted account groups 1 through 4 within 1 minute meets the target number of visits.
[0103] Obviously, it is easy to understand that if, based on N access counts, a group of accounts is found among N account groups whose access counts satisfy both the first and second access count conditions, then the number of account groups in the target message channel is maintained.
[0104] It should be noted that, Figure 5 The target visit volume condition, the first visit volume condition, and the second visit volume condition shown are merely examples and are not intended to limit the scope of the application.
[0105] Through the embodiments provided in this application, when the access volume of some account groups in N account groups does not meet the target access volume condition, by adjusting the number of account groups, the access volume of the adjusted M account groups all meet the target access volume condition within a preset time period. In particular, when the access volume of some account groups that do not meet the target access volume condition increases dramatically, by adjusting the number of account groups, the access volume of some account groups is reduced, thus solving the problem of excessive access volume of account groups in the target message channel and achieving the technical effect of load balancing of account groups.
[0106] As an optional example, the above method of finding account groups whose visit counts meet the first visit count condition from N account groups based on N visit counts includes:
[0107] For the i-th account group out of N account groups, perform the following steps, where 1≤i≤N:
[0108] If the number of visits to the i-th account group includes P visits, find the number of visits that is greater than the preset first visit threshold in the P visits. Here, the number of visits to the i-th account group is the number of visits within P sub-durations. The preset duration includes P sub-durations, and P is 1 or a positive integer greater than or equal to 2.
[0109] If the number of visits exceeding the first visit threshold is greater than or equal to the preset first visit threshold, the i-th account group is determined as the account group whose visit volume meets the first visit condition.
[0110] like Figure 7As shown, suppose the accounts in a chat channel are divided into multiple different account groups (or multiple sub-lines). For example, the accounts in chat channel 1 are divided into 3 account groups (or 3 sub-lines).
[0111] like Figure 8 As shown, for each account group (each sub-line), assuming a preset duration of 1 minute, the access volume of that sub-line is counted every 10 seconds, resulting in a total of 6 accesses, i.e., P = 6. Using the Amperite dynamic sub-line algorithm, the steps to find the account group among N account groups (N sub-lines) whose access volume meets the first access volume condition are as follows:
[0112] For the i-th account group among the N account groups, perform the following steps, where 1≤i≤N, and the first access threshold can be, but is not limited to, a set of values, such as 80K, 120k; the first access threshold is also a set of values, such as 2 times, 1 time, etc.:
[0113] S802, proceed to expansion check 1;
[0114] S804, Lazy expansion, check if there are 2 or more instances of access volume greater than 80k (configuration parameter) in the 6 access volume. If so, proceed to step S808.
[0115] S806, Sensitive Extension: Check if there is one or more instances of access volume exceeding 120k (configuration parameter) out of the 6 accesses. If so, proceed to step S808.
[0116] S808, Enter Expansion Check 2: When the number of account groups in the chat channel is less than 10 (configuration parameter), enter the split-merge line result check and execute steps S810 to S812; or when the number of account groups in the chat channel is greater than 10 (configuration parameter) and less than 999 (configuration parameter), execute step S814, with a 30% (configuration parameter) probability of entering the split-merge line result check; the split-merge line result check can refer to steps S816 and S818;
[0117] S810: If the number of account groups in the chat channel is greater than 999 (configuration parameter), stop splitting and end the algorithm;
[0118] S812, determines whether the number of account groups in the chat channel is less than 10 (configuration parameter).
[0119] S814 has a 30% (configuration parameter) chance of entering the split-and-merge line result check;
[0120] S816, if the 30% expansion probability is not hit, execute no expansion processing, that is, keep the number of account groups unchanged;
[0121] S818 has been expanded, meaning the number of account groups has been increased.
[0122] By repeating steps S802-S818 above, the account groups that meet the first access volume condition among the N account groups can be determined. Based on this, it can be further determined how to adjust the number of account groups in the chat channel, for example, by increasing the number of account groups.
[0123] As an optional implementation, if an account group whose visit volume meets the first visit volume condition is found, the accounts in the chat channel are adjusted from N account groups to M account groups. Specifically, this includes:
[0124] If, among N account groups, an account group whose visit volume meets the first visit volume condition is found, the number of account groups in the target message channel is increased from N to M, where M is a positive integer greater than N; or
[0125] If, among N account groups, an account group whose access volume meets the first access volume condition is found, and N is less than the first preset threshold, the number of account groups in the target message channel is increased from N account groups to M account groups, where M is a positive integer greater than N; or
[0126] If, among N account groups, an account group whose access volume meets the first access volume condition is found, and N is greater than or equal to the first preset quantity threshold, the number of accounts in the target message channel is increased from N account groups to M account groups according to a preset ratio, where M is a positive integer greater than N, and the difference between M and N is less than or equal to the product of the number of account groups whose access volume meets the first access volume condition and the preset ratio; or
[0127] If an account group with access volume that meets the first access volume condition is found in N account groups, and N is greater than or equal to the first preset quantity threshold and less than or equal to the second preset quantity threshold, the number of accounts in the target message channel is increased from N account groups to M account groups according to a preset ratio, where M is a positive integer greater than N, and the difference between M and N is less than or equal to the product of the number of account groups with access volume that meets the first access volume condition and the preset ratio.
[0128] In this embodiment, when an account group whose access volume meets the first access volume condition is found, the adjustment of the original N account groups in the target message channel includes at least one of the following:
[0129] The explanation will be based on the first condition of having more than 80k visits twice within 1 minute and / or having more than 120k visits once within 1 minute.
[0130] (1) If an account group with more than 80k data points appears twice within one minute and / or more than 120k data points appears once within one minute, the number of account groups in the chat channel will be increased from N to M.
[0131] (2) By executing the above step S808, if an account group that appears twice within 1 minute with >80k and / or once within 1 minute with >120k is found, if the number of account groups in the chat channel is less than the first preset number threshold 10 (configuration parameter), the number of account groups in the chat channel will be increased from N to M.
[0132] (3) By executing the above step S808, if an account group with more than 80k appears twice within 1 minute and / or more than 120k appears once within 1 minute, if the number of account groups in the chat channel is greater than the first preset number threshold 10 (configuration parameter) and less than the second preset number threshold 999 (configuration parameter), then by executing the above step S814, the number of account groups in the chat channel is increased from N to M according to a preset ratio, for example, 30% (configuration parameter);
[0133] For example, assuming N=10, the number of account groups that meet the first access volume condition is 5. Then, according to the preset ratio of 30%, the number of account groups that can be added is 5×30%=1.5, that is, a maximum of 2 account groups can be added, i.e. M=11 or 12. The purpose is to avoid adding too many account groups, thereby reducing the microservice resources used for data processing.
[0134] (4) By executing the above step S808, if an account group with more than 80k appears twice within 1 minute and / or more than 120k appears once within 1 minute, if the number of account groups in the chat channel is less than the first preset number threshold 10 (configuration parameter), then by executing the above step S814, the number of account groups in the chat channel is increased from N to M according to a preset ratio, for example, 30% (configuration parameter), for example, from 10 account groups to 12.
[0135] It should be noted that method (4) only limits the number of account groups to a maximum of M when the first access volume condition is found and N is greater than or equal to the first preset quantity threshold. However, method (4) does not consider the second preset quantity threshold.
[0136] Through the above embodiments provided in this application, by introducing a first access volume condition, a first preset quantity threshold, and a second preset quantity threshold, when the access volume meets the first access volume condition, the accounts in the target message channel are adjusted from N account groups to M account groups, effectively controlling the number of added account groups, reducing the access volume of account groups that meet the first access volume condition, and ensuring the load balance of the adjusted account groups.
[0137] As an optional implementation, the above method adjusts the accounts in the target message channel from N account groups to M account groups, including:
[0138] Reorganize the accounts in the target message channel into M account groups; or
[0139] If there are Q account groups whose visit volume meets the first visit volume condition, and Q is a positive integer less than N, then the accounts in the Q account groups are re-divided into R account groups. The remaining account groups (excluding the Q account groups) and the R account groups from the N account groups are then determined as M account groups, where R is a positive integer greater than Q; or
[0140] If there are Q account groups whose visit volume meets the first visit volume condition, and Q is a positive integer less than N, then the accounts in the T account groups and the Q account groups are re-divided into R account groups. The account groups other than the Q account groups and the T account groups in the N account groups, and the R account groups are determined as M account groups, where R is a positive integer greater than (Q+T), and the T account groups are the account groups other than the Q account groups in the N account groups.
[0141] like Figure 9 As shown in (a), assuming N=3, M=4, and the account group that meets the first access volume condition is a single account group, for example, group 1, then the ways to increase N account groups to M account groups include, but are not limited to, one of the following methods:
[0142] (1) As Figure 9 As shown in (b1), all accounts in the three account groups are re-divided into four account groups. For example, the account UID is re-divided. 1-1 and UID 1-2 Keep it in group 1, and save the account UID. 1-4 Switch to group 2 and enter the account UID. 2-2 Switch to group 3 and enter the account UID. 1-3 Switch from group 1 to group 4, and change the account UID. 3-1 Switch from group 3 to group 4;
[0143] By re-dividing the accounts in the target message channel, the access volume of the M account groups after the division meets the target access volume condition, that is, the load of the adjusted M account groups is balanced.
[0144] (2) Figure 9 As shown in (b2), only accounts whose visit volume meets the first visit volume condition are grouped into account group 1 (referred to as group 1) for re-division. For example, the account UID is... 1-1 and UID 1-2 Keep it in group 1, and save the account UID. 1-3 and UID 1-4 Switch to the newly added group 4;
[0145] In the process of reclassifying account group 1, the following two principles may be maintained, but are not limited to:
[0146] (i) For UIDs in account group 1 that have been previously grouped, prioritize keeping them in their original account group, for example, in group 1;
[0147] (ii) Divide the UIDs according to their relationships. For example, if two UIDs are friends, prioritize keeping them in their original group 1 or switching them together to the newly added group 4. For example, UID 1-1 and UID 1-2 Keep in group 1, UID 1-3 and UID 1-4 Switch together to the newly added group 4.
[0148] (3) Figure 9 As shown in (b3), only a portion of the accounts that meet the first access volume condition are grouped into account group 1 (referred to as group 1) and the remaining account groups (groups 2 to 3). For example, the accounts in group 1 and group 2 are re-divided. Specifically, the account UID is... 1-1 and UID 1-2 Keep it in group 1, and set the UID. 1-3 Switch to group 2 and change the UID. 2-1 Switch to group 1 and change the UID. 1-3 and UID 1-4 Switch together to the newly added group 4.
[0149] Similarly, when reclassifying accounts in Group 1 and Group 2, the principles in (i) and (ii) above are also followed.
[0150] pass Figure 9It can be intuitively seen that, compared with the adjustment in method (1), the process of regrouping the N accounts using the methods (2) and (3) above has at least the following advantages:
[0151] 1. The number of accounts switching groups has been reduced, avoiding the poor gaming experience caused by frequent disconnections;
[0152] 2. Reduced the risk of message gaps between highly related accounts. For example, UIDs that were previously in group 1... 1-1 and UID 1-2 It remains in group 1, thus avoiding issues arising from the UID being... 1-1 and UID 1-2 The issue of being unable to receive messages properly caused by switching to different account groups;
[0153] 3. It eliminates the need to reorganize all accounts in the target message channel, improving the efficiency of account grouping adjustments.
[0154] As another alternative example, the above method of finding account groups whose visit volume meets the second visit volume condition among N account groups based on N visit volume includes:
[0155] For the i-th account group out of N account groups, perform the following steps, where 1≤i≤N:
[0156] If the number of visits to the i-th account group includes P visits, find the number of visits less than the preset second visit threshold in the P visits. Here, P visits are the number of visits to the i-th account group within P sub-durations. The preset duration includes P sub-durations, and P is 1 or a positive integer greater than or equal to 2.
[0157] If the number of visits less than the second visit threshold is greater than or equal to the preset second visit threshold, and N is greater than 1, the i-th account group is determined as the account group whose visit volume meets the second visit threshold.
[0158] For the i-th account group among the N account groups, perform the following steps, where 1≤i≤N, and the second access threshold may be, but is not limited to, 8K, and the second access number threshold:
[0159] S820, proceed with contraction check;
[0160] S822, check if there are 2 or more accesses with less than 8k (configuration parameter) among the 6 accesses within 1 minute. If so, proceed to step S824.
[0161] S824, determine whether the total number of account groups in the chat channel is less than or equal to 1. If yes, proceed to step S826; otherwise, proceed to step S828.
[0162] S826, keep the total number of account groups in the chat channel unchanged;
[0163] S828 reduces the total number of account groups in chat channels.
[0164] By repeatedly executing steps S820-S828, the account groups that meet the second access volume condition among the N account groups can be determined. Based on this, it can be further determined how to adjust the number of account groups in the chat channel. For example, reducing the number of account groups avoids the waste of microservice resources and improves the processing efficiency of chat messages.
[0165] As an optional implementation, when account groups whose access volume meets the second access volume condition are found, the methods for adjusting the original N account groups in the target message channel include:
[0166] If an account group whose visit volume meets the second visit volume condition is found among N account groups, the number of account groups in the target message channel is reduced from N account groups to M account groups, where M is a positive integer less than N.
[0167] As an optional implementation, the above reduces the number of accounts in the target message channel from N account groups to M account groups, including:
[0168] Reorganize the accounts in the target message channel into M account groups; or
[0169] If there are Q account groups whose visit volume meets the second visit volume condition, and Q is a positive integer less than or equal to N, then the accounts in the Q account groups are re-divided into R account groups. The remaining account groups (excluding the Q account groups) and the R account groups are then determined as M account groups, where R is a positive integer less than Q; or
[0170] If there are Q account groups whose visit volume meets the second visit volume condition, and Q is a positive integer less than or equal to N, then the accounts in the T account groups and the Q account groups are re-divided into R account groups. The account groups other than the Q account groups and the T account groups in the N account groups, and the R account groups are determined as M account groups, where R is a positive integer less than (Q+T), and the T account groups are the account groups other than the Q account groups in the N account groups.
[0171] like Figure 10As shown in (a), assuming N=4, M=3, and the number of accounts that meet the second access volume condition is divided into two groups, such as group 3 and group 4, then the ways to reduce N account groups to M account groups include, but are not limited to, one of the following methods:
[0172] (1) As Figure 10 As shown in (b1), all accounts in the four account groups are re-divided into three account groups. For example, the account UID is re-divided. 1-1 and UID 1-2 Keep it in group 1, and save the account UID. 1-4 Switch to group 2 and enter the account UID. 4-1 Switch to the merged group 3 and enter the account UID. 1-3 Switch from Group 1 to the merged Group 3, and simultaneously change the account UID. 3-2 Switch from group 3 to group 1;
[0173] By re-dividing the accounts in the target message channel, the access volume of the M newly divided account groups all meets the target access volume condition, while allowing players in the same account group to receive messages sent by more players.
[0174] (2) Figure 10 As shown in (b2), only accounts whose visit volume meets the second visit volume condition are re-divided into groups 3 and 4 (referred to as groups 3 and 4). For example, the account UID is re-divided. 3-1 and UID 3-2 Keep it in group 3, and include the account UID. 4-1 Switch to the merged group 3;
[0175] In the process of re-dividing account groups 3 and 4, the following two principles may be maintained, but are not limited to:
[0176] (i) For UIDs in account group 3 that have been previously grouped, priority should be given to keeping them in their original account group, for example, keeping them in group 3;
[0177] (ii) Divide according to the relationship between UIDs. For example, if two UIDs are friends, prioritize keeping these two UIDs in the merged account group. 3-1 and UID 3-2 Retain the UID in the merged group 3. 4-1 Switch to the newly added group 4.
[0178] (3) Figure 10As shown in (b3), only accounts that meet the second access volume condition are grouped into account groups 3 and 4 (referred to as group 3 and group 4), and a portion of the remaining account groups (group 1 to group 2) are re-divided. For example, accounts in group 1, group 3, and group 4 are re-divided. Specifically, the account UID is... 1-1 UID 1-2 and UID 1-3 Keep it in group 1, and set the UID. 1-4 and UID 4-1 Switch to the merged group 3;
[0179] Similarly, when reclassifying accounts in Groups 1, 3, and 4, the principles in (i) and (ii) above shall also be followed.
[0180] pass Figure 10 It can be intuitively seen that, compared with the adjustment in method (1), the process of regrouping the N accounts using the methods (2) and (3) above has at least the following advantages:
[0181] 1. The number of accounts switching groups has been reduced, avoiding the poor gaming experience caused by frequent disconnections, while also saving microservice resources;
[0182] 2. In the merged account groups, players can receive more messages, increasing social interaction among players and enhancing the game's fun.
[0183] 3. It eliminates the need to reorganize all accounts in the target message channel, improving the efficiency of account grouping adjustments.
[0184] As an optional example, the above method also includes:
[0185] Get the read message requests sent by the target account in the target message channel. The default message language in the target message channel is the mainstream language, and the non-mainstream language is a language different from the mainstream language.
[0186] In response to a message read request, determine the second account group in which the target account belongs in the target message channel;
[0187] Retrieve the cached historical message set of the second account group, wherein the historical message set includes message sets in mainstream languages and message sets in non-mainstream languages;
[0188] Based on the language type of the target account, determine the set of messages to be transmitted from the historical message set. The language type of the target account indicates whether the target account is an account using a mainstream language or an account using a non-mainstream language.
[0189] Send the set of messages to be transmitted to the target account.
[0190] As an optional implementation, the above method determines the set of messages to be transmitted from the historical message set based on the language type of the target account, including:
[0191] If the target account's language type indicates that the target account is an account using a mainstream language, select a first number of mainstream language messages and a second number of non-mainstream language messages from the historical message set, wherein the first number is greater than the second number, and the message set to be transmitted includes the first number of mainstream language messages and the second number of non-mainstream language messages.
[0192] If the target account's language type indicates that the target account is using a non-mainstream language, select the third number of messages in a mainstream language and the fourth number of messages in a non-mainstream language from the historical message set. The ratio of the first number to the second number is greater than the ratio of the third number to the fourth number. The message set to be transmitted includes the third number of messages in a mainstream language and the fourth number of messages in a non-mainstream language.
[0193] like Figure 11 As shown, due to the characteristics of chat channels, there may be one or more mainstream languages (e.g., in an English channel, English is the mainstream language), while other languages are classified as non-mainstream languages (e.g., Chinese). When a channel has more non-mainstream languages (e.g., in an English channel, there are more Chinese chat messages, referred to as "dominating the screen"), users of the mainstream language of that channel (e.g., an English player in an English channel) will still see mostly English chat messages, with only a small amount of Chinese chat. However, users of the non-mainstream languages of that channel (e.g., a Chinese player in an English channel) will see actual Chinese chat dominating the screen (i.e., without special processing).
[0194] The implementation logic of Convector's mainstream language adversarial algorithm includes: First, it inputs whether the user is a mainstream language user in the current channel. Each chat channel is divided into lines, and mainstream language information and non-mainstream language information are stored in different data caches (the mainstream language cache is the Major-LMCR in the diagram, and the non-mainstream language cache is the Minor-LMCR in the diagram). If the user is a mainstream language user, messages can be compiled, but not limited to, in a manner that is 90% (configuration parameter) mainstream language messages and 10% (configuration parameter) non-mainstream language messages. If the user is a non-mainstream language user, 20%-80% (configuration parameter) of non-mainstream language messages will be randomly mixed into the mainstream language messages, and if the number of messages is insufficient, the remaining messages will be supplemented (while mainstream language users do not have corresponding supplementation).
[0195] It should be noted that in the implementation of the aforementioned adversarial algorithm for mainstream languages, the ratio of the number of mainstream language messages to the total number of messages is greater than or equal to 90%. Specifically, if there is a shortage of non-mainstream language messages, mainstream language messages will be added; however, if there is a shortage of mainstream language messages, non-mainstream language messages will not be added. Instead, non-mainstream language messages will be pruned to ensure that the ratio of mainstream language messages meets the condition of being greater than or equal to 90%. The total number of messages is the sum of the number of mainstream language messages and the number of non-mainstream language messages.
[0196] For detailed steps, please refer to [link / reference]. Figure 12 The flowchart shown includes:
[0197] S1202-1, If the current user is a user of a mainstream language, the user enters a message in the input box;
[0198] S1204-1, adjust the proportion parameter of non-mainstream language messages to 10%;
[0199] S1202-2, If the current user is a user who speaks a non-mainstream language, the user enters a message in the input box;
[0200] S1204-2, adjust the proportion parameter of non-mainstream language messages to 20%-80%;
[0201] S1206, Obtain messages in mainstream languages from the mainstream language message candidate pool;
[0202] S1208, retrieve non-mainstream language messages from the non-mainstream language message candidate pool;
[0203] S1210, populate the mainstream language messages proportionally, and put the remaining messages into the remaining pool;
[0204] S1212, proportionally fill non-mainstream language messages and put the remaining messages into the remaining pool;
[0205] S1214. If the ratio between mainstream language messages and non-mainstream language messages is a preset ratio, proceed to step S1216; otherwise, proceed to step S1218.
[0206] S1216, Discard the remaining messages in the remaining pool;
[0207] S1218, If it cannot be ensured that the ratio between mainstream language messages and non-mainstream language messages is the preset ratio, proceed to step S1220;
[0208] S1220, replenish the remaining messages in the pool;
[0209] S1222, trims the ratio between mainstream language messages and non-mainstream language messages to a specified number.
[0210] Through the above steps S1202-S1222, the problem of non-mainstream languages dominating the language channel was resolved, and the following method was adopted: Figure 11 The non-mainstream language interference countermeasures shown reduce the interference of non-mainstream languages dominating the chat message quality and improve the service quality of the chat function.
[0211] As an optional example, the above method also includes:
[0212] Obtain the target message sent by the AI account controlled by the artificial intelligence (AI) program in the target message channel;
[0213] Based on the AI account's identifier, determine the first account group in the target message channel where the AI account belongs. The accounts in the first account group include the AI account and a group of user accounts.
[0214] The target message sent by the AI account is cached in the message queue corresponding to the first account group. The message queue is used to cache messages sent by each account in the first account group. The messages cached in the message queue are set to be readable by at least one set of user accounts in the first account group.
[0215] In this embodiment, in addition to messages sent by real players, game AI can also speak autonomously by scheduling robot players. Its working principle is similar to that of real players. The difference is that: (1) AI speech is initiated by the AI module of the game main service and does not go through the client; (2) After the AI module initiates the chat message, it sends the message to the game main service and determines the branch line by the UID of the AI account, and sends it to the corresponding microservice chatsvr, which is then merged and stored with the chat messages of ordinary real game players.
[0216] In addition to the aforementioned AI-generated autonomous speech, the account grouping adjustment method in this application embodiment also includes the following capabilities:
[0217] (1) Text and voice profanity filtering: Integrate with security components to implement text and voice profanity filtering in an asynchronous manner;
[0218] (2) Automated translation: By connecting to translation components, automated translation of text and voice chat messages can be achieved;
[0219] (3) Structured chat information: Based on the general chat framework, some structured chat information is encapsulated, such as team information, which makes it easy for players to enter the battle team through the chat channel; red envelope function, which allows players to send and receive red envelopes and enhance social interaction; paid megaphone information, which allows players to dominate the chat, etc.
[0220] It should be noted that the content, quantity, and language used by the game AI in its autonomous speech are controlled by the server.
[0221] To more clearly understand the above account grouping adjustment method, the following will be combined with, for example: Figure 13 The overall schematic diagram shown is described in further detail.
[0222] like Figure 13 As shown, the configuration center configures the parameters and functional modules of the game's main service, such as the chat channel ID and the communication protocol between the main service and microservices. The main service and microservices communicate via HTTP / RPC requests. Specifically, the main service uses the addressing service module to find the chat channel ID of the current player's UID, as well as the account group ID (sub-channel ID) and data cache queue.
[0223] Microservices primarily handle the sending and receiving of chat messages, and through the aforementioned... Figure 4 The description section describes how to implement message sending and reading between the main service and microservices.
[0224] Its main working principle is as follows:
[0225] (1) The game chat service is separated from the main game service and deployed as a chat microservice. Currently, the chat microservice only handles chat-related functions and data caching. The deployment of the chat microservice can be dynamically increased or decreased on the external network based on actual load. The chat microservice adopts a symmetrical multi-threaded operation mode, with each channel thread corresponding to one channel, and one channel used for... Figure 14 The channel ID is shown.
[0226] like Figure 14 As shown, assuming the channel ID is 64 bytes, bits 0-16 are subcategory IDs, such as region ID, competition zone ID, language ID, etc., bits 16-31 are line IDs (account group IDs), bits 32-39 are broadcast chat types, and bits 40-63 are reserved bits.
[0227] The method for determining the account group ID can be, but is not limited to, using the fast consistent hash algorithm. For example, assuming that the category IDs of all account groups in the chat channel are in the range of [20, 30], and the total number of account groups in the current chat channel is N = 6, then if the remainder is 0 when the player UID of the player who sent the message is divided by 6, the account group ID corresponding to that player UID is the 0th position in [20, 30]; if the remainder is 1, the account group ID corresponding to that player UID is the 1st position in [20, 30], and so on.
[0228] The code for Fast Consistent Hash can be found here. Figure 15 , where key is the player's UID and b is the account group ID to which the calculated player's UID belongs.
[0229] (2) The Global module of the chat microservice is mainly responsible for process configuration and global functions such as monitoring and reporting. SAPIAgent in the diagram is the proxy process for the chat microservice to report monitoring data to the monitoring module. The Logic module of the chat microservice is responsible for the main data storage and main functional logic, where SAPIAgent is the service process used to proxy the monitoring and reporting function.
[0230] (3) The main game service side is responsible for processing and forwarding chat requests and chat retrieval requests.
[0231] Upon receiving a chat request, the main game service performs steps such as profanity filtering, security checks, and semantic recognition. Based on the results of these steps, it decides whether to forward or block the chat message and reports the corresponding monitoring data. For structured data, such as red envelopes or team information, further structured processing is performed. After processing, the message is filled with a complete ChannelID based on the player's UID and sent to the corresponding chat microservice. For chat retrieval requests, the main game service also checks for channel restrictions, such as level and region settings, before sending the request to the chat microservice to retrieve the chat message.
[0232] After retrieving the chat data returned by the chat microservice, the main game service sends the messages to the client, which then displays these messages to the player, thus implementing the complete chat sending and receiving logic.
[0233] Message routing from the main game service to the chat microservice passes through the `smesh_game_main_service`, which is a sidecar of the main game service. Its primary function in the microservice architecture is to proxy message communication between the main game service and external services. Addressing of the chat microservice by the main game service is achieved through Tencent's self-developed Polaris service. Deployed chat microservices register their corresponding name services with Polaris. When the main game service sends a request to a chat microservice, it retrieves the available chat microservice addresses from Polaris. The `smesh_game_main_service` then routes the request based on the channel ID, ultimately sending it to the corresponding chat microservice. This routing strategy ensures that, with the chat microservice deployment unchanged, messages with the same channel ID will only be sent to the designated chat microservice.
[0234] (4) Configuration Center: This primarily provides the ability to configure variable data and notify users of configuration changes. Examples include algorithm parameters and temporary blocking of certain channels. Both the chat microservice and the main game service subscribe to chat-related configurations and can dynamically adjust functionality based on configuration changes during runtime.
[0235] Through the embodiments provided in this application, when the access volume of some account groups in N account groups does not meet the target access volume condition, by adjusting the number of account groups, the access volume of the adjusted M account groups all meet the target access volume condition within a preset time period. In particular, when the access volume of some account groups that do not meet the target access volume condition increases dramatically, by adjusting the number of account groups, the access volume of some account groups is reduced, thus solving the problem of excessive access volume of account groups in the target message channel and achieving the technical effect of load balancing of account groups.
[0236] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0237] According to another aspect of the embodiments of this application, as follows is also provided Figure 16 An account grouping adjustment device is shown, the device comprising:
[0238] The first acquisition unit 1602 is used to acquire the access volume of N account groups within a preset time period to obtain N access volumes. The accounts in the target message channel of the target application are divided into the N account groups, where N is 1 or a positive integer greater than or equal to 2. Each access volume represents the amount of cached data and read data generated by the corresponding account group. The amount of cached data is the amount of data used to cache the messages sent by the account group, and the amount of read data is the amount of data used to read the cached messages sent by the account group.
[0239] The first processing unit 1604 is used to find, based on the N access counts, account groups in the N account groups whose access counts do not meet the target access count condition, wherein the target access count condition is used to trigger an adjustment of the number of account groups in the target message channel if the access count is not met.
[0240] The second processing unit 1606 is used to adjust the accounts in the target message channel from the N account groups to M account groups when an account group whose access volume does not meet the target access volume condition is found. Here, M is a positive integer different from N. The access volume of the M account groups within the preset time period meets the target access volume condition. Messages sent by accounts in each account group in the target message channel are allowed to be read by accounts in the same account group, but are prohibited from being read by accounts in different account groups.
[0241] Optionally, the first processing unit 1604 includes:
[0242] The first processing module is used to find account groups whose access volume meets the first access volume condition among N account groups based on N access volume. The first access volume condition is used to trigger an increase in the number of account groups in the target message channel when it is met. If an account group whose access volume meets the first access volume condition is found, the found account group whose access volume meets the first access volume condition is determined as an account group whose access volume does not meet the target access volume condition.
[0243] The second processing module is used to find account groups whose access volume meets the second access volume condition among N account groups based on N access volume. The second access volume condition is used to trigger a reduction in the number of account groups in the target message channel when it is met. If an account group whose access volume meets the second access volume condition is found, the found account group whose access volume meets the second access volume condition is determined as an account group whose access volume does not meet the target access volume condition.
[0244] Optionally, the first processing module mentioned above includes:
[0245] The first processing submodule is used to perform the following steps for the i-th account group out of N account groups, where 1≤i≤N:
[0246] If the number of visits to the i-th account group includes P visits, find the number of visits that is greater than the preset first visit threshold in the P visits. Here, P visits are the number of visits to the i-th account group within P sub-durations. The preset duration includes P sub-durations, and P is 1 or a positive integer greater than or equal to 2.
[0247] If the number of visits exceeding the first visit threshold is greater than or equal to the preset first visit threshold, the i-th account group is determined as the account group whose visit volume meets the first visit condition.
[0248] Optionally, the second processing module mentioned above includes:
[0249] The second processing submodule is used to perform the following steps for the i-th account group out of N account groups, where 1≤i≤N:
[0250] If the number of visits to the i-th account group includes P visits, find the number of visits less than the preset second visit threshold in the P visits. Here, P visits are the number of visits to the i-th account group within P sub-durations. The preset duration includes P sub-durations, and P is 1 or a positive integer greater than or equal to 2.
[0251] If the number of visits less than the second visit threshold is greater than or equal to the preset second visit threshold, and N is greater than 1, the i-th account group is determined as the account group whose visit volume meets the second visit threshold.
[0252] Optionally, the second processing unit 1606 includes:
[0253] The third processing module, when finding an account group among N account groups whose access volume meets the first access volume condition, increases the number of account groups in the target message channel from N to M, where M is a positive integer greater than N; or
[0254] If, among N account groups, an account group whose access volume meets the first access volume condition is found, and N is less than the first preset threshold, the number of account groups in the target message channel is increased from N account groups to M account groups, where M is a positive integer greater than N; or
[0255] If, among N account groups, an account group whose access volume meets the first access volume condition is found, and N is greater than or equal to the first preset quantity threshold, the number of accounts in the target message channel is increased from N account groups to M account groups according to a preset ratio, where M is a positive integer greater than N, and the difference between M and N is less than or equal to the product of the number of account groups whose access volume meets the first access volume condition and the preset ratio; or
[0256] If an account group with access volume that meets the first access volume condition is found in N account groups, and N is greater than or equal to the first preset quantity threshold and less than or equal to the second preset quantity threshold, the number of accounts in the target message channel is increased from N account groups to M account groups according to a preset ratio, where M is a positive integer greater than N, and the difference between M and N is less than or equal to the product of the number of account groups with access volume that meets the first access volume condition and the preset ratio.
[0257] Optionally, the third processing module mentioned above includes:
[0258] The third processing submodule is used to re-divide the accounts in the target message channel into M account groups; or
[0259] If there are Q account groups whose visit volume meets the first visit volume condition, and Q is a positive integer less than N, then the accounts in the Q account groups are re-divided into R account groups. The remaining account groups (excluding the Q account groups) and the R account groups from the N account groups are then determined as M account groups, where R is a positive integer greater than Q; or
[0260] If there are Q account groups whose visit volume meets the first visit volume condition, and Q is a positive integer less than N, then the accounts in the T account groups and the Q account groups are re-divided into R account groups. The account groups other than the Q account groups and the T account groups in the N account groups, and the R account groups are determined as M account groups, where R is a positive integer greater than (Q+T), and the T account groups are the account groups other than the Q account groups in the N account groups.
[0261] Optionally, the second processing unit 1606 includes:
[0262] The fourth processing module is used to reduce the number of accounts in the target message channel from N account groups to M account groups when an account group whose access volume meets the second access volume condition is found in N account groups, where M is a positive integer less than N.
[0263] Optionally, the fourth processing module mentioned above includes:
[0264] The fourth processing submodule is used to re-divide the accounts in the target message channel into M account groups; or
[0265] If there are Q account groups whose visit volume meets the second visit volume condition, and Q is a positive integer less than or equal to N, then the accounts in the Q account groups are re-divided into R account groups. The remaining account groups (excluding the Q account groups) and the R account groups are then determined as M account groups, where R is a positive integer less than Q; or
[0266] If there are Q account groups whose visit volume meets the second visit volume condition, and Q is a positive integer less than or equal to N, then the accounts in the T account groups and the Q account groups are re-divided into R account groups. The account groups other than the Q account groups and the T account groups in the N account groups, and the R account groups are determined as M account groups, where R is a positive integer less than (Q+T), and the T account groups are the account groups other than the Q account groups in the N account groups.
[0267] Optionally, the first acquisition unit 1602 mentioned above includes:
[0268] The fifth processing module is used to obtain the access volume of N account groups within a preset time period through the first group of services in the target application, and obtain N access volumes. The first group of services is independent of the main service of the target application. The first group of services is used to cache the messages sent by the accounts in the N account groups and read the cached messages sent by the accounts in the N account groups. The main service is used to process the business logic of the target application.
[0269] The aforementioned first processing unit 1604 includes:
[0270] The sixth processing module is used to find account groups whose access volume does not meet the target access volume condition from among the N account groups based on N access volumes, using the first group of services.
[0271] The second processing unit 1606 mentioned above includes:
[0272] The adjustment module is used to adjust the accounts in the target message channel from N account groups to M account groups through the first group service and / or the main service when an account group whose access volume does not meet the target access volume condition is found.
[0273] Optionally, the first acquisition unit 1602 further includes:
[0274] The seventh processing module is used to configure the first group of services to cache messages sent by accounts in the M account groups when the accounts in the target message channel are adjusted from N account groups to M account groups; or
[0275] When the accounts in the target message channel are adjusted from N account groups to M account groups, where M is a positive integer greater than N, the services deployed for the target message channel are moved from the first group of services to the second group of services. The second group of services is independent of the main service. The second group of services is used to cache messages sent by accounts in the M account groups and to read messages sent by accounts in the cached M account groups. The number of services in the first group is less than the number of services in the second group; or
[0276] When the accounts in the target message channel are adjusted from N account groups to M account groups, where M is a positive integer less than N, the services deployed for the target message channel are adjusted from the first group of services to the third group of services. The third group of services is independent of the main service and is used to cache messages sent by accounts in the M account groups. The number of services in the first group of services is greater than the number of services in the third group of services.
[0277] Optionally, the above-mentioned device further includes:
[0278] The second acquisition unit is used to acquire read message requests sent by the target account in the target message channel. The default message language in the target message channel is the mainstream language, and the non-mainstream language is a language different from the mainstream language.
[0279] The third processing unit is used to respond to a message read request and determine the second account group in which the target account belongs in the target message channel;
[0280] The third acquisition unit is used to acquire the cached historical message set of the second account group, wherein the historical message set includes message sets in mainstream languages and message sets in non-mainstream languages;
[0281] The fourth processing unit is used to determine the set of messages to be transmitted in the historical message set according to the language type of the target account, wherein the language type of the target account indicates that the target account is an account using a mainstream language, or indicates that the target account is an account using a non-mainstream language.
[0282] The sending unit is used to send a set of messages to be transmitted to the target account.
[0283] Optionally, the fourth processing unit mentioned above includes:
[0284] The first selection module is used to select a first number of mainstream language messages and a second number of non-mainstream language messages from the historical message set when the target account's language type indicates that the target account is an account using a mainstream language. The first number is greater than the second number, and the message set to be transmitted includes the first number of mainstream language messages and the second number of non-mainstream language messages.
[0285] The second selection module is used to select a third number of mainstream language messages and a fourth number of non-mainstream language messages from the historical message set when the target account's language type indicates that the target account is an account using a non-mainstream language. The ratio of the first number to the second number is greater than the ratio of the third number to the fourth number. The message set to be transmitted includes the third number of mainstream language messages and the fourth number of non-mainstream language messages.
[0286] Optionally, the above-mentioned device further includes:
[0287] The fourth acquisition unit is used to acquire the target message sent by the AI account controlled by the artificial intelligence (AI) program in the target message channel;
[0288] The fifth processing unit is used to determine the first account group in the target message channel where the AI account is located based on the AI account's identifier, wherein the accounts in the first account group include the AI account and a group of user accounts;
[0289] The sixth processing unit is used to cache the target message sent by the AI account in the message queue corresponding to the first account group. The message queue is used to cache the messages sent by each account in the first account group, and the messages cached in the message queue are set to be readable by at least one group of user accounts in the first account group.
[0290] By applying the above device to situations where the access volume of some account groups in N account groups does not meet the target access volume condition, the number of account groups is adjusted so that the access volume of the adjusted M account groups meets the target access volume condition within a preset time period. In particular, when the access volume of some account groups that do not meet the target access volume condition increases dramatically, adjusting the number of account groups reduces the access volume of some account groups, thus solving the problem of excessive access volume of account groups in the target message channel and achieving the technical effect of load balancing of account groups.
[0291] It should be noted that the embodiment of the account grouping adjustment device here can refer to the embodiment of the account grouping adjustment method described above, and will not be repeated here.
[0292] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described account grouping adjustment method is also provided. This electronic device may be... Figure 17 The terminal device shown is illustrated in this embodiment, which uses this electronic device as an example of a backend device. Figure 17 As shown, the electronic device includes a memory 1702 and a processor 1704. The memory 1702 stores a computer program, and the processor 1704 is configured to execute the steps of any of the above method embodiments via the computer program.
[0293] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0294] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0295] S1, obtain the access volume of N account groups within a preset time period, and obtain N access volume. Among them, the accounts in the target message channel of the target application are divided into N account groups, where N is 1 or a positive integer greater than or equal to 2. Each access volume represents the cached data volume and read data volume generated by the corresponding account group. The cached data volume is the amount of data used to cache the messages sent by the account group, and the read data volume is the amount of data used to read the messages sent by the cached account group.
[0296] S2, based on N access counts, find account groups in N account groups whose access counts do not meet the target access count condition, where the target access count condition is used to trigger an adjustment of the number of account groups in the target message channel if the access count is not met.
[0297] S3, if an account group whose access volume does not meet the target access volume condition is found, the accounts in the target message channel are adjusted from N account groups to M account groups, where M is a positive integer different from N. The access volume of the M account groups meets the target access volume condition within a preset time period. Messages sent by accounts in each account group in the target message channel are allowed to be read by accounts in the same account group, but are prohibited from being read by accounts in different account groups.
[0298] Alternatively, as those skilled in the art will understand, Figure 17 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other target terminals. Figure 17 This does not limit the structure of the aforementioned electronic devices or electronic equipment. For example, electronic devices or electronic equipment may also include components that are more... Figure 17 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 17 The different configurations shown.
[0299] The memory 1702 can be used to store software programs and modules, such as the program instructions / modules corresponding to the account group adjustment method and apparatus in this embodiment. The processor 1704 executes various functional applications and data processing by running the software programs and modules stored in the memory 1702, thereby implementing the aforementioned account group adjustment method. The memory 1702 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1702 may further include memory remotely located relative to the processor 1704, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 1702 may be used, but is not limited to, to store the access volume and target access volume conditions of N account groups within a preset time period. As an example, such as... Figure 17 As shown, the memory 1702 may include, but is not limited to, the first acquisition unit 1602, the first processing unit 1604, and the second processing unit 1606 in the account grouping adjustment device. Furthermore, it may include, but is not limited to, other module units in the account grouping adjustment device, which will not be elaborated upon in this example.
[0300] Optionally, the transmission device 1706 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1706 includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 1706 is a radio frequency (RF) module, used for wireless communication with the Internet.
[0301] In addition, the aforementioned electronic device also includes: a display 1708 for displaying directional information of the target sound; and a connection bus 1710 for connecting the various module components in the aforementioned electronic device.
[0302] In other embodiments, the target terminal or server can be a node in a distributed system, which can be a blockchain system. This blockchain system is formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer (P2P) network, and any type of computing device, such as a server or terminal, can become a node in the blockchain system by joining this peer-to-peer network.
[0303] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the account grouping adjustment method provided in various optional implementations of the above-described server verification processing, wherein the computer program is configured to execute the steps in any of the above-described method embodiments at runtime.
[0304] Optionally, in this embodiment, the computer-readable storage medium described above may be configured to store a computer program for performing the following steps:
[0305] S1, obtain the access volume of N account groups within a preset time period, and obtain N access volume. Among them, the accounts in the target message channel of the target application are divided into N account groups, where N is 1 or a positive integer greater than or equal to 2. Each access volume represents the cached data volume and read data volume generated by the corresponding account group. The cached data volume is the amount of data used to cache the messages sent by the account group, and the read data volume is the amount of data used to read the messages sent by the cached account group.
[0306] S2, based on N access counts, find account groups in N account groups whose access counts do not meet the target access count condition, where the target access count condition is used to trigger an adjustment of the number of account groups in the target message channel if the access count is not met.
[0307] S3, if an account group whose access volume does not meet the target access volume condition is found, the accounts in the target message channel are adjusted from N account groups to M account groups, where M is a positive integer different from N. The access volume of the M account groups meets the target access volume condition within a preset time period. Messages sent by accounts in each account group in the target message channel are allowed to be read by accounts in the same account group, but are prohibited from being read by accounts in different account groups.
[0308] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the target terminal. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0309] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0310] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods of the various embodiments of this application.
[0311] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0312] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or the indirect coupling or communication connection of units or modules may be electrical or other forms.
[0313] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0314] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0315] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for adjusting account grouping, characterized in that, include: Obtain the access volume of N account groups within a preset time period to obtain N access volume, wherein the accounts in the target message channel of the target application are divided into the N account groups, where N is 1 or a positive integer greater than or equal to 2. Each access volume represents the amount of cached data and read data generated by the corresponding account group. The amount of cached data is the amount of data used to cache the messages sent by the account group, and the amount of read data is the amount of data used to read the cached messages sent by the account group. Based on the N access counts, find account groups among the N account groups whose access counts do not meet the target access count condition, wherein the target access count condition is used to trigger an adjustment of the number of account groups in the target message channel if the access count is not met. If an account group whose access volume does not meet the target access volume condition is found, the accounts in the target message channel are adjusted from the N account groups to M account groups, where M is a positive integer different from N. The access volume of the M account groups within the preset time period meets the target access volume condition. Messages sent by accounts in each account group in the target message channel are allowed to be read by accounts in the same account group, but are prohibited from being read by accounts in different account groups. Obtain a read message request sent by the target account in the target message channel, wherein the default message language in the target message channel is a mainstream language, and non-mainstream languages are languages different from the mainstream language; in response to the read message request, determine the second account group to which the target account belongs in the target message channel; obtain the cached historical message set of the second account group, wherein the historical message set includes the message set of the mainstream language and the message set of the non-mainstream language; determine the message set to be transmitted in the historical message set according to the language type of the target account, wherein the language type of the target account indicates that the target account is an account using the mainstream language, or indicates that the target account is an account using the non-mainstream language; send the message set to be transmitted to the target account.
2. The method according to claim 1, characterized in that, The step of finding account groups whose visit volume does not meet the target visit volume condition from the N account groups based on the N visit volume includes: Based on the N access counts, find account groups among the N account groups whose access counts meet the first access count condition, wherein the first access count condition is used to trigger an increase in the number of account groups in the target message channel when it is met; if an account group whose access counts meet the first access count condition is found, the found account group whose access counts meet the first access count condition is determined as an account group whose access counts do not meet the target access count condition. Based on the N access counts, find account groups among the N account groups whose access counts meet the second access count condition, wherein the second access count condition is used to trigger a reduction in the number of account groups in the target message channel when it is met; if an account group whose access counts meet the second access count condition is found, the found account group whose access counts meet the second access count condition is determined as an account group whose access counts do not meet the target access count condition.
3. The method according to claim 2, characterized in that, The step of finding the account group whose visit volume meets the first visit volume condition from the N account groups based on the N visit volume includes: For the i-th account group among the N account groups, perform the following steps, where 1≤i≤N: If the access volume of the i-th account group includes P accesses, find the access volume greater than a preset first access volume threshold in the P accesses, where the P accesses are the access volume of the i-th account group within P sub-durations, the preset duration includes the P sub-durations, and P is 1 or a positive integer greater than or equal to 2. If the number of visits exceeding the first visit threshold is greater than or equal to a preset first visit threshold, the i-th account group is determined as an account group whose visit volume meets the first visit threshold.
4. The method according to claim 2, characterized in that, The step of finding the account group whose visit volume meets the second visit volume condition from the N account groups based on the N visit volume includes: For the i-th account group among the N account groups, perform the following steps, where 1≤i≤N: If the access volume of the i-th account group includes P accesses, find the access volume less than the preset second access volume threshold in the P accesses, where the P accesses are the access volume of the i-th account group within P sub-durations, the preset duration includes the P sub-durations, and P is 1 or a positive integer greater than or equal to 2. If the number of visits less than the second access threshold is greater than or equal to the preset second access threshold, and N is greater than 1, the i-th account group is determined as the account group whose access volume meets the second access threshold.
5. The method according to claim 2, characterized in that, When an account group whose access volume does not meet the target access volume condition is found, adjusting the accounts in the target message channel from the N account groups to M account groups includes: If an account group whose access volume meets the first access volume condition is found among the N account groups, the number of accounts in the target message channel is increased from the N account groups to M account groups, where M is a positive integer greater than N; or If, among the N account groups, an account group whose access volume meets the first access volume condition is found, and N is less than the first preset threshold, the number of accounts in the target message channel is increased from the N account groups to M account groups, where M is a positive integer greater than N; or If, among the N account groups, an account group whose access volume meets the first access volume condition is found, and N is greater than or equal to the first preset quantity threshold, the number of accounts in the target message channel is increased from the N account groups to M account groups according to a preset ratio, where M is a positive integer greater than N, and the difference between M and N is less than or equal to the product of the number of account groups whose access volume meets the first access volume condition and the preset ratio; or If, among the N account groups, an account group whose access volume meets the first access volume condition is found, and N is greater than or equal to the first preset quantity threshold and less than or equal to the second preset quantity threshold, the number of accounts in the target message channel is increased from the N account groups to M account groups according to the preset ratio, where M is a positive integer greater than N, and the difference between M and N is less than or equal to the product of the number of account groups whose access volume meets the first access volume condition and the preset ratio.
6. The method according to claim 5, characterized in that, The step of increasing the number of accounts in the target message channel from N account groups to M account groups includes: Re-divide the accounts in the target message channel into the M account groups; or If the number of account groups whose access volume meets the first access volume condition is Q, and Q is a positive integer less than N, then the accounts in the Q account groups are re-divided into R account groups, and the account groups other than the Q account groups in the N account groups, along with the R account groups, are determined as the M account groups, where R is a positive integer greater than Q; or If the number of account groups that meet the first access volume condition is Q, and Q is a positive integer less than N, then the T account groups and the accounts in the Q account groups are re-divided into R account groups. The account groups other than the Q account groups and the T account groups in the N account groups, and the R account groups are determined as the M account groups, where R is a positive integer greater than (Q+T), and the T account groups are a portion of the account groups other than the Q account groups in the N account groups.
7. The method according to claim 2, characterized in that, When an account group whose access volume does not meet the target access volume condition is found, adjusting the accounts in the target message channel from the N account groups to M account groups includes: If an account group whose access volume meets the second access volume condition is found among the N account groups, the number of accounts in the target message channel is reduced from the N account groups to M account groups, where M is a positive integer less than N.
8. The method according to claim 7, characterized in that, The step of reducing the number of accounts in the target message channel from N account groups to M account groups includes: Re-divide the accounts in the target message channel into the M account groups; or If the number of account groups satisfying the second access volume condition is Q, and Q is a positive integer less than or equal to N, then the accounts in the Q account groups are re-divided into R account groups, and the account groups other than the Q account groups in the N account groups, along with the R account groups, are determined as the M account groups, where R is a positive integer less than Q; or If the number of account groups that meet the second access volume condition is Q, and Q is a positive integer less than or equal to N, then the T account groups and the accounts in the Q account groups are re-divided into R account groups. The account groups other than the Q account groups and the T account groups in the N account groups, and the R account groups are determined as the M account groups, where R is a positive integer less than (Q+T), and the T account groups are a portion of the account groups other than the Q account groups in the N account groups.
9. The method according to any one of claims 1 to 8, characterized in that, The step of obtaining the access volume of N account groups within a preset time period to obtain N access volumes includes: obtaining the access volume of the N account groups within the preset time period through a first group of services in the target application to obtain the N access volumes, wherein the first group of services is independent of the main service of the target application, the first group of services is used to cache messages sent by accounts in the N account groups, and read the cached messages sent by accounts in the N account groups, and the main service is used to process the business logic of the target application; The step of finding account groups whose access volume does not meet the target access volume condition among the N account groups based on the N access volumes includes: using the first group service, finding account groups whose access volume does not meet the target access volume condition among the N account groups based on the N access volumes; The step of adjusting the accounts in the target message channel from the N account groups to the M account groups when an account group whose access volume does not meet the target access volume condition is found includes: adjusting the accounts in the target message channel from the N account groups to the M account groups through the first group service and / or the main service when an account group whose access volume does not meet the target access volume condition is found.
10. The method according to claim 9, characterized in that, The method further includes: When the accounts in the target message channel are adjusted from the N account groups to the M account groups, the first group service is configured to cache messages sent by accounts in the M account groups; or When the accounts in the target message channel are adjusted from the N account groups to the M account groups, where M is a positive integer greater than N, the services deployed for the target message channel are moved from the first group of services to the second group of services. The second group of services is independent of the main service. The second group of services is used to cache messages sent by accounts in the M account groups and to read cached messages sent by accounts in the M account groups. The number of services in the first group of services is less than the number of services in the second group of services; or When the accounts in the target message channel are adjusted from the N account groups to the M account groups, where M is a positive integer less than N, the services deployed for the target message channel are adjusted from the first group of services to the third group of services. The third group of services is independent of the main service. The third group of services is used to cache messages sent by the accounts in the M account groups. The number of services in the first group of services is greater than the number of services in the third group of services.
11. The method according to claim 1, characterized in that, The step of determining the set of messages to be transmitted from the historical message set based on the language type of the target account includes: When the language type of the target account indicates that the target account is an account using the mainstream language, a first number of messages in the mainstream language and a second number of messages in the non-mainstream language are selected from the historical message set, wherein the first number is greater than the second number, and the message set to be transmitted includes the first number of messages in the mainstream language and the second number of messages in the non-mainstream language. If the target account's language type indicates that the target account is an account using the non-mainstream language, then a third number of messages in the mainstream language and a fourth number of messages in the non-mainstream language are selected from the historical message set, wherein the ratio of the first number to the second number is greater than the ratio of the third number to the fourth number, and the message set to be transmitted includes the third number of messages in the mainstream language and the fourth number of messages in the non-mainstream language.
12. The method according to any one of claims 1 to 8, characterized in that, The method further includes: Obtain the target message sent by the AI account controlled by the artificial intelligence (AI) program in the target message channel; Based on the identifier of the AI account, determine the first account group in the target message channel to which the AI account belongs, wherein the accounts in the first account group include the AI account and a group of user accounts; The target message sent by the AI account is cached in the message queue corresponding to the first account group. The message queue is used to cache messages sent by each account in the first account group. The messages cached in the message queue are set to be readable by at least the group of user accounts in the first account group.
13. An account grouping adjustment device, characterized in that, include: The first acquisition unit is used to acquire the access volume of N account groups within a preset time period to obtain N access volumes. The accounts in the target message channel of the target application are divided into the N account groups, where N is 1 or a positive integer greater than or equal to 2. Each access volume represents the amount of cached data and read data generated by the corresponding account group. The amount of cached data is the amount of data used to cache the messages sent by the account group, and the amount of read data is the amount of data used to read the cached messages sent by the account group. The first processing unit is configured to find, based on the N access counts, account groups in the N account groups whose access counts do not meet the target access count condition, wherein the target access count condition is used to trigger an adjustment of the number of account groups in the target message channel if the access count is not met. The second processing unit is used to adjust the accounts in the target message channel from the N account groups to M account groups when an account group whose access volume does not meet the target access volume condition is found. Here, M is a positive integer different from N. The access volume of the M account groups within the preset time period meets the target access volume condition. Messages sent by accounts in each account group in the target message channel are allowed to be read by accounts in the same account group, but are prohibited from being read by accounts in different account groups. The adjustment device further includes: acquiring a read message request sent by a target account in the target message channel, wherein the default message language in the target message channel is a mainstream language, and non-mainstream languages are languages different from the mainstream language; responding to the read message request, determining a second account group in the target message channel to which the target account belongs; acquiring a cached historical message set of the second account group, wherein the historical message set includes a message set in the mainstream language and a message set in the non-mainstream language; determining a message set to be transmitted in the historical message set according to the language type of the target account, wherein the language type of the target account indicates that the target account is an account using the mainstream language, or indicates that the target account is an account using the non-mainstream language; and sending the message set to be transmitted to the target account.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program can be executed by a terminal device or computer at runtime as described in any one of claims 1 to 12.
15. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1 to 12.
16. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 12 through the computer program.
Citation Information
Patent Citations
System and method for chat load management in a network chat environment
CN1947391A
Load balancing when replicating account data
US20120303791A1
