Message processing method and device, equipment, storage medium and program product

By maintaining independent message cache for each client device in the online game architecture and using confirmation information to delete received messages, the cache pressure problem caused by interruption of the game server and client connection is solved, and the utilization rate of gateway cache and gameplay is improved Experience.

CN119052334APending Publication Date: 2024-11-29HANGZHOU BUMING TYCO TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411082679.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

In the online game architecture, a brief connection between the game server and the client causes the state synchronization to fail, causing the client to be disconnected, and the cache pressure of the game server gateway is increased, and the utilization rate is low.

Method used

By maintaining an independent message cache for each client device in the gateway, the client device carries acknowledgement information to delete received messages when it is restored with the server, thereby reducing the cache space occupied by invalid messages and improving cache utilization.

Benefits of technology

It effectively reduces the gateway cache footprint, improves cache utilization, avoids memory waste caused by long-term use of invalid messages, and improves the gaming experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119052334A_ABST
    Figure CN119052334A_ABST
Patent Text Reader

Abstract

The invention relates to a message processing method and device, equipment, a storage medium and a program product, and relates to the technical field of computers. The method is executed by a gateway, and comprises the following steps: storing a message sent to client equipment by a server into a message cache corresponding to the client equipment; sending the message in the message cache corresponding to the client device to the client device; receiving interaction information sent by the client device; the interaction information comprises at least one of a heartbeat packet sent by the client device to the server, service data sent by the client device to the server and message receiving feedback information sent by the client device to the gateway; obtaining confirmation information carried in the interaction information; the confirmation information is used for indicating the message received by the client equipment; and according to the confirmation information, deleting the message received by the client device in the message cache corresponding to the client device. According to the invention, the cache pressure of the gateway can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a message processing method, device, equipment, storage medium and program product. Background Art

[0002] In the online game architecture, the connection between the game server and the game client may be briefly interrupted, making it impossible to synchronize the status of the game server to the game client in time, thereby causing the game client to be disconnected.

[0003] In the related art, when the connection between the game server and the game client is temporarily interrupted, the game server gateway can cache the message sent to the game client. After the connection between the game server and the game client is restored, the game server gateway can send the cached message to the game client, so that the user of the game client does not perceive the occurrence of the connection interruption.

[0004] However, the above process in the related art increases the cache (memory) pressure of the game server gateway and has a low utilization rate of the game server gateway cache. Summary of the invention

[0005] The present application provides a message processing method, apparatus, device, storage medium and program product, which can reduce the cache space occupied by the gateway and improve the utilization rate of the gateway cache; the technical solution is as follows:

[0006] According to one aspect of the present application, a message processing method is provided, the method being executed by a gateway, the gateway being located between a server and at least one client device, the method comprising:

[0007] The message sent by the server to the client device is stored in the message cache corresponding to the client device; different client devices have different corresponding message caches in the gateway;

[0008] Sending a message in a message buffer corresponding to the client device to the client device;

[0009] receiving interaction information sent by the client device; the interaction information includes at least one of a heartbeat packet sent by the client device to the server, service data sent by the client device to the server, and message reception feedback information sent by the client device to the gateway;

[0010] Acquire confirmation information carried in the interaction information; the confirmation information is used to indicate the message that the client device has received;

[0011] According to the confirmation information, the message already received by the client device is deleted from the message cache corresponding to the client device.

[0012] According to one aspect of the present application, a message processing device is provided, the device comprising:

[0013] A storage module, used for storing the message sent by the server to the client device in the message cache corresponding to the client device; different client devices have different corresponding message caches in the gateway;

[0014] A sending module, used to send the message in the message buffer corresponding to the client device to the client device;

[0015] A receiving module, configured to receive interaction information sent by the client device; the interaction information includes at least one of a heartbeat packet sent by the client device to the server, service data sent by the client device to the server, and message reception feedback information sent by the client device to the gateway;

[0016] An acquisition module, used to acquire confirmation information carried in the interaction information; the confirmation information is used to indicate the message that the client device has received;

[0017] The deleting module is used to delete the message that has been received by the client device in the message cache corresponding to the client device according to the confirmation information.

[0018] In some embodiments, the apparatus further comprises: a capacity adjustment module, configured to adjust, when the memory capacity of the server is insufficient, an upper limit of a message capacity of a message cache corresponding to a first client device from a first message capacity to a second message capacity; the second message capacity is smaller than the first message capacity; the first client device is at least one of the client devices, the data volume of the message in the corresponding message cache being smaller than a data volume threshold;

[0019] The capacity adjustment module is used to restore the message capacity upper limit of the message cache corresponding to the first client device to the first message capacity when the memory capacity of the server is sufficient.

[0020] In some embodiments, the apparatus further comprises: a cache warning module, configured to send cache warning information to the second client device when the remaining message capacity of the message cache corresponding to the second client device is insufficient and the connection between the second client device and the server is not disconnected;

[0021] The cache warning information is used to instruct the second client device to determine the information type of the next interaction information.

[0022] According to one aspect of the present application, a message processing method is provided, the method being executed by a client device, at least one of the client devices correspondingly having a gateway between it and a server, the method comprising:

[0023] receiving a message forwarded by the server through the gateway;

[0024] sending interaction information to the server through the gateway; the interaction information includes at least one of a heartbeat packet sent by the client device to the server, service data sent by the client device to the server, and message reception feedback information sent by the client device to the gateway; the interaction information carries confirmation information; the confirmation information is used to indicate that the client device has received the message, so that the gateway deletes the message received by the client device from the message cache corresponding to the client device according to the confirmation information;

[0025] The message cache is used to cache the message sent by the server to the client device; different client devices have corresponding different message caches in the gateway.

[0026] According to one aspect of the present application, a message processing device is provided, the device comprising:

[0027] A receiving module, used for receiving a message forwarded by the server through the gateway;

[0028] a sending module, configured to send interaction information to the server through the gateway; the interaction information includes at least one of a heartbeat packet sent by the client device to the server, service data sent by the client device to the server, and message reception feedback information sent by the client device to the gateway; the interaction information carries confirmation information; the confirmation information is used to indicate that the client device has received the message, so that the gateway deletes the message received by the client device from the message cache corresponding to the client device according to the confirmation information;

[0029] The message cache is used to cache the message sent by the server to the client device; different client devices have corresponding different message caches in the gateway.

[0030] In some embodiments, the apparatus further comprises: an early warning receiving module, configured to receive cache early warning information, the cache early warning information being sent by the gateway when the remaining message capacity of the message cache corresponding to the client device is insufficient and the connection between the client device and the server is not disconnected;

[0031] The device further includes: an information determination module, configured to determine the information type of the next interactive information according to the cache warning information in the following manner:

[0032] In a case where the service data to be sent exists in the client device, determining that the next interaction information is the service data;

[0033] In the case where the service data to be sent does not exist in the client device and the sending time point of the next heartbeat packet is within a specified time after the current time, determining that the next interaction information is the heartbeat packet; the specified time is less than the time interval between the sending of two adjacent heartbeat packets;

[0034] When there is no business data to be sent in the client device and the sending time of the next heartbeat packet is outside the specified time after the current time, it is determined that the next interaction information is the message reception feedback information to be sent immediately.

[0035] According to another aspect of the present application, a computer device is provided, the computer device comprising a processor and a memory, the memory storing at least one computer instruction, the at least one computer instruction being loaded and executed by the processor to implement the message processing method as described above.

[0036] According to another aspect of the present application, a computer-readable storage medium is provided, wherein at least one computer instruction is stored in the computer-readable storage medium, and the at least one computer instruction is loaded and executed by a processor to implement the message processing method described above.

[0037] According to another aspect of the present application, a computer program product is provided, which includes computer instructions stored in a computer-readable storage medium, and a processor reads and executes the computer instructions from the computer-readable storage medium to implement the message processing method described above.

[0038] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0039] The gateway can store messages sent by the server to the client device in the message cache corresponding to the client device. When the client device sends interactive information to the server, it can carry confirmation information indicating that the client device has received the message, so that the gateway can promptly delete the received messages in the message cache corresponding to the client device, avoiding invalid messages in the message cache occupying the cache space for a long time, thereby alleviating the cache space occupation of the gateway and improving the utilization rate of the gateway cache. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0041] Figure 1 is an architectural diagram of a computer system provided by an exemplary embodiment of the present application;

[0042] Figure 2 It is a topological structure diagram of a network game architecture provided by an exemplary embodiment of the present application;

[0043] Figure 3 is a flowchart of a message processing method provided by an exemplary embodiment of the present application;

[0044] Figure 4 is a flow chart of a silent reconnection method provided by an exemplary embodiment of the present application;

[0045] Figure 5 is a schematic diagram of disconnection provided by an exemplary embodiment of the present application;

[0046] Figure 6 is a schematic diagram of connection recovery provided by an exemplary embodiment of the present application;

[0047] Figure 7 is a flowchart of a message processing method provided by an exemplary embodiment of the present application;

[0048] Figure 8 is a flowchart of a message processing method provided by an exemplary embodiment of the present application;

[0049] Fig. 9 is a block diagram of a message processing device shown in an exemplary embodiment of the present application;

[0050] Fig.10 is a block diagram of a message processing device shown in an exemplary embodiment of the present application;

[0051] Fig.11 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application.

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

[0053] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0054] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0055] The terms used in the present disclosure are for the purpose of describing specific embodiments only and are not intended to limit the present disclosure. The singular forms "a", "said" and "the" used in the present disclosure and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.

[0056] In the embodiments of the present application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0057] It should be understood that although the terms first, second, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first parameter may also be referred to as the second parameter, and similarly, the second parameter may also be referred to as the first parameter. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0058] The following are some definitions of terms involved in this application:

[0059] 1) Heartbeat Packet: Also known as heartbeat information, it is a custom command word sent between the game server and the game client at a specified time interval. The heartbeat packet is used by the game server and / or the game client to regularly notify each other of their own status. Specifically, the game server can send a heartbeat packet to the game client regularly (for example, every 3 seconds) to indicate that the game server is still running normally; correspondingly, the game client can also send a heartbeat packet to the game server regularly (for example, every 3 seconds) to indicate that the game client is still active.

[0060] 2) Heartbeat timeout: When the game server does not receive a heartbeat message or service message from the game client within a period of time (such as a few minutes), it is considered that the game client heartbeat timeout. Similarly, when the game client does not receive a heartbeat message or service message from the game server within a period of time, it is considered that the game server heartbeat timeout. Whether it is a game client heartbeat timeout or a game server heartbeat timeout, they are collectively referred to as heartbeat timeout.

[0061] 3) Network Partitioning between Frontend and Backend: When the game client cannot receive messages from the game server, or the game server cannot receive messages from the game client, this state can be called Network Partitioning between Frontend and Backend. Network Partitioning between Frontend and Backend can be divided into two types: short-term and long-term.

[0062] 4) Silent reconnection after game disconnection: After the game front-end and back-end networks are briefly separated, when the connection is restored, the game server can re-deliver the messages cached during the separation to the game client, allowing the game client to resynchronize the status of the game server. Due to the short separation time and the limited number of cached messages, players can hardly detect the existence of the connection interruption, as if they have quietly reconnected to the game server. This technology is called silent reconnection after game disconnection.

[0063] 5) Game client disconnection: When the game is disconnected from the front-end and back-end networks for a certain period of time, the player will be forced to log off and need to log in again to enter the game. This phenomenon is defined as game client disconnection.

[0064] 6) Game disconnection rate: refers to the ratio of the number of players who have game client disconnection to the total number of players logged in to the game.

[0065] 7) Game tracking: During the operation of the game client and the game server, logs can be recorded for certain key nodes and sent to the big data platform for statistical analysis. For example, when a player logs in and the game client is detected to be disconnected, the game client will send a log record to the remote big data platform.

[0066] 8) Message number: The message sent by the game server to the game client may be sent immediately or after being cached for a period of time. Each message sent by the game server will be accompanied by a number so that the game client can identify and detect whether there is a message loss due to cache overflow.

[0067] Please refer to Figure 1 , which shows an architecture diagram of a computer system provided by an exemplary embodiment of the present application. The computer system 100 includes: a first terminal 110, a server 120, and a second terminal 130.

[0068] The first terminal 110 is installed and runs a client 111 that supports a virtual scene. When the first terminal 110 runs the client 111, the user interface of the client 111 is displayed on the screen of the first terminal 110. The client 111 can be any one of a strategy game (SLG), a simulation program, a battle royale shooting game, a virtual reality (VR) application, an augmented reality (AR) program, a map program, a virtual reality game, an augmented reality game, a first-person shooting game (FPS), a third-person shooting game (TPS), and a multiplayer online tactical competitive game (MOBA). In this embodiment, the client 111 is an example of a strategy game. The first terminal 110 is a terminal used by the first user 112. The first user 112 uses the first terminal 110 to control the first virtual object located in the virtual scene to perform activities. The first virtual object can be called a virtual object of the first user 112. The activities of the first virtual object include but are not limited to: at least one of moving, jumping, teleporting, releasing skills, using props, attacking, and interacting with other objects. Schematically, the first virtual object is a first virtual object, such as a simulated human character or an animated human character.

[0069] The second terminal 130 is installed and runs a client 131 that supports a virtual scene. When the second terminal 130 runs the client 131, the user interface of the client 131 is displayed on the screen of the second terminal 130. The client 131 can be any one of an SLG, a simulation program, a battle royale shooting game, a VR application, an AR program, a map program, a virtual reality game, an augmented reality game, an FPS, a TPS, and a MOBA. In this embodiment, the client 131 is an SLG game as an example. The second terminal 130 is a terminal used by a second user 132. The second user 132 uses the second terminal 130 to control a second virtual object located in a virtual scene to perform an activity. The second virtual object can be referred to as a virtual object of the second user 132. Schematically, the second virtual object is a second virtual object, such as a simulation character or an animation character.

[0070] Optionally, the first virtual object and the second virtual object are in the same virtual scene. Optionally, the first virtual object and the second virtual object may belong to the same camp, the same team, the same organization, have a friend relationship, or have temporary communication permissions. Optionally, the first virtual object and the second virtual object may belong to different camps, different teams, different organizations, or have a hostile relationship.

[0071] Optionally, the clients installed on the first terminal 110 and the second terminal 130 are the same, or the clients installed on the two terminals are the same type of clients on different operating system platforms (Android or iOS). The first terminal 110 may refer to one of a plurality of terminals, and the second terminal 130 may refer to another of a plurality of terminals. This embodiment is only illustrated by taking the first terminal 110 and the second terminal 130 as examples. The device types of the first terminal 110 and the second terminal 130 are the same or different, and the device type includes at least one of: a smart phone, a tablet computer, an e-book reader, an MP3 player, an MP4 player, a laptop portable computer, and a desktop computer.

