CN115348231B - Message processing method, device, server side and storage medium - Google Patents
Message processing method, device, server side and storage medium Download PDFInfo
- Publication number
- CN115348231B CN115348231B CN202210987809.2A CN202210987809A CN115348231B CN 115348231 B CN115348231 B CN 115348231B CN 202210987809 A CN202210987809 A CN 202210987809A CN 115348231 B CN115348231 B CN 115348231B
- Authority
- CN
- China
- Prior art keywords
- message
- preset
- queue
- priority level
- processing
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 16
- 238000000034 method Methods 0.000 claims abstract description 40
- 238000004590 computer program Methods 0.000 claims description 4
- 230000000694 effects Effects 0.000 abstract description 5
- 230000008569 process Effects 0.000 description 14
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000009471 action Effects 0.000 description 2
- 238000012512 characterization method Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006837 decompression Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/80—Responding to QoS
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The present application relates to the field of message systems, and in particular, to a message processing method, a device, a server side, and a storage medium. The method comprises the following steps: acquiring a message sent by a client and determining a message type corresponding to the message; determining the priority level corresponding to the message according to the message type, wherein the priority level is in a proportional relation with the real-time property of the message; and if the priority level is higher than the preset priority level, callback processing is carried out on the message. The application relates to a message processing method, a device, a server and a storage medium, which can improve the message processing efficiency and further improve the use experience effect of a user.
Description
Technical Field
The present application relates to the field of message systems, and in particular, to a message processing method, a device, a server side, and a storage medium.
Background
A message is a unit of data, such as text characters, that is transmitted between two computers. The message producer is used for producing data, namely producing messages, the produced messages are sent to the message processor, the message processor processes the messages, and after the message producer produces the messages, the next message processing can not be carried out until the messages are processed by the message processor, so that the message processing efficiency is affected.
A message queue is a container used to temporarily store messages produced by a message producer for processing by a message processor callback message. The purpose of the message queue is to provide routing and to ensure delivery of messages, and if a recipient is not available when sending a message, the message queue will hold the message until successful delivery is possible, the message queue providing message handling and message queue functionality for any application. Therefore, in order to improve the communication efficiency of the message, after the message producer produces one message, the message is stored in the message queue, and the message processor does not need to wait for the message processor to process and then return, but can acquire the message and process the message by accessing the message queue, so that the work between the message producer and the message processor is asynchronous processing mode, and the message processing efficiency is improved.
The message queue is used as a first-in first-out message storage area, the messages are stored according to the receiving sequence of the messages, the messages received first are processed first, and after the messages are processed, the messages are deleted.
However, after the message is stored in a message queue, some messages are urgent messages, a period of time is needed to wait before the urgent messages are processed, the urgent messages can be processed after the message processor processes the messages before the urgent messages, the urgent messages are difficult to be processed in time by the message processor, the phenomenon of message delay occurs, and the user experience is reduced.
Disclosure of Invention
In order to solve at least one of the above problems, the present application provides a message processing method, a device, a server and a storage medium.
In a first aspect, the present application provides a message processing method, which adopts the following technical scheme:
a message processing method, comprising:
acquiring a message sent by a client and determining a message type corresponding to the message;
determining a priority level corresponding to the message according to the message type, wherein the priority level is in a proportional relation with the real-time property of the message;
and if the priority level is higher than the preset priority level, callback processing is carried out on the message.
By adopting the technical scheme, when the message sent by the client is acquired, the message type of the message is determined to determine the priority level corresponding to the message type, and when the priority level is higher than the preset priority level, namely when the received message has high real-time requirement, the message with high real-time requirement is subjected to callback processing, and the message is not stored in the original message queue, so that the message with high real-time requirement can be processed in time, the waiting time can be reduced, the processing efficiency of the message with high real-time requirement can be improved, and the user experience can be improved.
In one possible implementation manner, the callback processing is performed on the message, including any one of the following:
storing the message to a first preset queue, and carrying out callback processing on the message based on the first preset queue, wherein the first preset queue is used for storing the message with the priority higher than the preset priority;
storing the message to a second preset queue, and carrying out callback processing on the message based on the second preset queue, wherein the second preset queue is only used for storing the message;
and directly carrying out callback processing on the message.
By adopting the technical scheme, when callback processing is carried out on the message with the priority level higher than the preset priority level, on one hand, the message can be stored into a message queue for storing all the messages with the priority level higher than the preset priority level, and callback processing is carried out on the basis of the queue, that is, the message with higher instantaneity and the message with lower instantaneity are stored separately for callback, so that waiting time can be further reduced, and the processing efficiency of the message with higher instantaneity requirement can be improved; the second aspect can store the message with higher priority into a second preset queue dedicated for storing the message, that is, only the message with higher real-time performance currently received is stored in one queue, so as to perform message callback processing based on the queue, thereby further reducing waiting time and improving processing efficiency of the message with high real-time performance requirement; the third aspect can also directly process the callback of the message, the waiting time is shorter, the processing effect of the message with high real-time requirement is higher, and the user experience can be further improved.
In another possible implementation manner, the callback processing on the message further includes:
determining a processing level corresponding to the message based on attribute information carried in the message, wherein the attribute information comprises: at least one of client information of the message, sending equipment information of the message and user information corresponding to the client is sent, and the processing level and the instantaneity of the message are in a proportional relation;
if the processing level is higher than a preset processing level, determining a third preset queue based on the message type, wherein the third preset queue is a queue corresponding to the message type and is used for storing the message higher than the preset processing level in the message type;
storing the message into the third preset queue;
the callback processing for the message comprises the following steps:
and carrying out callback processing on the message based on the third preset queue.
By adopting the technical scheme, before callback processing is performed on the message with the priority level higher than the preset priority level, the processing level corresponding to the message can be determined based on at least one of the client information, the equipment information and the user information corresponding to the received message, and when the processing level of the message is higher than the preset level, the message can be temporarily stored in the third preset queue corresponding to the message type to perform callback, that is, even if the message type is of a type with high real-time requirement, the message with higher processing level can be further selected from the message with high real-time requirement to separately store the callback, so that the callback efficiency of the message can be further improved, and the processing efficiency of the message with high real-time requirement and higher processing level can be further improved.
In a possible implementation manner, the determining the message type corresponding to the message includes any one of the following:
determining a message type corresponding to the message according to the Key carried in the message and based on the corresponding relation between the Key and the message type;
and determining the Key corresponding to the message based on the message, and determining the message type corresponding to the message based on the corresponding relation between the Key and the message type.
By adopting the technical scheme, when the message type corresponding to the message is determined and then the priority level corresponding to the message is determined, the message type corresponding to the message can be determined according to the Key carried in the message, and when the message is acquired, the Key corresponding to the message can be determined according to the message and then the message type corresponding to the message is determined, so that two possible implementation modes can be provided for determining the message type.
In one possible implementation manner, determining the message type corresponding to the message based on the correspondence between the Key and the message type further includes:
and establishing a corresponding relation between the Key and the message type.
By adopting the technical scheme, the corresponding relation between the pre-established Key and the message type is adopted, so that the pre-established corresponding relation can be utilized to more rapidly and accurately determine the message type corresponding to the message after the Key corresponding to the message is received later, and further the user experience can be improved.
In one possible implementation, the method further includes any one of the following:
if the priority level is not higher than the preset priority level, storing the message into a fourth preset queue, and performing callback processing on the message based on the fourth preset queue, wherein the fourth preset queue is used for storing the message not higher than the preset priority level;
and if the priority level is not higher than the preset priority level, storing the message into a fifth preset queue, and performing callback processing on the message based on the fifth preset queue, wherein the fifth preset queue is a queue corresponding to the message type.
By adopting the technical scheme, for the messages with the priority level not higher than the preset priority level, namely, the messages with lower real-time requirements, on one hand, the messages and other messages with the priority level not higher than the preset priority level can be stored in the fourth preset queue together, callback processing is carried out based on the fourth preset queue, and compared with the case that all the messages are stored in a certain queue, the efficiency of message processing is higher; on the other hand, a fifth preset queue corresponding to the message type can be determined according to the message type corresponding to the message, the message is stored in the fifth preset queue, other messages with the same message type as the message are stored in the fifth preset queue, all the messages are stored in a classified mode, callback is separated, and further the efficiency of message processing can be improved.
In a second aspect, the present application provides a message processing apparatus, which adopts the following technical scheme:
a message processing apparatus, comprising:
the message acquisition module is used for acquiring the message sent by the client;
the type determining module is used for determining the message type corresponding to the message;
the grade determining module is used for determining the priority grade corresponding to the message according to the message type, and the priority grade is in a proportional relation with the instantaneity of the message;
and the priority callback module is used for callback processing the message when the priority level is higher than a preset priority level.
Through the technical scheme, when the message acquisition module acquires the message sent by the client, the type determining module determines the message type of the message, then the grade determining module determines the priority grade corresponding to the message type, and when the priority grade is higher than the preset priority grade, namely when the received message has high real-time requirement, the message with high real-time requirement is subjected to callback processing through the priority callback module, and the message is not stored in the original message queue, so that the message with high real-time requirement can be processed in time, the waiting time can be reduced, the processing efficiency of the message with high real-time requirement can be improved, and the user experience can be improved.
In one possible implementation manner, the priority callback module is specifically configured to, when callback processing is performed on the message:
storing the message to a first preset queue, and carrying out callback processing on the message based on the first preset queue, wherein the first preset queue is used for storing the message with the priority higher than the preset priority; or,
storing the message to a second preset queue, and carrying out callback processing on the message based on the second preset queue, wherein the second preset queue is only used for storing the message; or,
and directly carrying out callback processing on the message.
In one possible implementation, the apparatus further includes:
the processing grade determining module is configured to determine a processing grade corresponding to the message based on attribute information carried in the message, where the attribute information includes: at least one of client information of the message, sending equipment information of the message and user information corresponding to the client is sent, and the processing level and the instantaneity of the message are in a proportional relation;
the queue determining module is used for determining a third preset queue based on the message type when the processing level is higher than a preset processing level, wherein the third preset queue is a queue corresponding to the message type and is used for storing the message higher than the preset processing level in the message type;
The storage module is used for storing the message into the third preset queue;
the priority callback module is specifically configured to, when callback processing is performed on the message:
and carrying out callback processing on the message based on the third preset queue.
In one possible implementation manner, the type determining module is specifically configured to, when determining a message type corresponding to the message:
determining a message type corresponding to the message according to the Key carried in the message and based on the corresponding relation between the Key and the message type; or,
and determining the Key corresponding to the message based on the message, and determining the message type corresponding to the message based on the corresponding relation between the Key and the message type.
In one possible implementation, the apparatus further includes:
and the establishing module is used for establishing the corresponding relation between the Key and the message type.
In one possible implementation manner, the apparatus further includes a first callback module or a second callback module, where:
the first callback module is configured to store the message to a fourth preset queue when the priority level is not higher than a preset priority level, and perform callback processing on the message based on the fourth preset queue, where the fourth preset queue is used to store the message not higher than the preset priority level;
And the second callback module is used for storing the message to a fifth preset queue when the priority level is not higher than the preset priority level, and carrying out callback processing on the message based on the fifth preset queue, wherein the fifth preset queue is a queue corresponding to the message type.
In a third aspect, the present application provides a server, which adopts the following technical scheme:
a server, the server comprising:
at least one processor;
a memory;
at least one application program, wherein the at least one application program is stored in the memory and configured to be executed by the at least one processor, the at least one application program configured to: the method for processing the message is executed.
In a fourth aspect, the present application provides a computer readable storage medium, which adopts the following technical scheme:
a computer-readable storage medium, comprising: a computer program capable of being loaded by a processor and executing the above-described message processing method is stored.
In summary, the application has the following beneficial technical effects:
1. when the message sent by the client is obtained, the message type of the message is determined to determine the priority level corresponding to the message type, and when the priority level is higher than the preset priority level, namely when the received message has high real-time requirement, the message with high real-time requirement is subjected to callback processing, and the message is not stored in the original message queue, so that the message with high real-time requirement can be processed in time, the waiting time can be reduced, the processing efficiency of the message with high real-time requirement is improved, and the user experience can be further improved.
2. When callback processing is performed on the message with the priority level higher than the preset priority level, on one hand, the message can be stored in a message queue for storing all the messages with the priority level higher than the preset priority level, and callback processing is performed on the basis of the queue, that is, the message with higher instantaneity and the message with lower instantaneity are stored separately for callback, so that waiting time can be further reduced, and processing efficiency of the message with high instantaneity requirement can be improved; the second aspect can store the message with higher priority into a second preset queue dedicated for storing the message, that is, only the message with higher real-time performance currently received is stored in one queue, so as to perform message callback processing based on the queue, thereby further reducing waiting time and improving processing efficiency of the message with high real-time performance requirement; the third aspect can also directly process the callback of the message, the waiting time is shorter, the processing effect of the message with high real-time requirement is higher, and the user experience can be further improved.
Drawings
FIG. 1 is a flow chart of a message processing method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a message queue establishment procedure according to an embodiment of the present application;
FIG. 3 is a system diagram of a message processing system according to an embodiment of the present application;
FIG. 4 is a block diagram of a message processing apparatus according to an embodiment of the present application;
fig. 5 is a schematic diagram of a server according to an embodiment of the present application.
Detailed Description
The application is described in further detail below with reference to fig. 1-5.
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The cloud game is a game mode based on cloud computing, in the running mode of the cloud game, all the games are stored, computed and rendered in a server, the server compresses rendered game pictures and then sends the game pictures to a client through a network, namely the client transmits the game pictures to a user to decompress the game pictures, and the user can play the game through videos displayed by the client. For users, the game equipment of the users does not need a high-end processor and a display card, and can realize better game effect only by basic video decompression capability.
The user inputs data through operation devices such as a mouse, a keyboard, a game handle and the like at the client, the client records the data input by the user and sends the data to the server, the server stores the received data into a message queue, a message processor takes out the message from the message queue and processes the message to form video data, the video data is fed back to the client, the client decompresses the video data, and corresponding game videos are displayed on display equipment of the user, so that response to operation of the user is realized. The client can be a computer, a mobile phone and other electronic equipment provided with a cloud game.
However, after the message is stored in the message queue, data with high real-time requirements wait for a long time to respond, and after the client side shows that the user inputs an operation, the client side needs to wait for a period of time to respond, so that a certain delay is caused, and the game experience of the user is seriously affected.
To this end, the embodiment of the application provides a message processing method, which is executed by a server, wherein the server can be a server or a terminal device, and the server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server for providing cloud computing service. The terminal device may be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but is not limited thereto, and the terminal device and the server may be directly or indirectly connected through a wired or wireless communication manner, which is not limited herein.
Further, as shown in fig. 1, the method may include:
step S101, obtaining a message sent by a client and determining a message type corresponding to the message.
Wherein the message type characterizes the class of the message.
Specifically, after all the messages generated by the client are classified, multiple message types are formed, and one message type may correspond to one message or may include multiple messages. When the message sent by the client is acquired, determining the message type corresponding to the message.
For example, in a combat type game, when a user formally enters the game, the user first needs to log in, a message input by the user on a login interface corresponds to a message type, for example, on the login interface, the user inputs an account number and a password through an operation device such as a key mouse, and at this time, all messages input by the user on the login interface through the operation device belong to the login message type; before entering a game, a user needs to select a role and a scene, and the messages input in the role and scene interface correspond to a message type, for example, the messages input in the role selection interface and the scene selection interface by the user through operation equipment belong to the selected message type; after the user enters the game, operation actions such as fighting PK of both sides and the like are carried out in the game, and all messages input by the user through the operation equipment at the real-time game interface belong to the operation message types.
The message sent by the client may be a message generated by the client after the user inputs the instruction data through the operation device and converts the instruction data, for example, a message corresponding to the operation message type in the above example and a message corresponding to the login message type; the message sent by the client may also be a system-related message generated by the client, such as a heartbeat packet message, where the message type corresponding to the message generated by the client system is a system message type. After the client sends the message to the server, the server acquires the message and determines the message type corresponding to the message according to the message.
Step S102, determining the priority level corresponding to the message according to the message type.
Wherein, the priority level and the real-time property of the message are in a proportional relation; that is, the higher the real-time requirement of the message, the higher the priority level of the corresponding message processing, and the higher the real-time requirement of the characterization message processing.
Specifically, the real-time processing requirements corresponding to different types of messages are different, each message type corresponds to a priority level, and the priority levels corresponding to different message types may be the same or different. And determining the priority level corresponding to the message according to the message type of the message. Continuing to explain with the example in step S101, for the message belonging to the operation message type, after the user inputs the corresponding operation message through the operation device, the server is often required to respond to the operation of the user in real time, that is, the real-time requirement of the message corresponding to the operation message type is highest, the priority level of the corresponding processing is also highest, and the timeliness requirement of the message processing is also highest. For another example, when the user selects a role and a scene, the corresponding message type is the selected message type, the real-time requirement of the message for selecting the message type is lower than that of the operation message type, and after the user selects the scene, the user can wait for one second or a short time to respond, so the priority corresponding to the selected message type is lower, and the real-time requirement is lower; for example, the message input by the user in the login interface belongs to a login message type, the priority level corresponding to the login message type is lower than the priority level corresponding to the operation message type, and the priority levels of the login message type and the operation message type are the same or different relative to the priority level of the selection message type.
Based on the difference in real-time requirements of the messages, each message type is divided into two or more priority levels, wherein the higher the priority level, the higher the real-time requirements of the messages, such as: the priority levels are, in order from low to high, a first priority level, a second priority level. For example, the message real-time requirement corresponding to the operation message type is high, the fifth priority level may be corresponding to the operation message type, the message real-time requirement corresponding to the selection message type is low, and the second priority level may be corresponding to the selection message type.
And step 103, if the priority level is higher than the preset priority level, callback processing is carried out on the message.
The preset priority level is a preset level, for example, the preset priority level is set to a third priority level, that is, a message higher than the preset priority level indicates that the real-time performance requirement is higher.
Specifically, the preset priority level is a manually set priority level, or may be a priority level input by a user, or may be preset for the server. If the priority level corresponding to the message is higher than the preset priority level, the real-time performance requirement for characterizing the message is high, and the message needs to be processed in time so as to provide better game experience for the user. For example, in the example of step S102, if the priority level corresponding to the message is the fifth priority level and the preset priority level is the third priority level, the priority level corresponding to the operation message type is higher than the preset priority level, and if such message cannot be processed in time, the game experience of the user is seriously affected, and when the message of the operation message type is detected to be received, callback processing is performed on the received message.
Therefore, when the priority level corresponding to the message is higher than the preset priority level, callback processing is carried out on the message, the message is not stored in the message queues corresponding to all the original messages, all the messages stored in front of the message are not required to be processed, the message with high real-time requirements can be processed in time, the message processing efficiency is improved, and further the game experience of a user is improved.
The embodiment of the application provides a message processing method, when a message sent by a client is acquired, the message type of the message is determined to determine the priority level corresponding to the message type, and when the priority level is higher than the preset priority level, namely when the received message has high real-time requirement, the message with high real-time requirement is subjected to callback processing, and the message is not stored in an original message queue, so that the message with high real-time requirement can be processed in time, the waiting time can be reduced, the processing efficiency of the message with high real-time requirement can be improved, and the user experience can be further improved.
Further, in the embodiment of the present application, the manner of receiving the message sent by the client may be described in detail in the foregoing embodiment, and after receiving the message sent by the client, the manner of determining the message type corresponding to the message may specifically include: either the first mode or the second mode, wherein,
Mode one: and determining the message type corresponding to the message based on the corresponding relation between the Key and the message type according to the Key carried in the message.
The Key, also called a Key value, is located at the end of the registry structure chain and contains the actual configuration information and data used when the current application program is executed. Each message corresponds to a uniquely defined Key. Key can be the name of the message corresponding to the message, and can also be the Key value customized by other users.
Specifically, before the client sends the message to the server, the Key corresponding to the message is determined in advance, for example, when the user inputs an operation message corresponding to the operation message type through the operation device, the Key corresponding to the message is HandleMsg. And then, the client sends the message to the server, and the Key corresponding to the message is carried in the message when the message is sent, for example, when the operation message is sent, the HandleMsg is also sent to the server together with the operation message, and when the message is received by the server, the message comprises the content corresponding to the operation message and the HandleMsg. And sending the message to the server at the client, wherein the server can directly acquire the Key corresponding to the message from the message, so that the message type corresponding to the message can be determined according to the Key corresponding to the message and the corresponding relation between the Key of the message and the message type.
The corresponding relation between the Key of the message and the message type is a pre-established relation, and each Key corresponds to one message type. Specifically, before determining the message type corresponding to the message based on the correspondence between the Key and the message type, the method may further include: and establishing a corresponding relation between the Key and the message type. Each message corresponds to one Key, and the message corresponds to one message type, that is, one Key corresponds to one message type, and the value indicates that one message type may correspond to one Key or may correspond to a plurality of keys.
Before determining the message type corresponding to the message, a corresponding relation between the Key and the message type is pre-established, and the server side can directly determine the message type of the message according to the Key carried in the message, further determine the priority of the message, and judge the real-time requirement of the message so as to determine the processing mode of the message.
Mode two: and determining the Key corresponding to the message based on the message, and determining the message type corresponding to the message based on the corresponding relation between the Key and the message type.
Specifically, after the message is sent from the client to the server, the server determines the Key corresponding to the message in advance according to the message, and then determines the message type of the message according to the corresponding relation between the Key and the message type, so that the message type corresponding to the message can be determined.
The manner of determining the Key corresponding to the message may be self-defined, or globally unique, for example, the ID of each message is used as the Key of the message; the key value coding method may be a method of using a character string of information included in a message as a key value or the like; in addition, after determining the key corresponding to the message, in one possible implementation manner, the key corresponding to the message will remain unchanged, that is, the key corresponding to the message is globally unique. When determining the Key corresponding to the message, the Hash registration mode may be used to determine, where Hash is a function of transforming an input with any length into an output with a fixed length through a Hash algorithm, the output value is a Hash value, and is essentially a function of compressing a message with any length to a message digest with a certain fixed length, that is, compressing the message to obtain the message digest with the fixed length, where the message digest can be used as the corresponding Key, and the Key corresponds to the message. When the message is acquired, a hash algorithm is adopted to evaluate the message to obtain a specific hash value, and the hash value can be used as a Key.
As shown in the above manner one, before determining the message type corresponding to the message, the method may further include: and establishing a corresponding relation between the Key and the message type. The specific process is detailed in the embodiment shown in the mode one, and will not be described herein.
Further, after determining the message type corresponding to the message according to the Key of the message, the corresponding relationship between the message type and the priority level is further required to determine the priority level corresponding to the message.
Further, after determining the priority level, for the message with the priority level higher than the preset priority level, that is, the message with the high real-time requirement, callback processing is performed independently, where the callback processing manner for the message specifically may include: any one of step S1031a (not shown in the figure), step S1031b (not shown in the figure), and step S1031c (not shown in the figure), wherein,
step S1031a, storing the message in a first preset queue, and performing callback processing on the message based on the first preset queue.
The first preset queue is used for storing messages with a priority level higher than a preset priority level.
Specifically, the messages stored in the first preset queue are all messages with priority higher than the preset priority, that is, all messages with priority higher than the preset priority are stored in the first preset queue.
For example, the message m1 is a message with a priority level higher than a preset priority level, and the message m1 is stored in a first preset queue; the message n1 is a message with a priority level lower than a preset priority level, and the message n1 is not stored in a first preset queue; and if the message q1 is a message with a priority level higher than a preset priority level, storing the message q1 into a first preset queue, so that only the message with the priority level higher than the preset priority level is stored in the first preset queue.
And then, carrying out callback processing on the information based on a first preset queue, wherein the first preset queue corresponds to a working thread, carrying out callback processing on the information stored in the first preset queue through the working thread corresponding to the first preset queue, for example, sequentially storing the information m1, the information q1, the information m2 and the information m3 in the first preset queue according to the sequence, wherein the sequence is the sequence of storage time, the information m1 is stored before the information q1 is stored, the server side sequentially carries out callback processing on the information m1 from the first preset queue according to the storage sequence by utilizing the working thread, and then, the information m1 is deleted from the first preset queue after the information m1 is processed, and then, the information m2 is returned, and if the information q2 is received by the server side and the priority level of the information q2 is higher than the preset priority level, then, the information q2 is stored to the information m3, and then, the callback processing is carried out on the information q2 after the callback of the information m 3.
The server establishes a special first preset queue based on the existing message queue, wherein the first preset queue is only used for calling back the message with high real-time requirement, namely, only used for calling back the message with higher priority than the preset priority. In the embodiment of the application, the callback processing is directly performed on the information stored in the first preset queue based on the first preset queue, so that the data with high real-time requirements and the data with low real-time requirements can be separated into callback processing, and the efficiency of the information processing can be improved.
Step S1031b, storing the message in a second preset queue, and performing callback processing on the message based on the second preset queue.
The second preset queue is only used for storing messages, and the messages are messages with priority levels higher than preset priority levels.
Specifically, when the priority level of the message is higher than the preset priority level, that is, the message is a message with higher real-time performance, the message needs to be processed in time, at this time, the message is stored separately in a message queue, that is, separately stored in a second preset queue, and the message will be stored separately in the second preset queue, because only the message is stored in the second preset queue, the callback function can be directly called to perform callback processing on the message, and compared with the mode of step S1031a, the processing efficiency of the message is higher.
For example, the priority level of the message type m is higher than a preset priority level, wherein the message m1, the message m2 and the message m3 all belong to the message type m; message m1 will be stored in the second preset queue 1, message m2 will be stored in the second preset queue 2, and message m3 will be stored in the second preset queue 3. I.e. one queue for each message and only one message is stored in each queue.
Further, each second preset queue may be established in real time when the server side obtains the message, and when judging that the priority level corresponding to the message is higher than the preset priority level, a second preset queue is created, the message is stored in the second preset queue, and callback processing is performed based on the second preset queue; on the other hand, the manner of determining the second preset queue corresponding to the message may also be that when the server side obtains the message and determines that the message belongs to the message with high real-time requirement, one of the message queues of the server side, which does not store the message, is used as the second preset queue corresponding to the message by traversing each message queue of the server side, and the message is stored in the second preset queue. In addition, each second preset queue may be pre-created by the server, and before the message sent by the client is acquired, a preset number of second preset queues are pre-created, for example, 5 second preset queues are pre-created by the server, and the second preset queues are sequentially a second preset queue 1, a second preset queue 2, a second preset queue 3, a second preset queue 4 and a second preset queue 5. When the message is received and the message is judged to belong to the message with high real-time requirement, based on each second preset queue established in advance, the second preset queue corresponding to the message is allocated, and the message is stored in the corresponding second preset queue.
Specifically, the manner of allocating the second preset queues corresponding to the messages may be to sequentially determine, according to the order of each second preset queue, whether a history message is stored in each second preset queue at present, if a history message is stored in each second preset queue at present, taking the next second preset queue as the second preset queue at present, continuously executing the step of determining whether a history message is stored in the second preset queue at present until no history message is stored in the second preset queue at present, taking the second preset queue at present as the second preset queue corresponding to the currently acquired message, and storing the message in the corresponding second preset queue. For example: taking 5 second preset queues established by the server side as examples to continue explanation, if the currently acquired message is a message m9, and the message m9 is a message with a priority level higher than a preset priority level, according to the arrangement sequence of the second preset queues, the second preset queue 1 is a first second preset queue, namely the current second preset queue, firstly judging whether historical messages are stored in the second preset queue 1, if the second preset queue 1 stores a message m8 at the moment, taking the second preset queue 2 as the current second preset queue, judging whether historical messages are stored in the second preset queue 2, and if no message is stored in the second preset queue 2, the second preset queue 2 is the second preset queue corresponding to the currently acquired message, and storing the message into the second preset queue 2. So that the message is stored in a second predetermined queue and only the message is stored in the second predetermined queue.
Step S1031c, directly performing callback processing on the message.
Specifically, for the message with the priority level higher than the preset priority level, the message is not stored in the corresponding preset queue, but the message is subjected to callback processing in a direct callback mode, when the server judges that the priority level of the message is higher than the message with the preset priority level, the callback function is directly called to carry out callback processing on the message, the time waiting for calling in the preset queue after the message is stored in the corresponding preset queue is reduced, the processing efficiency of the message is further improved, the message with high real-time requirement can be processed in time, the occurrence probability of the conditions of delay pause and the like is reduced, and the use experience of a user is further improved.
Further, when callback processing is performed on the message, any one of the three implementation manners of step S1031a, step S1031b and step S1031c may be adopted, that is, on one hand, the message may be stored in the corresponding queue in the manner of step S1031a or step S1031b, and then callback processing is performed; on the other hand, the message may be directly recalled in a manner as in step S1031 c. Secondly, in a fourth implementation manner, the messages of the same message type are placed in the same preset queue, and callback processing is divided for all the messages based on the difference of the message types; in addition, different messages may correspond to different real-time requirements for different messages of the same message type, i.e. different messages may also correspond to different processing levels, such as: for the messages of the operation message types, different messages are generated by the clients of different cloud games, the smoothness requirement is higher for the cloud games, the real-time requirement for the messages generated by the operation is higher, the smoothness requirement is lower for the cloud games, the real-time requirement for the messages generated by the operation is lower, and the messages corresponding to all the operation message types are messages with priority levels higher than the preset priority level.
In order to address the difference of real-time requirements of different messages of the same message type, callback processing can be separated during callback processing, so that processing efficiency can be further improved for the message with higher real-time requirements, and callback processing can be carried out on the message, and the method can further comprise the following steps: step Sa1 (not shown), step Sa2 (not shown), and step Sa3 (not shown), wherein,
step Sa1, determining a processing grade corresponding to the message based on the attribute information carried in the message.
Wherein the attribute information includes: at least one of client information for sending the message, sending equipment information of the message and user information corresponding to the client, and processing level and real-time property of the message are in a proportional relation.
Specifically, clients corresponding to different types of cloud games for sending messages are different, and the processing grades of corresponding messages of the same message type are also different; the client information of the sent message characterizes the type of the cloud game corresponding to the message. For example, cloud game a is a combat type cloud game, cloud game B is a leisure type cloud game, if a message a of an operation message type is generated in a client corresponding to cloud game a and a message B of an operation message type is generated in a client corresponding to cloud game B, the real-time requirement of message a is significantly higher than the real-time requirement corresponding to message B, i.e. the processing level of message a will be higher than the processing level of message B.
Further, when a user plays a game using a device with high processing performance, there is a tendency that the demand for response speed of the game is higher, that is, the processing level of a message sent by a sending device of a message with different performance is different, and the processing level is higher as the performance is higher. The information of the message sending device is the relevant performance information of the game device.
Furthermore, the user information corresponding to the client includes information such as account information of the user and usage frequency of the cloud game by the user, for example, when the user is a VIP user, higher operation experience can be provided to the user, and when the frequency of playing the cloud game by the user is higher, the user is a faithful user of the current cloud game, and higher operation experience can also be provided to the user.
In addition, when determining the processing level of the message according to one item of attribute information, the standard for determining the processing level is single, and there may be a large chance that, in order to further improve the accuracy of determining the processing level of the message, the processing level of the message may be determined by any two items of the client information, the sending device information and the user information, and by three items, for example, the processing level of the message is determined by the client information and the user information together. When the processing grade is determined by adopting multiple items of attribute information, the real-time influence degree of each item of attribute information can be proportioned, the corresponding proportion is multiplied according to the score of each item of condition, the corresponding grade score is obtained after comprehensive addition, the higher the grade score is, the higher the processing grade is, and the processing grade corresponding to the message is further determined. For example: and determining the processing grade of the message by adopting client information and user information together, wherein the respective corresponding score proportions are 70% and 30%, the client information is 10 points (fully divided into 10 points), the user information is 5 points, the total sum is 8.5 points, and the corresponding processing grade of the message is determined according to the total score.
The processing level is a level set in stages, for example: the processing levels are sequentially a first processing level and a second processing level from high to low; the 8.5 points obtained in the above example correspond to a higher message processing level, and correspond to a fifth processing level.
Step Sa2, if the processing level is higher than the preset processing level, determining a third preset queue based on the message type.
The third preset queue is a queue corresponding to the message type and is used for storing the message higher than the preset processing level in the message type.
Specifically, for all messages of the same message type to be stored in the same real-time preset queue, different message types to be stored in different real-time preset queues, for example: message type m, message type n and message type q, wherein the message type m corresponds to a real-time preset queue m, and all messages corresponding to the message type m are stored in the real-time preset queue m; the message type q corresponds to a real-time preset queue q, all messages corresponding to the message type q are stored in the real-time preset queue q, the message type n does not belong to the message type with the priority level higher than the real-time preset priority level, and no corresponding real-time preset queue exists.
Further, in order to separate callback for the messages with high processing level in the same message type, splitting the real-time preset queue into a third preset queue and a real-time preset sub-queue, wherein for the real-time preset queue corresponding to one message type, the third preset queue is dedicated to store the messages with processing level higher than the preset processing level; the real-time preset sub-queue is used for storing messages with processing levels not higher than (i.e., lower than or equal to) the preset processing level.
The preset processing level is a preset processing level, for example: the second processing level as in the example of step Sa1 is set. When the priority level of the message is higher than the preset priority level, the message is determined to be the message with high real-time requirement, at this time, the real-time preset queue corresponding to the message is determined according to the message type, then based on the message, whether the processing level of the message is higher than the preset processing level is judged, when the processing level is higher than the preset processing level, the message is characterized as the message with higher real-time requirement at this time, and the message is correspondingly a third preset queue in the real-time preset queues. When the message is not higher than the preset processing level, the real-time performance requirement is high, but the processing efficiency does not need to be improved any more, and the message is correspondingly a real-time preset sub-queue. For example: the message m1 belongs to a message type m, the priority level is higher than the preset priority level, the corresponding real-time preset queue is a real-time preset queue m, the real-time preset queue m comprises a third preset queue m and a real-time preset sub-queue m, if the processing level of the message m1 is a fifth processing level and the preset processing level is a fourth processing level, the processing level of the message m1 is higher than the preset processing level, and the message m1 corresponds to the third preset queue m; if the processing level of the message m1 is the fourth processing level and is not higher than the preset processing level, the message m1 is correspondingly a real-time preset sub-queue m.
Step Sa3, storing the message to a third preset queue.
On the basis of the foregoing embodiment (that is, on the basis of the implementation manner corresponding to step Sa1, step Sa2, and step Sa 3), callback processing on the message may specifically include: and carrying out callback processing on the message based on the third preset queue.
If the processing level of the message is higher than the preset processing level, after a third preset queue corresponding to the message is determined, the message is stored in the corresponding third preset queue, and callback processing is performed on the message based on the third preset queue.
If the processing level of the message is not higher than the preset processing level, after the real-time preset sub-queue corresponding to the message is determined, the message is stored into the corresponding real-time preset sub-queue, and then callback processing is carried out on the message based on the real-time preset sub-queue.
For the messages of the same message type, according to different processing grades, the real-time requirement of the processing of the messages with the processing grade higher than the preset processing grade is extremely high, so that the messages are additionally stored in a third preset queue, namely, the messages with higher real-time requirement are independently processed in a callback manner, and the efficiency of processing the messages is further improved.
Further, in the embodiment of the present application, for the message with the priority level higher than the preset priority level, callback processing is performed on the message, and for the message with the priority level not higher than the preset priority level, the message processing manner may be specifically one or two manners, where,
mode one: and if the priority level is not higher than the preset priority level, storing the message into a fourth preset queue, and carrying out callback processing on the message based on the fourth preset queue.
The fourth preset queue is used for storing messages with priority not higher than a preset priority level.
Specifically, when the server acquires the message, the message type corresponding to the message is determined according to the Key of the message, then the priority level corresponding to the message is determined according to the message type, when the priority level is not higher than the preset priority level, namely when the priority level is lower than or equal to the preset priority level, the real-time requirement of the characterization message is lower, the efficiency requirement of message processing is relatively lower, and the influence on the user game experience is also lower, so that the message can be continuously stored in a pre-established message queue for the message, namely in a fourth preset queue, all the messages with the priority level not higher than the preset priority level are placed in the fourth preset queue, and then the message callback processing is performed from the fourth preset queue. For example: and storing the message into a fourth preset queue if the priority level corresponding to the message a1 is not higher than the preset priority level, and then storing the message into the fourth preset queue if the priority level of the message a2 is not higher than the preset priority level, wherein the message a1 and the message a2 may or may not belong to the same message type.
Mode two: and if the priority level is not higher than the preset priority level, storing the message into a fifth preset queue, and carrying out callback processing on the message based on the fifth preset queue.
The fifth preset queue is a queue corresponding to the message type.
Specifically, when the priority level of the message is not higher than the preset priority level, that is, the processing real-time requirement of the message is low, at this time, firstly, according to the message type of the message, determining a message queue corresponding to the message type, where the message queue corresponding to the message type is a fifth preset queue in which the message is to be stored.
For the message types with the priority level not higher than the preset priority level, each message type corresponds to a message queue, each message queue is a pre-established queue, each message queue corresponds to one message type, and also can correspond to two or three message types. Preferably, the message queues are in one-to-one correspondence with the message types, and each type of message corresponds to one message queue.
For example, the login message type corresponds to a message queue A1, the selection message type corresponds to a message queue A2, and the interaction message type corresponds to a message queue A3; or the login message type and the selection message type are jointly corresponding to a message queue B1, and the interaction message type is corresponding to a message queue B2; the interactive message type is the type to which the message input when the user performs friend interaction belongs.
When the message with the priority level not higher than the preset priority level is obtained, determining a message queue corresponding to the message according to the corresponding relation between the message type and the message queue, taking the message queue corresponding to the message as a fifth preset queue, and storing the message into the fifth preset queue.
For example: the message b1 corresponds to the message type b and is not higher than the preset priority, and a message queue corresponding to the message type b is an x preset queue, so that the message b1 is stored in the x preset queue; the message type corresponding to the message c2 is a message type c, the message pair corresponding to the message type c is listed as a y-th preset queue, the priority level corresponding to the message c2 is not higher than the preset priority level, and the message c2 is stored in the y-th preset queue, wherein the x-th preset queue and the y-th preset queue do not belong to the same message queue; if a message b2 with the message type b is received, the message b2 is stored in the x-th preset queue.
When the message callback processing is carried out, each message queue corresponds to one work thread, the corresponding messages stored in the message queues are sequentially subjected to callback processing through the work thread, the messages with the priority level not higher than the preset priority level can be classified and stored according to different message types, and callback is classified.
For the embodiment of the present application, referring to fig. 2, before obtaining a message, a server first uses a message system registration module, and establishes a corresponding relationship between a Key value and a message type through Key values corresponding to all messages, and registers different message systems according to different message types, where one message system corresponds to one message queue, and the message queue is the above-mentioned fifth preset queue, and is used to store all messages belonging to the corresponding message type, and is used to store messages with priority not higher than a preset priority.
Based on the above embodiments, the embodiments of the present application provide an example based on a cloud game scenario to illustrate a process of message processing, and referring to fig. 3, fig. 3 is a schematic diagram of a message processing system, including a client, a message system, a message queue system, a callback message system, and a message handler, where the message handler includes a message handler 1 and a message handler 2; the user plays a game at the client and sends a message to the message system, the message system sends the message with the priority higher than the preset priority to the callback message system, and the callback is carried out through the callback message system, and the message processor 1 processes the callback message; the message system sends the message with the priority not higher than the preset priority to the message queue system, stores the message to the corresponding message queue, and then uses the work thread to call back the message, and the message processor 2 processes the message.
For example, when a user plays a game at a client, firstly logging in the game, inputting an account number and a password through a Key mouse device at a game login interface, inputting instruction data by the client based on the user through an operation device, converting the instruction data into corresponding information, and sending an information instruction to a server, wherein the client determines a Key corresponding to the information in advance based on the information before sending the information to the server, and when the information is sent to the server, the Key is also sent to the server by the information, after the information is received by the server, the Key corresponding to the information is also obtained together, the type of the information corresponding to the information is determined according to the Key, at the moment, the user is in a login interface, the server judges that the type of the information corresponding to the information is a login information type, the preset priority is a preset third priority, the priority corresponding to the information is a second priority, and is not higher than the preset priority, and the information is stored in a fifth preset queue corresponding to the information according to the information type, and the fifth preset queue corresponding to the information is only used for storing the information belonging to the login information type; and then, the message is sequentially recalled from the fifth preset queue by utilizing the work thread corresponding to the fifth preset queue, and the message is sent to the message processor 1, so that the message processor 1 processes the message, and the message with lower real-time requirements can be classified and stored, thereby further improving the efficiency of message processing.
With continued reference to fig. 3, after the user logs in to the game, the user starts to control the character movement or action in the game through the operation device, at this time, after receiving the corresponding message, the server determines that the message belongs to the operation message type, if the priority level corresponding to the message is the fifth priority level, the message is higher than the preset priority level, and the message is directly sent to the callback message system, and is directly callback-processed, so that the message is sent to the message processor 2, so that the message processor 2 directly callbacks the message with high real-time requirement, further reducing the time for storing the message queue, reducing the waiting time, and improving the efficiency of message processing.
The value is stated, the message processing method introduced in the embodiment of the application is not only suitable for cloud games, but also suitable for business scenes such as order messages of online malls and the like, and the application is only illustrated by taking the cloud games as an example and does not represent the limitation of the application scene of the application.
The above-described embodiments describe a message processing method from the viewpoint of a method flow, and the following embodiments describe a message processing apparatus from the viewpoint of a virtual module or a virtual unit, and refer to fig. 4 in detail.
A message processing apparatus 40 comprising:
a message obtaining module 401, configured to obtain a message sent by a client;
a type determining module 402, configured to determine a message type corresponding to the message;
the level determining module 403 is configured to determine, according to the message type, a priority level corresponding to the message, where the priority level is in a proportional relationship with real-time performance of the message;
and the priority callback module 404 is configured to perform callback processing on the message when the priority level is higher than the preset priority level.
Specifically, when the message acquisition module 401 acquires a message sent by a client, the type determining module 402 determines the message type of the message, then the grade determining module 403 determines the priority grade corresponding to the message type, and when the priority grade is higher than a preset priority grade, that is, when the received message has high real-time requirement, the message with high real-time requirement is subjected to callback processing through the priority callback module 404, and the message is not stored in the original message queue, so that the message with high real-time requirement can be processed in time, thereby reducing waiting time and improving processing efficiency of the message with high real-time requirement, and further improving user experience.
In one possible implementation manner of the embodiment of the present application, when the priority callback module 404 performs callback processing on a message, the priority callback module is specifically configured to:
storing the message to a first preset queue, and carrying out callback processing on the message based on the first preset queue, wherein the first preset queue is used for storing the message with the priority higher than the preset priority; or,
storing the message to a second preset queue, and carrying out callback processing on the message based on the second preset queue, wherein the second preset queue is only used for storing the message; or,
and directly carrying out callback processing on the message.
In one possible implementation manner of the embodiment of the present application, the apparatus 40 further includes:
the processing grade determining module is used for determining the processing grade corresponding to the message based on the attribute information carried in the message, wherein the attribute information comprises: at least one of client information for sending the message, sending equipment information for the message and user information corresponding to the client, wherein the processing grade and the instantaneity of the message are in a proportional relation;
the queue determining module is used for determining a third preset queue based on the message type when the processing level is higher than the preset processing level, wherein the third preset queue is a queue corresponding to the message type and is used for storing the message higher than the preset processing level in the message type;
The storage module is used for storing the message into a third preset queue;
when the priority callback module carries out callback processing on the message, the priority callback module is specifically used for:
and carrying out callback processing on the message based on the third preset queue.
In one possible implementation manner of the embodiment of the present application, when determining the message type corresponding to the message, the type determining module 402 is specifically configured to:
determining a message type corresponding to the message according to the Key carried in the message and based on the corresponding relation between the Key and the message type; or alternatively, the first and second heat exchangers may be,
and determining the Key corresponding to the message based on the message, and determining the message type corresponding to the message based on the corresponding relation between the Key and the message type.
In one possible implementation manner of the embodiment of the present application, the apparatus 40 further includes:
and the establishing module is used for establishing the corresponding relation between the Key and the message type.
In one possible implementation manner of the embodiment of the present application, the apparatus 40 further includes a first callback module or a second callback module, where:
the first callback module is used for storing the message to a fourth preset queue when the priority level is not higher than the preset priority level, and carrying out callback processing on the message based on the fourth preset queue, wherein the fourth preset queue is used for storing the message not higher than the preset priority level;
And the second callback module is used for storing the message to a fifth preset queue when the priority level is not higher than the preset priority level, and carrying out callback processing on the message based on the fifth preset queue, wherein the fifth preset queue is a queue corresponding to the message type.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
The embodiment of the present application also introduces a service end from the perspective of the entity apparatus, as shown in fig. 5, the service end 50 shown in fig. 5 includes: a processor 501 and a memory 503. The processor 501 is coupled to a memory 503, such as via a bus 502. Optionally, the server 50 may also include a transceiver 504. It should be noted that, in practical applications, the transceiver 504 is not limited to one, and the structure of the server 50 is not limited to the embodiment of the present application.
The processor 501 may be a CPU (Central Processing Unit ), general purpose processor, DSP (Digital Signal Processor, data signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic device, transistor logic device, hardware components, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules and circuits described in connection with this disclosure. The processor 501 may also be a combination that implements computing functionality, such as a combination comprising one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
Bus 502 may include a path to transfer information between the components. Bus 502 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect Standard) bus or an EISA (Extended Industry Standard Architecture ) bus, or the like. The bus 502 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 5, but not only one bus or one type of bus.
The Memory 503 may be, but is not limited to, ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, RAM (Random Access Memory ) or other type of dynamic storage device that can store information and instructions, EEPROM (Electrically Erasable Programmable Read Only Memory ), CD-ROM (Compact Disc Read Only Memory, compact disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 503 is used to store application code for performing the implementation of the present application and is controlled by the processor 501 for execution. The processor 501 is configured to execute the application code stored in the memory 503 to implement what is shown in the foregoing method embodiments.
Wherein, the service end includes but is not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. And may also be a server, and in the embodiment of the present application, the server may be a cloud server. The server side shown in fig. 5 is only an example, and should not be construed as limiting the functionality and scope of use of the embodiments of the present application.
Embodiments of the present application provide a computer-readable storage medium having a computer program stored thereon, which when run on a computer, causes the computer to perform the corresponding method embodiments described above. In the embodiment of the application, when the message sent by the client is acquired, the message type of the message is determined to determine the priority level corresponding to the message type, and when the priority level is higher than the preset priority level, namely when the received message has high real-time requirement, the message with high real-time requirement is subjected to callback processing, and the message is not stored in the original message queue, so that the message with high real-time requirement can be processed in time, thereby reducing the waiting time, improving the processing efficiency of the message with high real-time requirement, and further improving the user experience.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above. The specific working processes of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which are not described herein.
In the embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
The foregoing embodiments are only used to describe the technical solution of the present application in detail, but the descriptions of the foregoing embodiments are only used to help understand the method and the core idea of the present application, and should not be construed as limiting the present application. Variations or alternatives, which are easily conceivable by those skilled in the art, are included in the scope of the present application.
Claims (7)
1. A method of message processing comprising:
acquiring a message sent by a client and determining a message type corresponding to the message;
determining a priority level corresponding to the message according to the message type, wherein the priority level is in a proportional relation with the real-time property of the message;
if the priority level is higher than the preset priority level, callback processing is carried out on the message;
the callback processing of the message comprises the following steps: storing the message to a second preset queue, and carrying out callback processing on the message based on the second preset queue, wherein the second preset queue is only used for storing the message; when the priority level of the message is higher than the preset priority level, the message is independently stored in a second preset queue, the message is independently stored in the second preset queue, wherein each message corresponds to one second queue, and only one message is stored in each queue;
The method for distributing the information to the corresponding second preset queues comprises the steps of sequentially judging whether historical information is stored in each second preset queue according to the sequence of each second preset queue, taking the next second preset queue as the current second preset queue if the historical information is stored in the current second preset queue, continuously executing the step of judging whether the historical information is stored in the current second preset queue until the historical information is not stored in the current second preset queue, taking the current second preset queue as the second preset queue corresponding to the currently acquired information, and storing the information in the corresponding second preset queue.
2. The method according to claim 1, wherein the determining the message type to which the message corresponds includes any one of:
determining a message type corresponding to the message according to the Key carried in the message and based on the corresponding relation between the Key and the message type;
and determining the Key corresponding to the message based on the message, and determining the message type corresponding to the message based on the corresponding relation between the Key and the message type.
3. The method of claim 2, wherein determining the message type to which the message corresponds based on the correspondence between the Key and the message type, further comprises:
And establishing a corresponding relation between the Key and the message type.
4. The method of claim 1, further comprising any one of:
if the priority level is not higher than the preset priority level, storing the message into a fourth preset queue, and performing callback processing on the message based on the fourth preset queue, wherein the fourth preset queue is used for storing the message not higher than the preset priority level;
and if the priority level is not higher than the preset priority level, storing the message into a fifth preset queue, and performing callback processing on the message based on the fifth preset queue, wherein the fifth preset queue is a queue corresponding to the message type.
5. A message processing apparatus, comprising:
the message acquisition module is used for acquiring the message sent by the client;
the type determining module is used for determining the message type corresponding to the message;
the grade determining module is used for determining the priority grade corresponding to the message according to the message type, and the priority grade is in a proportional relation with the instantaneity of the message;
the priority callback module is used for callback processing of the message when the priority level is higher than a preset priority level;
The priority callback module is specifically configured to, when callback processing is performed on the message:
storing the message to a second preset queue, and carrying out callback processing on the message based on the second preset queue, wherein the second preset queue is only used for storing the message; when the priority level of the message is higher than the preset priority level, the message is independently stored in a second preset queue, the message is independently stored in the second preset queue, wherein each message corresponds to one second queue, and only one message is stored in each queue;
the method for distributing the information to the corresponding second preset queues comprises the steps of sequentially judging whether historical information is stored in each second preset queue according to the sequence of each second preset queue, taking the next second preset queue as the current second preset queue if the historical information is stored in the current second preset queue, continuously executing the step of judging whether the historical information is stored in the current second preset queue until the historical information is not stored in the current second preset queue, taking the current second preset queue as the second preset queue corresponding to the currently acquired information, and storing the information in the corresponding second preset queue.
6. A server, the server comprising:
at least one processor;
a memory;
at least one application program, wherein the at least one application program is stored in the memory and configured to be executed by the at least one processor, the at least one application program configured to: a message processing method according to any of claims 1 to 4.
7. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program, when executed in a computer, causes the computer to perform the message processing method according to any of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210987809.2A CN115348231B (en) | 2022-08-17 | 2022-08-17 | Message processing method, device, server side and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210987809.2A CN115348231B (en) | 2022-08-17 | 2022-08-17 | Message processing method, device, server side and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115348231A CN115348231A (en) | 2022-11-15 |
CN115348231B true CN115348231B (en) | 2023-12-12 |
Family
ID=83951325
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210987809.2A Active CN115348231B (en) | 2022-08-17 | 2022-08-17 | Message processing method, device, server side and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115348231B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102685250A (en) * | 2012-05-31 | 2012-09-19 | 苏州阔地网络科技有限公司 | Message scheduling process method and system |
CN102685032A (en) * | 2012-05-31 | 2012-09-19 | 苏州阔地网络科技有限公司 | Method and system for processing information of net meeting |
CN106161192A (en) * | 2015-04-08 | 2016-11-23 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus of Message Processing |
CN108156093A (en) * | 2018-01-25 | 2018-06-12 | 中科边缘智慧信息科技(苏州)有限公司 | Data transmission method and system are applied suitable for low bandwidth Weak link environment more |
KR20190057818A (en) * | 2017-11-20 | 2019-05-29 | 광운대학교 산학협력단 | Priority-based MQTT System and method to provide Differentiated IoT Services |
CN110198351A (en) * | 2019-05-29 | 2019-09-03 | 深圳前海微众银行股份有限公司 | Storage method, device, server-side and the readable storage medium storing program for executing of offline message |
CN111404838A (en) * | 2020-03-17 | 2020-07-10 | 上海云励科技有限公司 | Message processing method, device and equipment |
CN114265753A (en) * | 2021-12-27 | 2022-04-01 | 中国农业银行股份有限公司 | Management method and management system of message queue and electronic equipment |
CN114327948A (en) * | 2021-12-28 | 2022-04-12 | 北京京东拓先科技有限公司 | Message processing method, device, equipment and storage medium |
CN114428693A (en) * | 2022-03-31 | 2022-05-03 | 季华实验室 | Method and device for adjusting message priority, electronic equipment and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10148738B2 (en) * | 2014-11-12 | 2018-12-04 | Zuora, Inc. | System and method for equitable processing of asynchronous messages in a multi-tenant platform |
-
2022
- 2022-08-17 CN CN202210987809.2A patent/CN115348231B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102685250A (en) * | 2012-05-31 | 2012-09-19 | 苏州阔地网络科技有限公司 | Message scheduling process method and system |
CN102685032A (en) * | 2012-05-31 | 2012-09-19 | 苏州阔地网络科技有限公司 | Method and system for processing information of net meeting |
CN106161192A (en) * | 2015-04-08 | 2016-11-23 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus of Message Processing |
KR20190057818A (en) * | 2017-11-20 | 2019-05-29 | 광운대학교 산학협력단 | Priority-based MQTT System and method to provide Differentiated IoT Services |
CN108156093A (en) * | 2018-01-25 | 2018-06-12 | 中科边缘智慧信息科技(苏州)有限公司 | Data transmission method and system are applied suitable for low bandwidth Weak link environment more |
CN110198351A (en) * | 2019-05-29 | 2019-09-03 | 深圳前海微众银行股份有限公司 | Storage method, device, server-side and the readable storage medium storing program for executing of offline message |
CN111404838A (en) * | 2020-03-17 | 2020-07-10 | 上海云励科技有限公司 | Message processing method, device and equipment |
CN114265753A (en) * | 2021-12-27 | 2022-04-01 | 中国农业银行股份有限公司 | Management method and management system of message queue and electronic equipment |
CN114327948A (en) * | 2021-12-28 | 2022-04-12 | 北京京东拓先科技有限公司 | Message processing method, device, equipment and storage medium |
CN114428693A (en) * | 2022-03-31 | 2022-05-03 | 季华实验室 | Method and device for adjusting message priority, electronic equipment and storage medium |
Non-Patent Citations (3)
Title |
---|
Message Queue Telemetry Transport Broker with Prioriy Support for Emergency Events in Internet of Things;Yong-Seong Kim et al.;Sersors and Materials;全文 * |
郝永康.面向弱连接窄带宽环境的IP业务传输适配方法设计与实现.《中国优秀硕士学位论文全文数据库》.2022,全文. * |
面向 LEO/GEO 卫星网络的多路径多业务路由策略;王娟等;《南京邮电大学学报》;正文第1-2章 * |
Also Published As
Publication number | Publication date |
---|---|
CN115348231A (en) | 2022-11-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10564920B2 (en) | Dynamic server-side image sizing for fidelity improvements | |
US20230036089A1 (en) | Testing systems and methods | |
CN111586164B (en) | Sharing, succession and information processing method of remote cloud desktop and electronic equipment | |
US20060277319A1 (en) | Optimizing message transmission and delivery in a publisher-subscriber model | |
US8595303B2 (en) | Thread data aggregation | |
CN115348222B (en) | Message distribution method, device, server side and storage medium | |
CN113489805B (en) | Butt joint method, device, equipment and storage medium of cloud desktop system | |
CN109766315B (en) | File display method and terminal, computer storage medium and computer equipment | |
CN112291325A (en) | Message processing method and device and computer system | |
CN104753825B (en) | The delivery method and system of login status when instant messaging multiple terminals logs in | |
CN112468874A (en) | Video playing method, terminal equipment and system | |
CN109636460B (en) | Service processing method, device, equipment and storage medium | |
CN116431282A (en) | Cloud virtual host server management method, device, equipment and storage medium | |
WO2022095741A1 (en) | Method and device for obtaining game prop | |
CN114143000A (en) | Secret trace query method and device based on careless transmission protocol and secret sharing | |
CN116996421B (en) | Network quality detection method and related equipment | |
CN115348231B (en) | Message processing method, device, server side and storage medium | |
CN106487653B (en) | Message processing method and server | |
CN109710502A (en) | Log transmission method, apparatus and storage medium | |
KR20200108348A (en) | Data transfer | |
CN111800491A (en) | Data transmission method, system, computing device and storage medium | |
WO2023098012A1 (en) | Bullet comment display method and apparatus | |
CN113824689B (en) | Edge computing network, data transmission method, device, equipment and storage medium | |
CA2833346C (en) | Reducing latency for served applications by anticipatory preprocessing | |
WO2017088382A1 (en) | Data processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |