CN116032417B - Message processing method, terminal and server - Google Patents
Message processing method, terminal and server Download PDFInfo
- Publication number
- CN116032417B CN116032417B CN202111243389.9A CN202111243389A CN116032417B CN 116032417 B CN116032417 B CN 116032417B CN 202111243389 A CN202111243389 A CN 202111243389A CN 116032417 B CN116032417 B CN 116032417B
- Authority
- CN
- China
- Prior art keywords
- message
- grade
- identification
- server
- level
- 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 26
- 238000012545 processing Methods 0.000 claims abstract description 176
- 230000004044 response Effects 0.000 claims abstract description 113
- 238000000034 method Methods 0.000 claims abstract description 95
- 230000008569 process Effects 0.000 claims abstract description 59
- 230000009467 reduction Effects 0.000 claims description 6
- 230000000694 effects Effects 0.000 abstract description 12
- 230000005540 biological transmission Effects 0.000 abstract description 8
- 238000004891 communication Methods 0.000 description 14
- 238000004590 computer program Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000001737 promoting effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Mobile Radio Communication Systems (AREA)
Abstract
The application provides a message processing method, a terminal and a server, wherein the terminal sends a message to the server, and when a message receiving response sent by the server is not received within preset time, the message is continuously sent to the server for preset times. And when the message receiving response is not received for a plurality of times continuously and the grade corresponding to the identification of the message is smaller than the highest grade, the grade corresponding to the identification of the message is improved, the message is processed by utilizing the improved grade, and the reliability of message transmission is improved. When the preset times receive the message receiving response and the grade corresponding to the identification of the message is greater than the lowest grade, the grade corresponding to the identification of the message is reduced, so that the server only needs to process the message, the message is not required to be stored, and the message processing flow is simplified. Thus, the message is correspondingly processed by combining the message receiving response and the identification of the message, and the effect of message processing is improved.
Description
Technical Field
The present application relates to the field of information technologies, and in particular, to a message processing method, a terminal, and a server.
Background
WebSocket is a protocol that performs full duplex communication over a single TCP (Transmission Control Protocol ) connection. WebSocket makes data exchange between the client and the server simpler, allowing the server to actively push data to the client.
However, the message is lost in the process of sending or receiving, so that reliable transmission of the message cannot be ensured, and the processing effect of the message is affected.
Disclosure of Invention
The application provides a message processing method, a terminal and a server, which are used for solving the problem of message transmission reliability.
In a first aspect, the present application provides a message processing method, where the method is used for a terminal, and the method includes:
When the terminal sends a message to the server and a message receiving response sent by the server is not received within a preset time, continuously sending the message for a preset number of times to the server;
If the preset times do not receive the message receiving response and the grade corresponding to the identification of the message is smaller than the highest grade, the grade corresponding to the identification of the message is promoted;
Generating a first message processing instruction according to the lifted level corresponding to the identification of the message, and sending the first message processing instruction to the server, wherein the first message processing instruction is used for indicating the server to process the message according to the lifted level;
If the preset times receive the message receiving response and the grade corresponding to the identification of the message is greater than the lowest grade, reducing the grade corresponding to the identification of the message;
Generating a second message processing instruction according to the reduced level corresponding to the identification of the message, and sending the second message processing instruction to the server, wherein the second message processing instruction is used for indicating the server to process the message according to the reduced level.
Optionally, if the preset times include a first preset times, the grade corresponding to the identifier is the lowest grade;
If the preset times do not receive the message receiving response and the grade corresponding to the identification of the message is smaller than the highest grade, the step of improving the grade corresponding to the identification of the message specifically includes:
If the first preset times do not receive the message receiving response, the grade corresponding to the identification is increased from the lowest grade to the middle grade;
If the preset times comprise second preset times, the first preset times are larger than the second preset times, and the grade corresponding to the mark is an intermediate grade;
If the preset times do not receive the message receiving response and the grade corresponding to the identification of the message is smaller than the highest grade, the step of improving the grade corresponding to the identification of the message specifically includes:
If the message receiving response is not received for the second preset times, the grade corresponding to the identification is increased from the middle grade to the highest grade.
Optionally, the preset times include a third preset times;
if the grade corresponding to the mark is the middle grade;
and if the preset times all receive the message receiving response and the grade corresponding to the identification of the message is greater than the lowest grade, reducing the grade corresponding to the identification of the message, wherein the method specifically comprises the following steps:
If the third preset times all receive the message receiving response, reducing the grade corresponding to the identification of the message from the middle grade to the lowest grade;
If the grade corresponding to the mark is the highest grade;
and if the preset times all receive the message receiving response and the grade corresponding to the identification of the message is greater than the lowest grade, reducing the grade corresponding to the identification of the message, wherein the method specifically comprises the following steps:
And if the third preset times receive the message receiving response, the grade corresponding to the identification of the message is reduced from the highest grade to the lowest grade.
Optionally, the method further comprises:
If the message receiving response is received by part of times in the preset times, generating a third message processing instruction according to the grade corresponding to the identification of the message;
sending the third message processing instruction to the server; the third message processing instruction is used for indicating the server to process the message according to the grade corresponding to the identification of the message.
Optionally, when the level corresponding to the identifier of the message is the highest level or the middle level, the method further includes:
and the terminal stores the message, and clears the stored message after receiving the message processing response sent by the server.
In a second aspect, the present application provides a message processing method, the method being used for a server, the method comprising:
receiving a first message processing instruction sent by a terminal; the first message processing instruction is generated according to the lifted level corresponding to the identification of the message; the grade corresponding to the identification of the message is promoted when the promotion condition is met;
processing the message according to the lifted level according to the first message processing instruction;
wherein, satisfying the lifting condition includes: when the terminal sends a message to the server within a preset time after the terminal sends the message, and the server does not send a message receiving response to the message, after the terminal continuously sends the message to the server for a preset number of times, the server does not send the message receiving response, and the grade corresponding to the identification of the message is smaller than the highest grade;
Receiving a second message processing instruction sent by the terminal; wherein the second message processing instruction is generated according to the reduced level corresponding to the identification of the message; the grade corresponding to the identification of the message is reduced when the reduction condition is met;
processing the message according to the reduced level according to the second message processing instruction;
wherein satisfying the reduction condition includes: and when the terminal sends the message to the server within the preset time after the terminal sends the message, and the server sends the message receiving response of the preset times after the terminal continues to send the message of the preset times to the server, wherein the grade corresponding to the identification of the message is larger than the lowest grade.
Optionally, processing the message according to the lifted level according to the first message processing instruction specifically includes:
When the promoted level is the highest level, storing and processing the message, sending a message processing response to the terminal after processing the message, and clearing the stored message;
And when the promoted level is the intermediate level, processing the message and sending a message processing response.
Optionally, processing the message according to the reduced level according to the second message processing instruction specifically includes:
And when the reduced level is the intermediate level, processing the message and sending a message processing response.
In a third aspect, the present application provides a terminal comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
The processor executes computer-executable instructions stored in the memory to implement the message processing method of the first aspect and any of the possible designs of the first aspect.
In a fourth aspect, the present application provides a server comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
The processor executes computer-executable instructions stored in the memory to implement the message processing method of the second aspect and any one of the possible designs of the second aspect.
In a fifth aspect, the present application provides a computer readable storage medium having stored therein computer instructions which, when executed by at least one processor of an electronic device, perform the message processing method of the first aspect and any of the possible designs of the first aspect or the message processing method of the second aspect and any of the possible designs of the second aspect.
In a sixth aspect, the application provides a computer program product comprising computer instructions which, when executed by at least one processor of an electronic device, perform the message handling method of the first aspect and any of the possible designs of the first aspect or the message handling method of the second aspect and any of the possible designs of the second aspect.
The application provides a message processing method, a terminal sends a message to a server, and when a message receiving response sent by the server is not received within a preset time, the message is continuously sent to the server for a preset number of times. If the message receiving response is not received for the preset times and the grade corresponding to the identification of the message is smaller than the highest grade, the grade corresponding to the identification of the message is improved. And then, generating a first message processing instruction according to the lifted level corresponding to the message identification, and sending the first message processing instruction to the server, wherein the first message processing instruction is used for indicating the server to process the message according to the lifted level. Therefore, when the message receiving response is not received for a plurality of times, the grade corresponding to the identification of the message is improved, the message is processed by utilizing the improved grade, and the reliability of message transmission is improved. And when the preset times receive the message receiving response and the grade corresponding to the identification of the message is greater than the lowest grade, reducing the grade corresponding to the identification of the message, so that the server processes the message according to the reduced grade. The message response processing of the server can be received every time the message is sent within the preset times, which indicates that the communication quality between the terminal and the server is higher, so that the grade corresponding to the identification of the message can be reduced, the server only needs to process the message, the message is not required to be stored, and the message processing flow is simplified. Thus, the message is correspondingly processed by combining the message receiving response and the identification of the message, and the effect of message processing is improved.
Drawings
In order to more clearly illustrate the application or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a message processing scenario according to an embodiment of the present application;
FIG. 2 is a flow chart of a method for message processing according to an embodiment of the present application;
FIG. 3 is a flow chart of a method for message processing according to an embodiment of the present application;
FIG. 4 is a flow chart of another method for message processing according to an embodiment of the present application;
Fig. 5 is a schematic hardware structure of a terminal according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present application, not all embodiments. 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.
At present, webSocket is widely used as a communication protocol in the field of communication of the internet of things. The WebSocket can realize the two-way communication of the message and realize the business communication of the server and the client. However, the message is lost in the process of sending or receiving, so that reliable transmission of the message cannot be ensured, and the processing effect of the message is affected.
In view of the above problems, the present application provides a message processing method, in which a terminal sends a message to a server, and when a message receiving response sent by the server is not received within a preset time, the terminal continues to send the message to the server for a preset number of times. If the message receiving response is not received for the preset times and the corresponding grade of the message representation is smaller than the highest grade, the grade corresponding to the message identification is improved. And then, generating a first message processing instruction according to the lifted level corresponding to the message identification, and sending the first message processing instruction to the server so that the server processes the message according to the lifted level. And if the preset times receive the message receiving response and the grade corresponding to the identification of the message is greater than the lowest grade, reducing the grade corresponding to the identification of the message, so that the server processes the message according to the reduced grade. The message response processing of the server can be received every time the message is sent within the preset times, which indicates that the communication quality between the terminal and the server is higher, so that the grade corresponding to the identification of the message can be reduced, the server only needs to process the message, the message is not required to be stored, and the message processing flow is simplified. Thus, the message is correspondingly processed by combining the message receiving response and the identification of the message, and the effect of message processing is improved.
The technical scheme of the application is described in detail below by specific examples. The following embodiments may be combined with each other, and some embodiments may not be repeated for the same or similar concepts or processes.
Fig. 1 is a schematic diagram of a message processing scenario according to an embodiment of the present application.
The terminal 101 transmits a message to the server 102, and continues to transmit the message to the server 102 a predetermined number of times when a message reception response transmitted by the server is not received within a predetermined time. If the terminal 101 does not receive the message receiving response for a continuous preset number of times, and the level corresponding to the identifier of the message is smaller than the highest level, the terminal 101 promotes the level corresponding to the identifier of the message. And generates a first message processing instruction according to the promoted level corresponding to the message identifier, and sends the first message processing instruction to the server 102. The server 102 receives the first message handling instructions and processes the message according to the promoted level indicated by the first message handling instructions. If the terminal 101 receives the message receiving response within the preset times and the grade corresponding to the identification of the message is greater than the lowest grade, the terminal 101 reduces the grade corresponding to the identification of the message. And generates a second message processing instruction according to the reduced level corresponding to the identifier of the message, and sends the second message processing instruction to the server 102. The server 102 receives the second message handling instructions and processes the message according to the reduced level indicated by the second message handling instructions.
Fig. 2 is a flowchart of a message processing method according to an embodiment of the present application. On the basis of the embodiment shown in fig. 1, as shown in fig. 2, with the terminal as the execution body, the method of this embodiment may include the following steps:
S101, the terminal sends a message to the server, and when a message receiving response sent by the server is not received within a preset time, the terminal continuously sends the message for preset times to the server.
When the terminal sends a message to the server, the message receiving response is needed to be made by the server after the message is received, so as to inform the terminal that the message is received. If the terminal does not receive the message receiving response sent by the server within the preset time for sending the message to the server, the terminal continuously sends the message to the server for preset times.
In general, messages of different grades require a server to make different replies, for example, when the grade of a message is the highest grade, the server is required to not only send a message reception reply to a terminal after receiving the message, but also store the message, process the message, send a message processing reply to the terminal after processing, and clear the stored message after sending the message processing reply. When the message is at the lowest level, the server is only required to send a message receiving response to the terminal and process the message. When the level of the message is the intermediate level, the server is required to send a message reception response to the terminal and process the message, and send a message processing response to the terminal. The highest, lowest and middle herein are understood to be the importance of a message, the highest representing the most important of the message.
Thus, in order to facilitate different responses to different messages to the server, it is necessary that the terminal, when sending a message to the server, simultaneously sends an identifier of the message, where the identifier is used to indicate the level to which the message corresponds. For example, identifying a ranking corresponding to the indication message as the lowest ranking, the middle ranking, or the highest ranking.
And when the message receiving response sent by the server is not received within the preset time, continuously sending the message to the server for a plurality of times. If the preset times do not receive the message receiving response and the corresponding level of the message identifier is less than the highest level, step S102 is executed. If the message receiving responses are received within the preset times and the grade corresponding to the identification of the message is greater than the lowest grade, step S104 is executed.
S102, promoting the grade corresponding to the identification of the message.
After the terminal continuously sends the message to the server for preset times, the terminal does not receive the message receiving response sent by the server. Specifically, each message sent within the preset times does not receive a message receiving response within the corresponding preset time. And the grade corresponding to the identification of the message is smaller than the highest grade, namely the grade corresponding to the identification of the message is the lowest grade or the middle grade, and the grade corresponding to the identification of the message is promoted. The preset times generally correspond to the grades, i.e. the first preset times correspond to the lowest grade, the second preset times correspond to the middle grade, and the first preset times are larger than the second preset times. The first preset number of times may be three times, and the second preset number of times may be two times.
Specifically, when the preset times include a first preset times, and the grade corresponding to the identifier is the lowest grade, the message receiving response sent by the server is not received within the first preset times, and the grade corresponding to the identifier is increased from the lowest grade to the middle grade.
When the preset times comprise second preset times and the grade corresponding to the identifier is the middle grade, the message receiving response sent by the server is not received in the second preset times, and the grade corresponding to the identifier is lifted from the middle grade to the highest grade.
Then, step S103 is performed.
S103, generating a first message processing instruction according to the lifted level corresponding to the identification of the message, and sending the first message processing instruction to the server.
After the terminal promotes the grade corresponding to the identification of the message, a first message processing instruction is generated according to the promoted grade corresponding to the identification of the message. The first message processing instruction is used for instructing the server to process the message according to the promoted level.
Specifically, the grade corresponding to the identification of the message is the lowest grade, the grade corresponding to the identification of the message after lifting is the middle grade, and the first message processing instruction generated according to the middle grade is used for indicating the server to process the message according to the middle grade. After receiving the first message processing instruction, the server sends a message receiving response to the terminal and processes the message, and sends a message processing response to the terminal.
The grade corresponding to the identification of the message is the middle grade, the grade corresponding to the identification of the message after being lifted is the highest grade, and the first message processing instruction generated according to the highest grade is used for indicating the server to process the message according to the highest grade. The server sends a message receiving response to the terminal after receiving the first message processing instruction, stores the message, processes the message, sends the message processing response to the terminal after processing, and clears the stored message after sending the message processing response.
S104, reducing the grade corresponding to the identification of the message.
And if the message receiving response sent by the server is received in each message sending within the preset times, and the grade corresponding to the identification of the message is the middle grade or the highest grade, reducing the grade corresponding to the identification of the message. That is, when the grade corresponding to the identification of the message is the middle grade, the grade corresponding to the identification of the message is reduced from the middle grade to the lowest grade, and when the grade corresponding to the identification of the message is the highest grade, the grade corresponding to the identification of the message is reduced from the highest grade to the lowest grade or the middle grade. And then step S205 is performed. In a specific application, the preset number of times may be a third preset number of times, which is greater than the first preset number of times, for example, the first preset number of times is three times, and the third preset number of times is ten times.
As one implementation manner, the preset times include a third preset times, the grade corresponding to the identifier is an intermediate grade, and if the third preset times receive the message receiving response, the grade corresponding to the identifier of the message is reduced from the intermediate grade to the lowest grade.
As another implementation manner, the preset times include a third preset times, the grade corresponding to the identifier is the highest grade, and if the third preset times receive the message receiving response, the grade corresponding to the identifier of the message is reduced from the highest grade to the lowest grade.
S105, generating a second message processing instruction according to the reduced level corresponding to the identification of the message, and sending the second message processing instruction to the server.
The terminal generates a second message processing instruction according to the reduced level corresponding to the message identification, wherein the second message processing instruction is used for instructing the server to process the message according to the reduced level. For example, the grade corresponding to the identification of the message is the highest grade, the grade corresponding to the identification of the message after being reduced is the lowest grade, and the generated second message processing instruction is used for indicating the service to process the message according to the lowest grade. The server processes the message at the lowest level after receiving the second message processing instruction. When the grade corresponding to the identification of the message is the intermediate grade, the grade corresponding to the identification of the message after being reduced is the lowest grade, and the generated second message processing instruction is used for indicating the server to process the message according to the lowest grade. The server processes the message at the lowest level after receiving the second message processing instruction.
When the grade corresponding to the identification of the message is the highest grade or the middle grade, the terminal can store the message, and after receiving the message processing response sent by the server, the stored message is cleared, so that the high-efficiency cache of the message is ensured, and the situation that the data loss influences the data processing when the abnormality occurs in the sending process is avoided.
When the terminal does not receive the message receiving response sent by the server within the preset time, the message processing method provided by the application continues to continuously send the message for preset times to the server. If the message receiving response is not received within the preset times and the grade corresponding to the identification of the message is smaller than the highest grade, the grade corresponding to the identification of the message is promoted, and the server is instructed to process the message according to the promoted grade. And when the message receiving response is not received for a plurality of times, the grade corresponding to the identification of the message is improved, the message is processed by the improved grade, and the reliability of message transmission is improved. And when the preset times receive the message receiving response and the grade corresponding to the identification of the message is greater than the lowest grade, reducing the grade corresponding to the identification of the message, so that the server processes the message according to the reduced grade. The message response processing of the server can be received every time the message is sent within the preset times, which indicates that the communication quality between the terminal and the server is higher, so that the grade corresponding to the identification of the message can be reduced, the server only needs to process the message, the message is not required to be stored, and the message processing flow is simplified. Thus, the message is correspondingly processed by combining the message receiving response and the identification of the message, and the effect of message processing is improved.
Fig. 3 is a flowchart of a message processing method according to an embodiment of the present application. On the basis of the embodiment shown in fig. 3, when a part of times in the preset times receive the message receiving response, the embodiment can also process the message according to the grade corresponding to the identification of the message, simplify the flow of message processing, and improve the effect of message processing. As shown in fig. 3, with the terminal as the execution body, the method of this embodiment may include the following steps:
S201, the terminal sends the message to the server, and when the message receiving response sent by the server is not received within the preset time, the terminal continuously sends the message for preset times to the server.
And the terminal sends the message to the server, and continuously sends the message to the server for a plurality of times when the message receiving response sent by the server is not received within the preset time. If the preset times do not receive the message receiving response and the corresponding level of the message identifier is less than the highest level, step S202 is executed. If the message receiving responses are received within the preset times and the grade corresponding to the identification of the message is greater than the lowest grade, step S204 is executed. If the message receiving response is received by the part of the times within the preset times, step S206 is executed.
S202, promoting the grade corresponding to the identification of the message.
And when the message receiving response sent by the server is not received in each message sending within the preset times, and the grade corresponding to the identification of the message is the lowest grade or the middle grade, the grade corresponding to the identification of the message is improved. Then, step S203 is performed.
S203, generating a first message processing instruction according to the lifted level corresponding to the identification of the message, and sending the first message processing instruction to the server.
When the promoted level corresponding to the message identification is the intermediate level, the generated first message processing instruction is used for indicating the server to process the message according to the intermediate level. And after receiving the first message processing instruction, the server processes the message according to the first message processing instruction.
S204, reducing the grade corresponding to the identification of the message.
And if the message receiving response sent by the server is received in each message sending within the preset times, and the grade corresponding to the identification of the message is the middle grade or the highest grade, reducing the grade corresponding to the identification of the message. And then step S205 is performed.
S205, generating a second message processing instruction according to the reduced level corresponding to the identification of the message, and sending the second message processing instruction to the server.
The terminal generates a second message processing instruction according to the reduced level corresponding to the message identification, wherein the second message processing instruction is used for instructing the server to process the message according to the reduced level. And after receiving the second message processing instruction, the server processes the message according to the second processing instruction.
S206, generating a third message processing instruction according to the grade corresponding to the identification of the message, and sending the third message processing instruction to the server.
The message receiving response is received by a part of times within the preset times, for example, the message is continuously sent for five times, and the message receiving response sent by the server is received for three times. And generating a third message processing instruction according to the grade corresponding to the identification of the message, wherein the third message processing instruction is used for instructing the server to process the message according to the grade corresponding to the identification of the message, namely, the grade corresponding to the identification of the message is kept, and the grade corresponding to the identification of the message is not adjusted. For example, the grade corresponding to the identification of the message is the lowest grade, and the third message processing instruction is used for instructing the server to process the message according to the lowest grade; the grade corresponding to the identification of the message is the intermediate grade, and the third message processing instruction is used for indicating the server to process the message according to the intermediate grade; the grade corresponding to the identification of the message is the highest grade, and the third message processing instruction is used for instructing the server to process the message according to the highest grade. And after receiving the third message processing instruction, the server processes the message according to the third message processing instruction.
In the message processing method provided by the application, if part of times in the preset times receive the message receiving response, the server is instructed to process the message according to the grade corresponding to the identification of the message. The message receiving response is received by part of times in the preset times, which indicates that the communication quality of the terminal and the server is common, so that the grade corresponding to the identification of the message is maintained, the server processes the message according to the existing grade of the identification of the message, the grade corresponding to the identification of the message does not need to be adjusted, the flow of message processing is simplified, and the effect of message processing is improved.
Fig. 4 is a flowchart of a message processing method according to an embodiment of the present application. On the basis of the embodiment shown in fig. 1, as shown in fig. 4, with the server as the execution body, the method of this embodiment may include the following steps:
S301, receiving a first message processing instruction sent by a terminal.
The first message processing instruction is generated according to the promoted level corresponding to the identification of the message, and the level corresponding to the identification of the message is promoted when the promotion condition is met. Meeting the lifting condition includes: and when the server does not send the message receiving response to the message within the preset time after the terminal sends the message to the server, after the terminal continues to send the message for preset times to the server, the server does not send the message receiving response, and the grade corresponding to the identification of the message is smaller than the highest grade.
Specifically, in a preset time after the terminal sends the message to the server, when the message receiving response to the message sent by the server is not received, after the terminal continues to send the message to the server for a preset number of times, each time the message is sent in the preset number of times, the message receiving response to the message sent by the server is not received yet, and meanwhile, the grade corresponding to the identifier of the message is smaller than the highest grade, namely, the grade corresponding to the identifier of the message is the lowest grade or the middle grade, the terminal promotes the grade corresponding to the identifier of the message, generates a first message processing instruction according to the promoted grade corresponding to the identifier of the message, and sends the first message processing instruction to the server.
S302, processing the message according to the lifted level according to the first message processing instruction.
And after receiving the first message processing instruction, the server processes the message according to the promoted level. If the level of the message with the increased identifier is the middle level, the server processes the message according to the middle level after receiving the first message processing instruction, and if the level of the message with the increased identifier is the highest level, the server processes the message according to the highest level after receiving the first message processing instruction.
Specifically, when the promoted level is the highest level, the server stores and processes the message after receiving the first message processing instruction, sends a message processing response to the terminal after processing the message, and clears the stored message. When the promoted level is the intermediate level, the server processes the message after receiving the first message processing instruction, and sends a message processing response to the terminal.
S303, receiving a second message processing instruction sent by the terminal.
Second message processing instruction the second message processing instruction is generated from the reduced level corresponding to the identification of the message, the level corresponding to the identification of the message being reduced when the reduction condition is satisfied. Meeting the reduction condition includes: and in the preset time after the terminal sends the message to the server, the server sends the message receiving response to the message, and after the terminal continues to send the message for preset times to the server, the server sends the receiving response for preset times, and the grade corresponding to the identification of the message is greater than the lowest grade.
Specifically, in a preset time after the terminal sends the message to the server, when the message receiving response to the message sent by the server is not received, after the terminal continues to send the message to the server for a preset number of times, each time the message is sent in the preset number of times, the message receiving response to the message sent by the server is received, meanwhile, the grade corresponding to the identifier of the message is greater than the lowest grade, that is, the grade corresponding to the identifier of the message is the highest grade or the middle grade, the grade corresponding to the identifier of the message is reduced by the terminal, a second message processing instruction is generated according to the reduced grade corresponding to the identifier of the message, and the second message processing instruction is sent to the server.
S304, processing the message according to the reduced level according to the second message processing instruction.
And after receiving the first message processing instruction, the server processes the message according to the reduced level. If the level of the reduced message identifier is the intermediate level, the server processes the message according to the intermediate level after receiving the second message processing instruction of the second message processing instruction, and if the level of the reduced message identifier is the lowest level, the server processes the message according to the lowest level after receiving the first message processing instruction.
Specifically, when the reduced level is the intermediate level, the server processes the message after receiving the second message processing instruction, and sends a message processing response to the terminal. When the reduced level is the lowest level, the server processes the message after receiving the second message processing instruction, and the terminal does not need to send a message processing response.
In the present embodiment, the steps S301 and S303 are not limited by the described order of operation, and the steps S301 and S303 may be performed in other orders.
According to the message processing method provided by the application, after receiving the first message processing instruction sent by the terminal, the server processes the level of the message after the message is lifted according to the first message processing instruction. The first message processing instruction is generated according to the grade corresponding to the identification of the lifting message when the message receiving response is not received for a plurality of times. As the message response processing of the server is not received in each message sending within the preset times, the communication quality between the terminal and the server is poor, the message is processed by using the improved grade, the reliability of message transmission is improved, and the processing effect of the message is further improved. And after receiving the second message processing instruction, the server processes the message according to the second message processing instruction. And the second message processing instruction is generated by reducing the grade corresponding to the identification of the message when the message receiving response is received for the preset times and the grade corresponding to the identification of the message is greater than the lowest grade. The message response processing of the server can be received every time the message is sent within the preset times, which indicates that the communication quality between the terminal and the server is higher, so that the message can be processed by using the reduced level, the flow of the message processing is simplified, and the effect of the message processing is improved.
Fig. 5 shows a schematic hardware structure of a terminal according to an embodiment of the present application. As shown in fig. 5, the terminal 20 is configured to implement the operations corresponding to the terminal in any method embodiment when the terminal is the execution subject, where the terminal 20 in this embodiment may include: a processor 22, a memory 21 communicatively connected to the processor 22, and a communication interface 23.
A memory 21 for storing computer-executable instructions.
The processor 22 is configured to execute the computer-executable instructions stored in the memory, so as to implement the message processing method in the corresponding embodiment when the terminal is used as the execution body. Reference may be made in particular to the relevant description of the embodiments of the method described above.
Alternatively, the memory 21 may be separate or integrated with the processor 22.
The communication interface 23 may be connected to the processor 21. The processor 22 may control the communication interface 23 to perform the functions of receiving and transmitting messages.
The terminal provided in this embodiment may be used to execute the above message processing method performed with the terminal as the execution body, and its implementation manner and technical effects are similar, which is not described herein again.
The embodiment of the application also provides a server, which comprises: a processor, a memory communicatively coupled to the processor;
The memory stores computer-executable instructions;
The processor executes the computer-executable instructions stored in the memory to implement the message processing method in the corresponding embodiment when the server is used as the execution body. Reference may be made in particular to the relevant description of the embodiments of the method described above.
The server provided in this embodiment may be used to execute the above message processing method performed with the terminal as the execution body, and its implementation manner and technical effects are similar, which is not described here again.
The present application also provides a computer readable storage medium having stored therein computer instructions which, when executed by a processor, are adapted to carry out the methods provided by the various embodiments described above.
The present application also provides a computer program product comprising computer instructions stored in a computer readable storage medium. The computer instructions may be read from a computer-readable storage medium by at least one processor of the device, and executed by the at least one processor, cause the device to implement the methods provided by the various embodiments described above.
The embodiment of the application also provides a chip, which comprises a memory and a processor, wherein the memory is used for storing computer instructions, and the processor is used for calling and running the computer instructions from the memory, so that a device provided with the chip executes the method in various possible implementation manners.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same. Although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments may be modified or some or all of the technical features may be replaced with equivalents. Such modifications and substitutions do not depart from the spirit of the application.
Claims (10)
1. A message processing method, wherein the method is used for a terminal, and comprises:
When the terminal sends a message to the server and a message receiving response sent by the server is not received within a preset time, continuously sending the message for a preset number of times to the server;
If the preset times do not receive the message receiving response and the grade corresponding to the identification of the message is smaller than the highest grade, the grade corresponding to the identification of the message is promoted;
Generating a first message processing instruction according to the lifted level corresponding to the identification of the message, and sending the first message processing instruction to the server, wherein the first message processing instruction is used for indicating the server to process the message according to the lifted level;
If the preset times receive the message receiving response and the grade corresponding to the identification of the message is greater than the lowest grade, reducing the grade corresponding to the identification of the message;
Generating a second message processing instruction according to the reduced level corresponding to the identification of the message, and sending the second message processing instruction to the server, wherein the second message processing instruction is used for indicating the server to process the message according to the reduced level.
2. The method of claim 1, wherein if the preset number of times includes a first preset number of times, the grade corresponding to the identifier is a lowest grade;
If the preset times do not receive the message receiving response and the grade corresponding to the identification of the message is smaller than the highest grade, the step of improving the grade corresponding to the identification of the message specifically includes:
If the first preset times do not receive the message receiving response, the grade corresponding to the identification is increased from the lowest grade to the middle grade;
If the preset times comprise second preset times, the first preset times are larger than the second preset times, and the grade corresponding to the mark is an intermediate grade;
If the preset times do not receive the message receiving response and the grade corresponding to the identification of the message is smaller than the highest grade, the step of improving the grade corresponding to the identification of the message specifically includes:
If the message receiving response is not received for the second preset times, the grade corresponding to the identification is increased from the middle grade to the highest grade.
3. The method of claim 1, wherein the preset number of times comprises a third preset number of times;
if the grade corresponding to the mark is the middle grade;
and if the preset times all receive the message receiving response and the grade corresponding to the identification of the message is greater than the lowest grade, reducing the grade corresponding to the identification of the message, wherein the method specifically comprises the following steps:
If the third preset times all receive the message receiving response, reducing the grade corresponding to the identification of the message from the middle grade to the lowest grade;
If the grade corresponding to the mark is the highest grade;
and if the preset times all receive the message receiving response and the grade corresponding to the identification of the message is greater than the lowest grade, reducing the grade corresponding to the identification of the message, wherein the method specifically comprises the following steps:
And if the third preset times receive the message receiving response, the grade corresponding to the identification of the message is reduced from the highest grade to the lowest grade.
4. A method according to any one of claims 1-3, characterized in that the method further comprises:
If the message receiving response is received by part of times in the preset times, generating a third message processing instruction according to the grade corresponding to the identification of the message;
sending the third message processing instruction to the server; the third message processing instruction is used for indicating the server to process the message according to the grade corresponding to the identification of the message.
5. The method of claim 1, wherein when the level corresponding to the identification of the message is the highest level or the middle level, the method further comprises:
and the terminal stores the message, and clears the stored message after receiving the message processing response sent by the server.
6. A method of message processing, the method for use with a server, the method comprising:
receiving a first message processing instruction sent by a terminal; the first message processing instruction is generated according to the lifted level corresponding to the identification of the message; the grade corresponding to the identification of the message is promoted when the promotion condition is met;
processing the message according to the lifted level according to the first message processing instruction;
wherein, satisfying the lifting condition includes: when the terminal sends a message to the server within a preset time after the terminal sends the message, and the server does not send a message receiving response to the message, after the terminal continuously sends the message to the server for a preset number of times, the server does not send the message receiving response, and the grade corresponding to the identification of the message is smaller than the highest grade;
Receiving a second message processing instruction sent by the terminal; wherein the second message processing instruction is generated according to the reduced level corresponding to the identification of the message; the grade corresponding to the identification of the message is reduced when the reduction condition is met;
processing the message according to the reduced level according to the second message processing instruction;
wherein satisfying the reduction condition includes: and when the terminal sends the message to the server within the preset time after the terminal sends the message, and the server sends the message receiving response of the preset times after the terminal continues to send the message of the preset times to the server, wherein the grade corresponding to the identification of the message is larger than the lowest grade.
7. The method according to claim 6, wherein processing the message according to the first message processing instruction according to the promoted level comprises:
When the promoted level is the highest level, storing and processing the message, sending a message processing response to the terminal after processing the message, and clearing the stored message;
And when the promoted level is the intermediate level, processing the message and sending a message processing response.
8. The method of claim 6, wherein processing the message according to the second message processing instruction at a reduced level comprises:
And when the reduced level is the intermediate level, processing the message and sending a message processing response.
9. A terminal, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
The processor executes computer-executable instructions stored in the memory to implement the message processing method of any one of claims 1 to 5.
10. A server, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored in the memory to implement the message processing method of any one of claims 6 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111243389.9A CN116032417B (en) | 2021-10-25 | 2021-10-25 | Message processing method, terminal and server |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111243389.9A CN116032417B (en) | 2021-10-25 | 2021-10-25 | Message processing method, terminal and server |
Publications (2)
Publication Number | Publication Date |
---|---|
CN116032417A CN116032417A (en) | 2023-04-28 |
CN116032417B true CN116032417B (en) | 2024-04-19 |
Family
ID=86080057
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111243389.9A Active CN116032417B (en) | 2021-10-25 | 2021-10-25 | Message processing method, terminal and server |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116032417B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20040022521A (en) * | 2002-09-09 | 2004-03-16 | 주식회사 팬택앤큐리텔 | Method for Changing Task Priority of Protocol Service |
JP2012105281A (en) * | 2004-04-01 | 2012-05-31 | Panasonic Corp | Interference limiting for retransmission |
EP3024182A1 (en) * | 2014-11-24 | 2016-05-25 | Orange | Method and device for managing a message |
CN107786623A (en) * | 2016-09-20 | 2018-03-09 | 平安科技(深圳)有限公司 | Message asynchronous processing method and device |
CN107968848A (en) * | 2017-11-27 | 2018-04-27 | 广东欧珀移动通信有限公司 | A kind of method, terminal device and storage medium for obtaining IP address |
CN108900506A (en) * | 2018-06-28 | 2018-11-27 | 江苏中威科技软件系统有限公司 | Information push method, push server and transmission control protocol server |
CN110601800A (en) * | 2018-06-12 | 2019-12-20 | 中国移动通信集团山东有限公司 | Narrowband Internet of things data transmission method and base station |
WO2020220962A1 (en) * | 2019-04-28 | 2020-11-05 | 大唐移动通信设备有限公司 | Sidelink transmission method and terminal |
WO2021017792A1 (en) * | 2019-08-01 | 2021-02-04 | 华为技术有限公司 | Feedback information transmission method and terminal device |
CN113242172A (en) * | 2021-04-26 | 2021-08-10 | 福建天泉教育科技有限公司 | Message response method and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10027731B2 (en) * | 2013-10-25 | 2018-07-17 | Louis Gurtowski | Selective capture with rapid sharing of user computer or mixed reality actions, states using interactive virtual streaming |
-
2021
- 2021-10-25 CN CN202111243389.9A patent/CN116032417B/en active Active
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20040022521A (en) * | 2002-09-09 | 2004-03-16 | 주식회사 팬택앤큐리텔 | Method for Changing Task Priority of Protocol Service |
JP2012105281A (en) * | 2004-04-01 | 2012-05-31 | Panasonic Corp | Interference limiting for retransmission |
EP3024182A1 (en) * | 2014-11-24 | 2016-05-25 | Orange | Method and device for managing a message |
CN107786623A (en) * | 2016-09-20 | 2018-03-09 | 平安科技(深圳)有限公司 | Message asynchronous processing method and device |
CN107968848A (en) * | 2017-11-27 | 2018-04-27 | 广东欧珀移动通信有限公司 | A kind of method, terminal device and storage medium for obtaining IP address |
CN110601800A (en) * | 2018-06-12 | 2019-12-20 | 中国移动通信集团山东有限公司 | Narrowband Internet of things data transmission method and base station |
CN108900506A (en) * | 2018-06-28 | 2018-11-27 | 江苏中威科技软件系统有限公司 | Information push method, push server and transmission control protocol server |
WO2020220962A1 (en) * | 2019-04-28 | 2020-11-05 | 大唐移动通信设备有限公司 | Sidelink transmission method and terminal |
WO2021017792A1 (en) * | 2019-08-01 | 2021-02-04 | 华为技术有限公司 | Feedback information transmission method and terminal device |
CN113242172A (en) * | 2021-04-26 | 2021-08-10 | 福建天泉教育科技有限公司 | Message response method and system |
Non-Patent Citations (1)
Title |
---|
一种窄带物联网系统的上行链路适配方案设计;徐东明;徐磊;;西安邮电大学学报;20171110(第06期) * |
Also Published As
Publication number | Publication date |
---|---|
CN116032417A (en) | 2023-04-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110808948B (en) | Remote procedure calling method, device and system | |
CN113630465B (en) | Message processing method, device, equipment and storage medium | |
CN112218339B (en) | Relay transmission scheduling method, device, storage medium and electronic equipment | |
CN106254206A (en) | A kind of information processing method and equipment | |
CN110912805B (en) | Message reading state synchronization method, terminal, server and system | |
CN104348874B (en) | The method and apparatus that message is transmitted between cloud platform component | |
CN116032417B (en) | Message processing method, terminal and server | |
CN110913431A (en) | Data wireless transmission method and device, computer equipment and storage medium | |
CN107317731A (en) | A kind of detection method of client and server connection state | |
CN111200653B (en) | Multi-platform communication method, multi-platform communication device and intermediate server | |
US6263001B1 (en) | Packet data communication protocol with reduced acknowledgements in a client/server computing system | |
CN102043901A (en) | Two-way referral processing method and system as well as calling terminal | |
CN105634894A (en) | Enhanced type CAN bus data resending method and device | |
CN113411102B (en) | Data transmission method, device and system and storage medium | |
CN112188562B (en) | Multicast scheduling method and device for relay base station, storage medium and electronic device | |
CN111586841B (en) | Terminal paging optimization method, system, device and readable storage medium | |
JP4638468B2 (en) | Automatic report processing system and center equipment | |
CN107026888A (en) | Large Volume Data conveyer and method | |
CN114827167B (en) | Node selection and transaction transmission method, device and storage medium | |
CN101727314A (en) | Data processing method and processor | |
CN111083127B (en) | Session management method, electronic device, and computer-readable storage medium | |
CN113204440B (en) | Message sending method, device, electronic equipment and storage medium | |
CN115226152B (en) | Communication method, system, electronic equipment and storage medium of satellite network | |
CN115550303B (en) | Notification message sending method, device, equipment and medium | |
CN103140835A (en) | Interrupt-based command processing |
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 |