[0072] Figure 1 Only two terminals are shown, but in different embodiments, there are multiple other terminals 140 that can access the server 120. Optionally, there are one or more other terminals 140 that are terminals corresponding to developers, and a development and editing platform for a client supporting a virtual scene is installed on the other terminals 140. The developer can edit and update the client on the other terminals 140, and transmit the updated client installation package to the server 120 via a wired or wireless network. The first terminal 110 and the second terminal 130 can download the client installation package from the server 120 to update the client.

[0073] The first terminal 110 , the second terminal 130 , and other terminals 140 are connected to the server 120 via a wireless network or a wired network.

[0074] The server 120 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. The server 120 is used to provide background services for clients that support virtual scenes. Optionally, the server 120 undertakes the main computing work and the terminal undertakes the secondary computing work; or, the server 120 undertakes the secondary computing work and the terminal undertakes the main computing work; or, the server 120 and the terminal adopt a distributed computing architecture for collaborative computing.

[0075] In an illustrative example, the server 120 includes a processor 122, a user account database 123, a battle service module 124, and a user-oriented input / output interface (I / O interface) 125. The processor 122 is used to load instructions stored in the server 120 and process data in the user account database 123 and the battle service module 124; the user account database 123 is used to store data of user accounts used by the first terminal 110, the second terminal 130, and other terminals 140, such as the user account's avatar, the user account's nickname, the user account's combat power index, and the service area where the user account is located; the battle service module 124 is used to provide multiple battle rooms for users to fight, such as 1V1 battle, 3V3 battle, 5V5 battle, etc.; the user-oriented I / O interface 125 is used to establish communication and exchange data with the first terminal 110 and / or the second terminal 130 through a wireless network or a wired network.

[0076] Please refer to Figure 2 , which shows a topological structure diagram of a network game architecture provided by an exemplary embodiment of the present application. This topological structure can be implemented as the architecture of the configuration system of the message processing method. Figure 2 As shown, the topology may include: a game client 210, a game server gateway 220, and a game server cluster 230. The game client 210 and the game server cluster 230 may be connected to each other through the game server gateway 220. The game server cluster 230 includes multiple game servers, and the game servers in the game server cluster 230 may communicate with the game client 210; or, the game servers in the game server cluster 230 may also communicate within the game server cluster 230.

[0077] The game client 210 refers to an application used by users to interact with online games, providing an interface for players to directly operate and experience. Exemplarily, the game client 210 can be a desktop application, such as a personal computer (PC) game client; or, the game client 210 can also be a mobile application, such as a mobile phone game client.

[0078] Among them, the game server cluster 230 is one of the core components in the online game architecture, responsible for processing game logic, managing data storage, and coordinating the interaction between multiple game clients. The game server cluster 230 runs in the background and is invisible to the players, but its performance and stability directly affect the game experience. The game server cluster 230 usually has high concurrent processing capabilities and low latency response characteristics to ensure a smooth user experience in a multiplayer online game environment.

[0079] Among them, the Game Server Gateway (GSG) 220 is an intermediate layer between the game client 210 and the game server cluster 230. The main functions of the Game Server Gateway 220 include managing and optimizing the transmission of data packets, isolating the background game server cluster 230, and ensuring efficient, reliable and secure transmission of game data. By preventing the background game server cluster 230 from directly contacting the game client 210, GSG effectively reduces the risk of the background game server cluster 230 being attacked by the outside world.

[0080] In order to ensure the data security of the entire game server cluster 230, all messages sent to the game client 210 must be transferred through the game server gateway 220. Similarly, messages sent from the game client 210 to the game server cluster 230 must also be transferred through the game server gateway 220. For the game client 210, the entire game server cluster 230 can be regarded as a black box, and the game client 210 can only interact with the game server gateway 220.

[0081] Please refer to Figure 3 , which shows a flowchart of a message processing method provided by an exemplary embodiment of the present application. The method is executed interactively by a gateway and a client device, the gateway is located between the client device and the server; optionally, the client device can be Figure 2 In the system shown, the game client 210, the gateway can be Figure 2 The game server gateway 220 in the system shown in the figure can be Figure 2 The game server cluster 230 in the system shown. Figure 3 As shown, the method may include step 310 , step 320 , step 330 , step 340 and step 350 .

[0082] Step 310: The gateway stores the message sent by the server to the client device in the message cache corresponding to the client device; different client devices have corresponding different message caches in the gateway.

[0083] In the embodiment of the present application, the message sent by the server to the client device needs to be cached and transferred by the gateway. Exemplarily, the gateway can store the service-related message provided by the server to the client device in the message cache corresponding to the client device.

[0084] The message cache may be a message memory storage area set by the gateway for each client device connected to the gateway, which is used to store messages sent by the server to the client device. The different client devices mentioned above have different message caches in the gateway, which may mean that each client device has an independent message memory storage area in the corresponding gateway. For example, when the gateway is connected to N client devices, the gateway is provided with N message caches, and the N message caches correspond to the N client devices one by one. For example, each message cache may be provided with a unique identifier for distinguishing different message caches in the gateway. The identifier may correspond to the identity information of the client device.

[0085] For example, the above Figure 2 For example, the game client 201 and the game client 202 have different corresponding message caches in the game server gateway 203. For example, the game server gateway 203 stores the message sent by the game server cluster 230 to the game client 201 in the message cache 1 corresponding to the game client 201, and the game server gateway 203 stores the message sent by the game server cluster 230 to the game client 202 in the message cache 2 corresponding to the game client 202.

[0086] Step 320: The gateway sends the message in the message buffer corresponding to the client device to the client device; accordingly, the client device receives the message forwarded by the server through the gateway.

[0087] Exemplarily, the gateway can search for a message cache corresponding to the client device in each message cache according to the identity information of the client device. In the case where the message cache corresponding to the client device stores a message to be sent, the gateway sends the message to be sent from the message cache corresponding to the client device to the client device. Correspondingly, the client device receives the above message sent by the gateway.

[0088] Step 330: The client device sends interaction information to the server through the gateway; accordingly, the gateway receives the interaction information sent by the client device to the server; the interaction information includes at least one of a heartbeat packet sent by the client device to the server, business data sent by the client device to the server, and message reception feedback information sent by the client device to the gateway.

[0089] The heartbeat packet may be a data packet sent periodically to detect the connection status between the client device and the server, to ensure that the connection status between the client device and the server is good, and to facilitate timely discovery of network interruptions, equipment failures and other problems.

[0090] The service data sent by the client device to the server may be data related to the service logic and fed back by the client device to the server according to the service provided by the server. Exemplarily, the service data may be at least one of the following data types:

[0091] 1) User authentication data: such as username and password used to log into a game account, and tokens used to verify user identity;

[0092] 2) User operation data: such as movement, skill and other operation instructions triggered by players on client devices;

[0093] 3) Social interaction data: such as chat content between players, team information, virtual item exchange information, etc.

[0094] The message reception feedback information sent by the client device to the gateway may be feedback information sent by the client device to the gateway according to the scope and quantity of the received messages, etc., for indicating to the gateway the messages that the client device has received. Exemplarily, the client device may send the message reception feedback information to the gateway when the specified conditions are met, or may send the message reception feedback information to the gateway periodically.

[0095] Step 340: The gateway obtains confirmation information carried in the interaction information; the confirmation information is used to indicate that the client device has received the message.

[0096] In an embodiment of the present application, the interactive information sent by the client device to the server may carry confirmation information. The confirmation information can indicate which messages the client device has received before sending the interactive information. In other words, the confirmation information can indicate the range of messages received by the client device. The gateway reads the confirmation information from the interactive information to obtain information about the messages that the client device has received.

[0097] Exemplarily, the above confirmation information may be a maximum message number; the maximum message number refers to the largest one among the corresponding message numbers of the messages that the client device has received. Specifically, the server may generate a unique message number corresponding to each message according to the order in which the messages are sent to the client device. Accordingly, the gateway sends the messages in the message cache corresponding to the client device to the client device according to the order of the message numbers. In other words, for the message that the server first sends to the client device, the gateway will also send it to the client device first when the connection between the client device and the server is restored. Afterwards, when the client device sends interactive information to the server, the above maximum message number is carried in the interactive information.

[0098] In a possible implementation, the client device may send a heartbeat packet or service data to the server as the interaction information to be sent first. Within a time period, if the client device does not need to send a heartbeat packet or service data to the server, the client device may immediately send a message receiving feedback information to the gateway, and carry confirmation information in the message receiving feedback information. For example, if the client device detects that no heartbeat packet or service data has been sent within the first specified time period before the current moment, the client device immediately sends a message receiving feedback information carrying the above confirmation information.

[0099] In another possible implementation, when the connection between the client device and the server is disconnected and then restored, the client device may use the message reception feedback information as the interactive information to be sent, and carry confirmation information in the message reception feedback information. That is, when the connection between the client device and the server is disconnected and then restored, the client device may first send a message reception feedback information to the gateway, and the message reception feedback information carries confirmation information.

[0100] Afterwards, the client device can use the heartbeat packet or service data sent to the server as interaction information, and carry confirmation information in the heartbeat packet or service data. That is to say, in most cases, the client device can feed back confirmation information to the gateway by sending a heartbeat packet or service data to the server. Since the heartbeat packet is a data packet sent periodically, even if the client device does not send service data to the server, the client device can also maintain a certain frequency of confirmation information feedback with the gateway by sending a heartbeat packet to the server.

[0101] Step 350: The gateway deletes the message that has been received by the client device from the message cache corresponding to the client device according to the confirmation information.

[0102] Exemplarily, after obtaining the confirmation message, the gateway may immediately execute the step of deleting the message that has been received by the client device in the message cache corresponding to the client device.

[0103] In another possible implementation, there may be a time period (e.g., 50ms) in the gateway, which can be preset by the developer to periodically execute the step of deleting the messages that have been received by the client device in the message cache corresponding to the client device. Specifically, for example, after obtaining the confirmation message, the gateway may add a deletion mark to the message to be deleted in the message cache; the gateway may query the message cache every 50ms to see if there is a message containing the deletion mark, and if so, delete the message containing the deletion mark.

[0104] To sum up, in the scheme shown in the embodiment of the present application, the gateway can store the message sent by the server to the client device in the message cache corresponding to the client device. When the client device sends interactive information to the server, it can carry confirmation information indicating that the client device has received the message, so that the gateway can promptly delete the received message in the message cache corresponding to the client device, avoiding invalid messages in the message cache occupying the cache space for a long time, thereby alleviating the cache space occupancy of the gateway and improving the utilization rate of the gateway cache.

[0105] In addition, since the confirmation information can be included in the heartbeat packet and business data, the heartbeat packet and business data are necessary information sent when there is a need for interaction between the client device and the server. Therefore, this solution can keep the gateway's memory usage as small as possible without significantly increasing the line overhead, thereby saving storage resources in the online game architecture.

[0106] This application Figure 3 The solution of the embodiment shown can be applied as a silent reconnection method during a game client disconnection. Figure 4 , which shows a flowchart of a silent reconnection method provided by an exemplary embodiment of the present application. Figure 4 As shown, when the connection between the game client and the game server is disconnected, the gateway caches the message sent by the game server to the game client in the message cache corresponding to the client device; at the same time, the game client and the game server send a heartbeat packet to the other end to detect whether the heartbeat has timed out. In other words, when the connection between the game client and the game server is disconnected, the game client and the game server can obtain the duration of the disconnection between the game client and the game server by sending a heartbeat packet to the other end. Among them, the developer can pre-set a reference duration (such as 2 minutes) to determine whether the heartbeat has timed out.

[0107] 1) If the duration of disconnection between the game client and the game server is less than the reference duration, that is, no heartbeat timeout occurs, for example, within 2 seconds after the connection between the game client and the game server is disconnected, the connection between the game client and the game server is restored; at this time, the gateway can send the message in the message cache corresponding to the client device to the client device. Correspondingly, the client device receives the message forwarded by the server through the gateway.

[0108] 2) If the duration of disconnection between the game client and the game server is not less than the reference duration, a heartbeat timeout occurs. For example, if the connection between the game client and the game server has been disconnected for 2 minutes, the game client and the game server each close the network connection with the other end, and the gateway can delete the message in the message cache corresponding to the client device.

[0109] The above silent reconnection method can cache the messages sent to the game client during the disconnection period in the game server gateway when the game client has a short network interruption. When the network connection of the game client is restored, the cached messages in the game server gateway can continue to be sent to the game client without omission. The game client can return to normal after receiving these cached messages, thereby avoiding the situation where the player returns to the login interface and needs to log in again due to network interruption, which significantly improves the player's gaming experience.

[0110] In addition, when the game client receives a message sent by the game server gateway, the game client can promptly notify the game server gateway of the message range it has received. Based on this message range, the server gateway can delete the corresponding cached messages, thereby keeping the cache capacity at a low level under normal circumstances and avoiding meaningless memory waste caused by the accumulation of cached messages.

[0111] On the one hand, in the case of a brief network outage on the game client, the game server gateway can cache messages sent by the game server to the game client. Figure 5 , which shows a schematic diagram of disconnection provided by an exemplary embodiment of the present application. Figure 5 As shown, in the case of a brief network interruption on the game client 502 and the game client 503, Figure 5 Message flows ③ and ④ in the game will be interrupted, while message flows ① and ② will not be affected. At this time, the message sent by the game server cluster 501 to the game client 502 will be stored in the message cache 1 of the game server gateway 504, and the message sent by the game server cluster 501 to the game client 503 will be stored in the message cache 2 of the game server gateway 504.

[0112] As long as the client's network interruption is short-lived and the message cache does not overflow when the interruption is restored, the cached messages can be resent to the client without omission. However, the size of the message cache is usually limited. Therefore, if the client network interruption lasts for a long time (such as 1 hour), the message cache may overflow, causing some messages to be discarded. For example, the upper limit of the message cache is 1500 messages, and the number of messages during the client network interruption is greater than 1500. Therefore, after the client network interruption is restored, the messages received by the client may be missed. When the gateway detects that a message is missed, it can actively disconnect the network connection; it can also inform the client and the client will actively disconnect the network connection.

[0113] On the other hand, when the game client network is restored, the game server gateway can send the cached messages to the game client, so that the game client user does not perceive the network interruption. In order to reduce the cache occupancy of the game server gateway, the game client can inform the game server gateway of the received messages when sending messages to the game server gateway. The game server gateway will then delete these received messages from the cache to free up the cache space.

[0114] Specifically, each game client is set up with a message cache at the game server gateway. When the game client successfully receives a message in the message cache, if the game server gateway does not delete the message in the corresponding message cache in time, the message cache may continue to be full after reaching the maximum capacity. In this case, the occupation of memory resources is completely unnecessary, resulting in unnecessary memory overhead.

[0115] When the game client receives a message in the message cache, it can promptly notify the game server gateway of the message range it has received. The game server gateway can delete the corresponding message in the message cache according to the message range the game client has received, so that the cache capacity of the message cache is kept at a low level under normal circumstances.

[0116] It should be noted that when a game client experiences a short network interruption, the corresponding message cache will temporarily increase, but this is limited to the message cache of the game client, and the cache of the overall game server gateway will not increase significantly. Unless most game clients experience a network interruption at the same time, but this situation is extremely rare.

[0117] Taking the above confirmation information as the maximum message number as an example, please refer to Figure 6 , which shows a schematic diagram of connection recovery provided by an exemplary embodiment of the present application. Figure 6As shown, when the connection between the game client 601 and the game server cluster 602 is restored, the game server gateway 603 sends the message in the message cache 1 corresponding to the game client 601 to the game client 601 through the message flow ①, that is, the game client 601 receives the message stored from the game server gateway 603 through the message flow ①. When the game client 601 receives the message, it will update the maximum message number it receives. When the game client 601 needs to send an interactive message to the game server cluster 602, the maximum message number of the message that the game client 601 has received can be carried in the interactive information; accordingly, the game server gateway 603 obtains the maximum message number carried in the interactive information. For example, the game server gateway 603 can notify the game server gateway 603 through the message flow ② that the maximum message number currently received by the game client 601 is msg:1003. At this time, msg:1001, msg:1002, msg:1003, msg:1004 and msg:1005 are stored in message cache 1. Therefore, the game server gateway 603 can delete all messages with numbers less than or equal to 1003 in message cache 1 according to the maximum message number msg:1003. Figure 6 msg:1001, msg:1002 and msg:1003 in the message buffer, thereby freeing up the space occupied by message buffer 1.

[0118] During the operation of online games, the game client communicates with the game server. During this process, there may be a short network interruption, such as network jitter or taking the subway through an area with poor signal. When such a short network interruption occurs, the status of the game server cannot be synchronized to the game client in time, causing the game logic of the game client to be unable to continue running, which in turn causes the game client to be disconnected. Among them, when the network connection is restored, the player can log in again and continue the game.

[0119] However, many network outages are only short-lived (e.g., 1 to 2 seconds). Forcing players to log in again will significantly affect their gaming experience. In the case of a short network outage, the game server gateway can cache messages sent by the game server to the game client during the network outage, and resend these cached messages to the game client after the network connection is restored.

[0120] However, relying solely on the game server gateway to cache messages sent from the server to the game client during a network interruption may result in increased memory pressure on the game server gateway.

[0121] Specifically, during a network outage, the game server gateway needs to cache messages sent to the game client. Since each game client connection requires a separate cache, if a single game server gateway is associated with a large number of game client connections, memory consumption will be very significant. In addition, even during non-network outages, this part of the cache will still occupy memory resources, resulting in memory waste.

[0122] In order to address the above problem, the solution provided by the above embodiment of the present application can notify the game server which messages have been received by the game client when the game client sends a message to the game server. In this way, the game server can delete the cache of these received messages, thereby reducing the cache overhead.

[0123] In most cases, the network connection between the game client and the game server is stable, so the amount of cached messages in the game server gateway is usually small. When a game client connection experiences a brief network interruption, the cache amount may increase significantly, but this is limited to the cache growth of a single game client connection and has little impact on the cache occupancy of the entire game server gateway. Unless all game clients experience a network interruption at the same time, but the probability of this happening is extremely low and can be ignored.

[0124] For a single game client connection, if the network connection is interrupted for too long, resulting in too many messages sent to the game client by the game server gateway cache, exceeding the cache limit of a single game client connection, the cached messages may be lost. When the game client network connection is restored, the cached message numbers sent by the game server may be discontinuous. In this case, the game client will actively disconnect and return to the login interface, and the user needs to log in again to continue the game.

[0125] If the game client's network connection is interrupted for a long time and is not restored, both the game client and the game server will detect a heartbeat timeout and then close the network connection with the other end.

[0126] Based on the above Figure 3 For the solution in the embodiment shown, please refer to Figure 7 , which shows a flow chart of a message processing method provided by an exemplary embodiment of the present application. Figure 7 As shown, the message processing method further includes step 360 and step 370.

[0127] Step 360: When the memory capacity of the server is insufficient, the gateway adjusts the upper limit of the message capacity of the message cache corresponding to the first client device from the first message capacity to the second message capacity; the second message capacity is smaller than the first message capacity; the first client device is a client device among at least one client device, and the data volume of the message in the corresponding message cache is smaller than the data volume threshold.

[0128] Step 370: When the memory capacity of the server is sufficient, the message capacity upper limit of the message cache corresponding to the first client device is restored to the first message capacity.

[0129] The insufficient memory capacity of the server may be that the memory capacity of the server is less than a specified memory capacity, and the specified capacity may be preset by a developer, for example, the specified capacity is 5% of the upper limit of the memory capacity of the server. Accordingly, the sufficient memory capacity of the server may be that the memory capacity of the server is not less than the specified memory capacity.

[0130] The first message capacity, the second message capacity, and the data volume threshold may also be preset by the developer. For example, the data volume threshold may be equal to the second message capacity or may be less than the second message capacity.

[0131] For example, if the first message capacity is 1500, the second message capacity is 1000, and the data volume threshold is 800, when the server's memory capacity is insufficient, the gateway can obtain the data volume of messages in the message cache corresponding to each client device connected to the gateway, and reduce the upper limit of the message capacity of the message cache corresponding to the client device with less than 800 messages (i.e., the first client device) to 1000. Correspondingly, when the server's memory capacity is sufficient, the upper limit of the message capacity of the message cache corresponding to the first client device is increased to 1500.

[0132] Based on the above embodiments, this embodiment provides a solution in which the gateway can dynamically adjust the message capacity upper limit of the message cache, which may specifically include: when the memory capacity of the server is insufficient, the gateway can reduce the message capacity upper limit of the message cache corresponding to the first client device; when the memory capacity of the server is sufficient, the gateway can restore the message capacity upper limit of the message cache corresponding to the first client device; this solution can improve the flexibility of the message cache.

[0133] Based on the above Figure 3 For the solution in the embodiment shown, please refer to Figure 8 , which shows a flow chart of a message processing method provided by an exemplary embodiment of the present application. Figure 8 As shown, the message processing method further includes step 380 and step 390.

[0134] Step 380: When the remaining message capacity of the message cache corresponding to the second client device is insufficient and the connection between the second client device and the server is not disconnected, the gateway sends a cache warning message to the second client device; accordingly, the second client device receives the cache warning message; wherein the cache warning message is used to instruct the second client device to determine the information type of the next interaction information.

[0135] Step 390: According to the cache warning information, the second client device determines the information type of the next interaction information in the following manner:

[0136] In the case where there is service data to be sent in the client device, determining that the next interaction information is the service data;

[0137] If there is no business data to be sent in the client device and the sending time of the next heartbeat packet is within a specified time after the current time, determine that the next interaction information is a heartbeat packet; the specified time is less than the sending time interval between two adjacent heartbeat packets;

[0138] When there is no service data to be sent in the client device and the sending time point of the next heartbeat packet is outside the specified time period after the current time, it is determined that the next interaction information is the message receiving feedback information to be sent immediately.

[0139] The remaining message capacity of the message cache corresponding to the second client device refers to the difference between the upper limit of the message capacity of the message cache corresponding to the second client device and the cache message capacity currently in use. The remaining message capacity of the message cache corresponding to the second client device is insufficient, which may be that the remaining message capacity of the message cache corresponding to the second client device is less than the specified message capacity, and the specified message capacity may be 10% of the upper limit of the message capacity of the message cache corresponding to the second client device.

[0140] The cache warning information is used to indicate to the second client device that the remaining message capacity of the current message cache is small, so as to remind the second client device to send the interaction information carrying the confirmation information to the server as soon as possible.

[0141] Accordingly, after the second client device receives the cache warning information, it determines that one of the heartbeat packet sent by the client device to the server, the service data sent by the client device to the server, and the message reception feedback information sent by the client device to the gateway is the next interaction information.

[0142] Specifically, the client device may first query whether there is any business data to be sent. If there is business data to be sent in the client device, the second client device carries confirmation information in the next business data to be sent.

[0143] If there is no business data to be sent in the client device, the client device can query whether the time point for sending the next heartbeat packet is included within the specified time after the current moment; if the time point for sending the next heartbeat packet is within the specified time after the current moment, the second client device carries confirmation information in the next heartbeat packet sent. The above specified time can be preset by the developer and is less than the time interval between sending two adjacent heartbeat packets.

[0144] In the case that the sending time point of the next heartbeat packet is outside the specified time period after the current time point, the second client device may immediately send message reception feedback information, and carry confirmation information in the message reception feedback information.

[0145] Based on the above embodiments, this embodiment enables the gateway to send cache warning information to the second client device when the remaining message capacity of the message cache corresponding to the second client device is insufficient and the connection between the second client device and the server is not disconnected, so that the second client device can send interactive information carrying confirmation information to the server as soon as possible, and the gateway can promptly delete the message that the second client device has received in the message cache corresponding to the second client device.

[0146] In some embodiments, within a period of time after the gateway sends the above cache warning information, when the gateway receives all interactive information (including business data, heartbeat packets, and message reception feedback information) sent by the second client device, it needs to parse the above interactive information to determine whether the above interactive information carries confirmation information. If the above interactive information carries confirmation information, the gateway extracts the confirmation information and deletes the message that the second client device has received in the message cache corresponding to the second client device. At the same time, the above interactive information is forwarded to the server.

[0147] In a possible implementation, when the interaction information is a heartbeat packet or service data, step 340 may be implemented as follows:

[0148] The gateway parses the header of the data packet containing the interactive information;

[0149] In the case where the packet header of the data packet containing the interactive information contains the designated identifier, the gateway reads the confirmation information from the data packet containing the interactive information;

[0150] The designated identifier is used to indicate that the interaction information carries confirmation information.

[0151] Since the interactive information sent by the client device to the server may or may not carry confirmation information, in the embodiment of the present application, when the gateway obtains the confirmation information carried in the interactive information, it can parse the header of the data packet containing the interactive information; if the header of the data packet containing the interactive information contains a specified identifier, then the gateway can read the confirmation information from the data packet containing the interactive information.

[0152] Exemplarily, the above-mentioned designated identifier can be one or a group of bits specified by the developer in the packet header. For example, the developer defines a bit ACK_Flag as the designated identifier in the packet header, where ACK_Flag = 0 indicates that the data packet does not contain confirmation information; ACK_Flag = 1 indicates that the data packet contains confirmation information. Accordingly, after the gateway receives the interactive information, it can first parse the header of the data packet where the interactive information is located and check the value of ACK_Flag. If the value of ACK_Flag is 1, the confirmation information is read from the data packet and processed; if the value of ACK_Flag is 0, the processing step of the confirmation information is skipped.

[0153] Based on the above embodiments, when obtaining the confirmation information carried in the interactive information, the gateway of this embodiment can first check whether there is a specified identifier in the packet header. If so, the confirmation information is read from the data packet, so that the gateway can identify the interactive information carrying the confirmation information, avoid unnecessary information reading process, and simplify the processing logic of the gateway.

[0154] That is to say, when the second client device sends business data and heartbeat packets carrying confirmation information, it can add a specified identifier in the packet header of the data packet containing the business data and heartbeat packet, which is used to indicate that the current business data or heartbeat packet carries confirmation information.

[0155] Accordingly, within a period of time after the gateway sends the above-mentioned cache warning information, when the gateway receives part of the interactive information (including business data and heartbeat packets) sent by the second client device, it needs to parse the header of the data packet containing the above-mentioned interactive information, and determine whether the header of the data packet containing the above-mentioned interactive information contains the above-mentioned designated identifier, and then determine whether the above-mentioned interactive information carries confirmation information. In the case where the header of the data packet containing the above-mentioned interactive information contains the designated identifier, the gateway can extract the confirmation information from the above-mentioned interactive information, which is used to delete the message that the second client device has received in the message cache corresponding to the second client device. At the same time, the above-mentioned interactive information is forwarded to the server.

[0156] Based on the above Figure 6 In the solution in the embodiment shown, in a possible implementation solution, the message processing method further includes:

[0157] When it is detected that the connection between the third client device and the server is disconnected, the gateway increases the message capacity upper limit of the message cache corresponding to the third client device from the third message capacity to the fourth message capacity; the fourth message capacity is greater than the third message capacity; the third client device is any one of the at least one client device;

[0158] When detecting that the connection between the third client device and the server is restored and the data volume of messages in the message cache corresponding to the third client device is less than the data volume threshold, the gateway restores the message capacity upper limit of the message cache corresponding to the third client device to the third message capacity.

[0159] The disconnection between the third client device and the server refers to the disconnection between the third client device and the gateway; at this time, the gateway can normally receive messages sent by the server, so the gateway can store messages sent by the server to the client device. Exemplarily, when the connection between the third client device and the server is disconnected, the third client device can try to restore the connection with the gateway.

[0160] It should be noted that during the period when the connection between the third client device and the server is disconnected, the server can send a message to the third client device, and the message will be stored in the message cache corresponding to the third client device of the gateway. At this time, if the server continues to send messages to the third client device, or the server sends a large number of messages to the third client device, this may cause the capacity of the message cache corresponding to the third client device to be tight, resulting in message loss. For example, when the data volume of the message in the message cache corresponding to the third client device reaches the message capacity upper limit of the message cache corresponding to the third client device, if the server continues to send messages to the third client device, the gateway can only delete the historical messages in the message cache to accommodate the new messages.

[0161] Therefore, in an embodiment of the present application, the gateway can increase the message capacity upper limit of the message cache corresponding to the third client device, so that the capacity of the message cache corresponding to the third client device can accommodate more data sent by the server to the third client device.

[0162] The connection recovery between the third client device and the server mentioned above refers to the restoration of the connection after the connection between the third client device and the server is disconnected. At this time, the gateway can confirm the identity information of the third client device, and search for the message cache corresponding to the client device in each message cache according to the identity information of the third client device, and forward the message in the message cache to the third client device; after that, the gateway deletes the message that the client device has received in the message cache corresponding to the client device according to the confirmation information carried in the interaction information sent by the third client device; when the data volume of the message in the message cache corresponding to the third client device is less than the data volume threshold, the gateway can restore the message capacity upper limit of the message cache corresponding to the third client device.

[0163] The data volume threshold may be preset by a developer. For example, the data volume threshold may be equal to the third message capacity or may be less than the third message capacity.

[0164] Exemplarily, taking the third message capacity of the message cache corresponding to the third client device as 100 as an example, when it is detected that the connection between the third client device and the server is disconnected, the gateway may increase the upper limit of the message capacity of the message cache corresponding to the third client device to 1500; when it is detected that the connection between the third client device and the server is restored, and the amount of data of the messages in the message cache corresponding to the third client device is less than 100, the gateway may restore the upper limit of the message capacity of the message cache corresponding to the third client device to 100.

[0165] Based on the above embodiments, this embodiment provides a solution in which the gateway can dynamically adjust the upper limit of the message capacity of the message cache, which may specifically include: when it is detected that the connection between the third client device and the server is disconnected, the gateway can increase the upper limit of the message capacity of the message cache corresponding to the third client device; when it is detected that the connection between the third client device and the server is restored, the gateway can restore the upper limit of the message capacity of the message cache corresponding to the third client device when the data volume of the messages in the message cache corresponding to the third client device is less than the data volume threshold; this solution can improve the flexibility of the message cache, avoid message loss due to insufficient capacity of the message cache, and thereby improve the reliability of message transmission.

[0166] Based on the above Figure 6 In the solution in the embodiment shown, in a possible implementation solution, the above step 360 can be implemented as follows:

[0167] When it is detected that the connection between the third client device and the server is disconnected, the gateway determines, based on the cache related information, an increase in the capacity upper limit of the message cache corresponding to the third client device;

[0168] According to the capacity upper limit increase amount, the gateway increases the capacity upper limit of the message cache corresponding to the third client device from the third message capacity to the fourth message capacity;

[0169] The cache-related information includes one or more of the following information:

[0170] The remaining available cache capacity in the gateway;

[0171] The number of client devices connected to the gateway that have been disconnected from the server within a specified period of time before the current time.

[0172] The above-mentioned capacity upper limit increase refers to the data capacity that the gateway can currently allocate to the message cache corresponding to the third client device.

[0173] The remaining available cache capacity in the above-mentioned gateway refers to the difference between the total cache capacity of the gateway and the cache capacity currently in use, and the difference reflects the remaining amount of the message cache that the gateway can currently allocate to the corresponding third client device.

[0174] It should be noted that, when there are multiple client devices connected to the gateway, the gateway needs to reserve capacity for other client devices that have been disconnected from the server. For example, when the network is unstable, multiple client devices connected to the gateway may be disconnected from the server one after another. Therefore, the cache-related information may also include the number of client devices that have been disconnected from the server among the client devices connected to the gateway within a specified period of time before the current moment.

[0175] The specified time period may be preset by the developer. For example, the developer may determine the specified time period based on the reason why the connection between the third client device and the server is disconnected. For example, if the reason why the connection between the third client device and the server is disconnected is due to network instability, the specified time period may be 2 minutes.

[0176] Based on the above embodiments, this embodiment provides a feasible solution for determining how to increase the capacity upper limit, which may specifically include: determining the amount of capacity upper limit increase based on cache-related information, and then increasing the capacity of the message cache corresponding to the third client device, the cache-related information includes the remaining available cache capacity in the gateway, and / or, within a specified period of time before the current moment, the number of client devices connected to the gateway that have been disconnected from the server; this solution can improve the accuracy of determining the above-mentioned fourth message capacity and improve the utilization rate of the gateway cache.

[0177] Please refer to Fig. 9, which shows a block diagram of a message processing device shown in an exemplary embodiment of the present application, the device can be used to perform the following Figure 3 , Figure 7 or Figure 8 In the method shown, all or part of the steps performed by the computer device are as follows Fig. 9 As shown, the device comprises:

[0178] Storage module 901, used to store the message sent by the server to the client device in the message cache corresponding to the client device; different client devices have different corresponding message caches in the gateway;

[0179] A sending module 902, configured to send a message in a message buffer corresponding to a client device to the client device;

[0180] The receiving module 903 is used to receive the interaction information sent by the client device; the interaction information includes at least one of the heartbeat packet sent by the client device to the server, the service data sent by the client device to the server, and the message reception feedback information sent by the client device to the gateway;

[0181] The acquisition module 904 is used to acquire confirmation information carried in the interaction information; the confirmation information is used to indicate the message that the client device has received;

[0182] The deleting module 905 is used to delete the message that has been received by the client device in the message cache corresponding to the client device according to the confirmation information.

[0183] In some embodiments, the message processing device further includes: a capacity adjustment module, which is used to adjust the message capacity upper limit of the message cache corresponding to the first client device from the first message capacity to the second message capacity when the memory capacity of the server is insufficient; the second message capacity is smaller than the first message capacity; the first client device is a client device among at least one client device, the data volume of the message in the corresponding message cache is smaller than the data volume threshold;

[0184] The capacity adjustment module is used to restore the message capacity upper limit of the message cache corresponding to the first client device to the first message capacity when the memory capacity of the server is sufficient.

[0185] In some embodiments, the message processing device further includes: a cache warning module, configured to send cache warning information to the second client device when the remaining message capacity of the message cache corresponding to the second client device is insufficient and the connection between the second client device and the server is not disconnected;

[0186] The cache warning information is used to instruct the second client device to determine the information type of the next interaction information.

[0187] Please refer to Fig.10 , which shows a block diagram of a message processing device shown in an exemplary embodiment of the present application, the device can be used to perform the following Figure 3 , Figure 7 or Figure 8 In the method shown, all or part of the steps performed by the computer device are as follows Fig.10 As shown, the device comprises:

[0188] Receiving module 1001, used for receiving messages forwarded by the server through the gateway;

[0189] The sending module 1002 is used to send interaction information to the server through the gateway; the interaction information includes at least one of a heartbeat packet sent by the client device to the server, service data sent by the client device to the server, and message reception feedback information sent by the client device to the gateway; the interaction information carries confirmation information; the confirmation information is used to indicate the message that the client device has received, so that the gateway deletes the message that the client device has received from the message cache corresponding to the client device according to the confirmation information;

[0190] The message cache is used to cache messages sent from the server to the client device; different client devices have corresponding message caches in the gateway.

[0191] In some embodiments, the message processing device further includes: an early warning receiving module, configured to receive cache early warning information, the cache early warning information being sent by the gateway when the remaining message capacity of the message cache corresponding to the client device is insufficient and the connection between the client device and the server is not disconnected;

[0192] The message processing device further includes: an information determination module, configured to determine the information type of the next interactive information according to the cached warning information in the following manner:

[0193] In the case where there is service data to be sent in the client device, determining that the next interaction information is the service data;

[0194] If there is no business data to be sent in the client device and the sending time of the next heartbeat packet is within a specified time after the current time, determine that the next interaction information is a heartbeat packet; the specified time is less than the sending time interval between two adjacent heartbeat packets;

[0195] When there is no service data to be sent in the client device and the sending time point of the next heartbeat packet is outside the specified time period after the current time, it is determined that the next interaction information is the message receiving feedback information to be sent immediately.

[0196] One point that needs to be explained is that the device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example to implement its functions. In actual applications, the above-mentioned functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0197] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method; the technical effects achieved by each module performing operations are the same as those in the embodiment of the method, and will not be elaborated here.

[0198] Please refer to Fig.11 , which shows a structural block diagram of a computer device 1100 shown in an exemplary embodiment of the present application. The computer device can be implemented as a server in the above-mentioned solution of the present application. The computer device 1100 includes a central processing unit (CPU) 1101, a system memory 1104 including a random access memory (RAM) 1102 and a read-only memory (ROM) 1103, and a system bus 1105 connecting the system memory 1104 and the central processing unit 1101. The computer device 1100 also includes a large-capacity storage device 1106 for storing an operating system 1109, an application program 1110 and other program modules 1111.

[0199] The mass storage device 1106 is connected to the central processing unit 1101 through a mass storage controller (not shown) connected to the system bus 1105. The mass storage device 1106 and its associated computer readable medium provide non-volatile storage for the computer device 1100. That is, the mass storage device 1106 may include a computer readable medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.

[0200] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electronically-Erasable Programmable Read-Only Memory (EEPROM) flash memory or other solid-state storage technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above. The above-mentioned system memory 1104 and mass storage device 1106 can be collectively referred to as memory.

[0201] According to various embodiments of the present disclosure, the computer device 1100 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 1100 can be connected to the network 1108 through the network interface unit 1107 connected to the system bus 1105, or the network interface unit 1107 can be used to connect to other types of networks or remote computer systems (not shown).

[0202] The memory also includes at least one computer instruction, which is stored in the memory. The central processing unit 1101 implements all or part of the steps in the methods shown in the above embodiments by executing the at least one computer instruction.

[0203] In an exemplary embodiment, a chip is also provided. The chip includes a programmable logic circuit and program instructions. When the chip runs on a computer device, it is used to implement the message processing method in the above aspect.

[0204] In an exemplary embodiment, a computer program product is also provided, the computer program product includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor reads and executes the computer instructions from the computer-readable storage medium to implement the message processing method provided by the above-mentioned method embodiments.

[0205] In an exemplary embodiment, a computer-readable storage medium is further provided, in which computer instructions are stored. The computer instructions are loaded and executed by a processor to implement the message processing methods provided by the above-mentioned method embodiments.

[0206] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0207] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0208] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A message processing method, It is characterized in that The method is performed by a gateway, the gateway being located between a server and at least one client device, and the method comprises: The message sent by the server to the client device is stored in the message cache corresponding to the client device; different client devices have different corresponding message caches in the gateway; Sending a message in a message buffer corresponding to the client device to the client device; receiving interaction information sent by the client device; the interaction information includes at least one of a heartbeat packet sent by the client device to the server, service data sent by the client device to the server, and message reception feedback information sent by the client device to the gateway; Acquire confirmation information carried in the interaction information; the confirmation information is used to indicate the message that the client device has received; According to the confirmation information, the message already received by the client device is deleted from the message cache corresponding to the client device.

2. The method according to claim 1, It is characterized in that The method further comprises: In the case where the memory capacity of the server is insufficient, adjusting the message capacity upper limit of the message cache corresponding to the first client device from the first message capacity to the second message capacity; the second message capacity is smaller than the first message capacity; the first client device is the client device for which the data volume of the message in the corresponding message cache is smaller than the data volume threshold value among at least one of the client devices; When the memory capacity of the server is sufficient, the message capacity upper limit of the message cache corresponding to the first client device is restored to the first message capacity.

3. The method according to claim 1, It is characterized in that The method further comprises: When the remaining message capacity of the message cache corresponding to the second client device is insufficient and the connection between the second client device and the server is not disconnected, sending cache warning information to the second client device; The cache warning information is used to instruct the second client device to determine the information type of the next interaction information.

4. A message processing method, It is characterized in that The method is performed by a client device, at least one of the client devices corresponds to a gateway between the client device and the server, and the method includes: receiving a message forwarded by the server through the gateway; sending interaction information to the server through the gateway; the interaction information includes at least one of a heartbeat packet sent by the client device to the server, service data sent by the client device to the server, and message reception feedback information sent by the client device to the gateway; the interaction information carries confirmation information; the confirmation information is used to indicate that the client device has received the message, so that the gateway deletes the message received by the client device from the message cache corresponding to the client device according to the confirmation information; The message cache is used to cache the message sent by the server to the client device; different client devices have corresponding different message caches in the gateway.

5. The method according to claim 4, It is characterized in that The method further comprises: receiving cache warning information, wherein the cache warning information is sent by the gateway when the remaining message capacity of the message cache corresponding to the client device is insufficient and the connection between the client device and the server is not disconnected; According to the cache warning information, the information type of the next interaction information is determined in the following manner: In a case where the service data to be sent exists in the client device, determining that the next interaction information is the service data; In the case where the service data to be sent does not exist in the client device and the sending time point of the next heartbeat packet is within a specified time after the current time, determining that the next interaction information is the heartbeat packet; the specified time is less than the time interval between the sending of two adjacent heartbeat packets; When there is no business data to be sent in the client device and the sending time of the next heartbeat packet is outside the specified time after the current time, it is determined that the next interaction information is the message reception feedback information to be sent immediately.

6. A message processing device, It is characterized in that The device comprises: A storage module, used for storing the message sent by the server to the client device in the message cache corresponding to the client device; different client devices have different corresponding message caches in the gateway; A sending module, used to send the message in the message buffer corresponding to the client device to the client device; A receiving module, configured to receive interaction information sent by the client device; the interaction information includes at least one of a heartbeat packet sent by the client device to the server, service data sent by the client device to the server, and message reception feedback information sent by the client device to the gateway; An acquisition module, used to acquire confirmation information carried in the interaction information; the confirmation information is used to indicate the message that the client device has received; The deleting module is used to delete the message that has been received by the client device in the message cache corresponding to the client device according to the confirmation information.

7. A message processing device, It is characterized in that The device comprises: A receiving module, used for receiving a message forwarded by the server through the gateway; a sending module, configured to send interaction information to the server through the gateway; the interaction information includes at least one of a heartbeat packet sent by the client device to the server, service data sent by the client device to the server, and message reception feedback information sent by the client device to the gateway; the interaction information carries confirmation information; the confirmation information is used to indicate that the client device has received the message, so that the gateway deletes the message received by the client device from the message cache corresponding to the client device according to the confirmation information; The message cache is used to cache the message sent by the server to the client device; different client devices have corresponding different message caches in the gateway.

8. A computer device, It is characterized in that The computer device includes a processor and a memory, wherein the memory stores at least one computer instruction, and the at least one computer instruction is loaded and executed by the processor to implement the message processing method according to any one of claims 1 to 5.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores at least one computer instruction, and the computer instruction is loaded and executed by the processor to implement the message processing method according to any one of claims 1 to 5.

10. A computer program product, It is characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium; the computer instructions are read and executed by a processor of a computer device to implement the message processing method according to any one of claims 1 to 5.