[go: up one dir, main page]

CN117135125A - A message processing method, system, equipment and medium in network delay state - Google Patents

A message processing method, system, equipment and medium in network delay state Download PDF

Info

Publication number
CN117135125A
CN117135125A CN202311128873.6A CN202311128873A CN117135125A CN 117135125 A CN117135125 A CN 117135125A CN 202311128873 A CN202311128873 A CN 202311128873A CN 117135125 A CN117135125 A CN 117135125A
Authority
CN
China
Prior art keywords
message
count value
request message
processing
request
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.)
Pending
Application number
CN202311128873.6A
Other languages
Chinese (zh)
Inventor
何仲鹏
张常华
林弟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Baolun Electronics Co ltd
Original Assignee
Guangdong Baolun Electronics Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangdong Baolun Electronics Co ltd filed Critical Guangdong Baolun Electronics Co ltd
Priority to CN202311128873.6A priority Critical patent/CN117135125A/en
Publication of CN117135125A publication Critical patent/CN117135125A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/56Queue scheduling implementing delay-aware scheduling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/34Flow control; Congestion control ensuring sequence integrity, e.g. using sequence numbers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a message processing method, a system, equipment and a medium in a network delay state, wherein the method comprises the following steps: receiving a request message sent by a client, wherein the request message comprises a message count value; the client increases/decreases the message count value according to the sending sequence of the request message; analyzing the message count value of the request message, judging the processing sequence of the message count value, and sequentially processing the sent request message according to the ascending/descending sequence of the message count value. The invention judges the processing sequence of the message count value of the request message, and processes the sent request message in sequence according to the sequence of the message count value, which can be applied to the practical application environment with large message concurrency and message sequence processing sequence, and effectively prevents the invalid or wrong request condition caused by network delay under the multilink network.

Description

Message processing method, system, equipment and medium in network delay state
Technical Field
The present invention relates to the field of network information processing, and in particular, to a method, a system, an apparatus, and a medium for processing a message in a network delay state.
Background
At present, a client or a server sends request messages generally in queue processing, the messages received by a program are pushed into an temporary message storage container one by one according to a sequence, then the messages are extracted and processed in a processing thread according to the message pushing sequence, and the message processing sequence is that the messages are received and processed first. In an actual application scenario, there are many unpredictable network problems, such as queuing delay caused by network jitter, so that two messages to be processed sequentially are sent in different network packets, network delay exists between the two messages, and the message to be processed later arrives faster than the message to be processed earlier, so that the processing sequence of the two messages violates programming logic, and the system request is invalid or wrong.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention aims to provide a message processing method, a system, equipment and a storage medium in a network delay state, which can effectively prevent invalid or error requests caused by network delay in a multi-link network.
The invention adopts the following technical scheme:
a method for processing a message in a network delay state, comprising:
receiving a request message sent by a client, wherein the request message comprises a message count value; the client increases/decreases the message count value according to the sending sequence of the request message;
analyzing the message count value of the request message, judging the processing sequence of the message count value, and sequentially processing the sent request message according to the ascending/descending sequence of the message count value.
Further, after each processing of any one of the request messages, the method further includes:
and reading the message count value of the processed request message and replying the message count value to the client.
Further, the method for judging the processing sequence of the message count value comprises the following steps:
comparing the message count value of the currently received request message with the message count value of the previously processed request message, and processing the currently required request message if the message count value of the currently received request message and the message count value of the previously processed request message are continuous and incremental or continuous and decremental.
Further, in the process of judging the processing sequence of the message count value, if the message count value of the currently received request message is discontinuous with the message count value of the previously processed request message, the processing of the current request message is suspended, and the next sent request message is continuously judged in the processing sequence until the request message with the continuously and gradually increased or continuously and gradually decreased message count value is received, the message is processed.
Further, in the process of suspending processing the request message, recording the suspension waiting time, and if the suspension waiting time exceeds the preset time, returning an error reply to the client.
Further, if the retransmitted request message is received, the retransmitted request message and the request message which is sent but is being queued are subjected to processing sequence judgment again; and the retransmitted request message is sent out according to the request message with failed transmission when the client receives the returned error reply, and the message count value of the retransmitted request message is updated.
Further, the count limit value of the request message is set by the message concurrency of the client, and if the message count value of any request message reaches the set count limit value, the message count value is counted again.
In addition, a message processing system in a network delay state is provided, and the message processing method in the network delay state is executed, wherein the system comprises the following steps:
the network module is used for receiving a request message sent by the client, wherein the request message comprises a message count value; the client increases/decreases the message count value according to the sending sequence of the request message;
the message preprocessing module is used for analyzing the message count value of the request message and judging the processing sequence of the message count value;
and the message processing module is used for sequentially processing the sent request messages according to the ascending/descending order of the message count value.
In addition, there is provided an electronic apparatus characterized by comprising: a memory for storing a program; and a processor for executing the program stored in the memory, wherein when the program is executed, the processor is used for executing the message processing method under the network delay state.
Furthermore, a computer readable storage medium is provided, in which a computer program is stored which, when run on one or more processors, performs a method of message processing in a network latency state as described above.
Compared with the prior art, the invention has the beneficial effects that:
(1) The server judges the processing sequence of the message count value of the request message and processes the sent request message in sequence according to the sequence of the message count value; the server can clear the message processing sequence, so that even the late message can be processed first; the method can be applied to an actual application environment with large message concurrency and message sequence processing order, and can effectively prevent the condition that the request is invalid or wrong due to network delay under a multi-link network;
(2) The message count value of the processed request message is returned to the client, so that the message processing progress of the server can be clearly known under the condition that the client sends a plurality of identical requests in a short time.
Drawings
FIG. 1 is a flow chart of a message processing method in a network delay state according to the present invention;
fig. 2 is a schematic diagram of message transmission between a client and a server according to the present invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and detailed description, wherein it is to be understood that, on the premise of no conflict, the following embodiments or technical features may be arbitrarily combined to form new embodiments.
Example 1
The embodiment provides a message processing method in a network delay state, which adds a counter to a message header of a client transmitting end, so that a server end can determine the correct sequence of a request message according to a count value, process the request according to the sequence, and particularly is applied to a plurality of clients and transmits the message by using a UDP protocol; since the UDP protocol cannot provide a data ordering and checking function, and it has no mechanism for confirming whether the receiver receives data, there is a possibility that message data is lost. By adopting the method of the embodiment, the server can know whether data is lost in the middle, the client can also know whether the data is lost or not, retransmission is timely arranged, and the message processing accuracy is improved.
In this embodiment, the message processing is completed, and a communication connection needs to be established between the client and the server in advance, where the client may send a request message to the server, and the server may also return a message processing result to the client. As shown in fig. 1, the message processing method executed by the server of the present embodiment specifically includes the following steps:
step S1: receiving a request message sent by a client, wherein the request message comprises a message count value; the client increases/decreases the message count value according to the sending sequence of the request message;
step S2: analyzing the message count value of the request message, judging the processing sequence of the message count value, and sequentially processing the sent request message according to the ascending/descending sequence of the message count value.
The received request message may be sent by the client through a network packet mode under the multilink network, if the network problems such as network delay are faced, the client sends a plurality of request messages to the server through different network packets, and the server can push the request messages into the temporary message storage container one by one according to the sequence of sending each request message after receiving the request messages; after extracting the request message from the message storage container according to the message pushing sequence, the message count value of the request message is processed according to the message size sequence after the processing sequence judgment.
In addition, the request message can be sent by a client queue, if a certain function of the client fails, the fault needs to be reported to the server, the fault release needs to be reported to the server, and the fault report message and the fault release message can be sent by the client queue because the fault report message and the fault release message must be processed in sequence; because the message reporting the fault may have a transmission failure, the message with the transmission failure is successfully transmitted in the process of waiting for retransmission, so that the message with the fault elimination arrives at the server before the message with the fault reporting; therefore, after receiving the transmitted request message, the server processes the message according to the size of the message after judging the message count value of the request message and sorting the message according to the processing sequence, so that the message processing accuracy can be ensured.
The message count value of the request message can be realized by a counter which is increased on the message header of the sending end of the client, the counter has a certain byte number, the byte number can be expanded according to the message concurrency in the actual use process, the client can count each sent message, namely the count limit value of the request message is set according to the message concurrency of the client; if the message count value is counted up until the count reaches the upper limit value, the message count value returns to zero and then the count is recycled, and the messages are recycled in sequence, so that each message is ensured to have a relatively unique count value in a certain message quantity; for example, if the a message count value is 0x0000, the next B message count value is 0x0001, and so on.
In addition, the message count value of the sequentially sent request messages can be also counted in a decrementing mode, and if the message count value A of the client is 0x0001 and the message count value B of the client is 0x0000; if the message count value is decreased to the lower limit value, the message count value is updated again to the upper limit value, and then the cycle count is decreased again, so that each message is ensured to have a relatively unique count value in a certain message quantity.
Referring to fig. 2, after the server receives the request message sent by the client, the server may parse the message count value in the request message, determine the processing sequence of the message count value of the currently received request message and the message count value of the previously processed request message, if there is no request message already processed in the server, determine whether the message count value of the currently received request message is the initial message count value, and if so, directly process the currently received request message by the server. After each time the server processes any one of the request messages, the server needs to read and record the message count value of the processed request message, and simultaneously replies the message count value to the client, so that the client knows the processing progress of the server.
In addition to the above, if the server receives the request message sent by the client, and compares the message count value of the currently received request message with the message count value of the previously processed request message, if the message count value of the currently received request message is continuous and incremental with the message count value of the previously processed request message, the processing sequence is met, and at this time, the request message which needs to be processed currently can be processed. For example, if the message count value of the currently received request message is 0x0001 and the message count value of the previously processed request message is 0x0000, the message count values of the two are continuously and incrementally increased, so that the current request message can be processed. If the counter counts according to the decrementing rule, the message count value of the currently received request message is continuous and decrementing with the message count value of the previously processed request message, and the processing sequence is met.
In the process of judging the processing sequence of the message count value, if the message count value of the currently received request message is discontinuous with the message count value of the previously processed request message, suspending the processing of the current request message, and waiting for the missing message to arrive by a server; the server can also continue to process the sequence judgment of the next transmitted request message in the waiting process until the request message with continuous and incremental message count value is received. For example, if the message count value of the previously processed request message is 0x0000 and the message count value of the currently received request message is 0x0002, the server waits for the arrival of the request message whose message count value is 0x 0001. Similarly, if the counter counts according to the decrementing rule, the server will continue to process the sequence judgment on the next sent request message during the waiting process, until receiving the request message with continuous and decrementing message count value, the server will not process the message.
Meanwhile, in the process of suspending processing the request message, the server records suspension waiting time, and if the suspension waiting time exceeds preset time but the continuous and incremental request message of the message count value is not received yet, an error reply is returned to the client; if a request message is received with a message count value that is continuous and increasing or continuous and decreasing within a preset waiting time, the waiting time stops counting and returns to zero again.
When the client receives the error reply, the client needs to resend the request message with failed transmission, the resent request message is sent out by the client according to the request message with failed transmission when the client receives the returned error reply, and the message count value of the resent request message is updated according to the message count value of the request message with failed transmission, namely, the message count value of the resent request message is modified into the message count value of the request message with failed transmission; and after the retransmitted message arrives at the server, executing processing sequence judgment on the message count value of the retransmitted request message and the message count value of the request message which is sent but is being queued, so as to ensure that the server processes the request message according to the size ordering of the message count value.
The server receives the request message waiting to be processed and can store the request message waiting to be processed in a designated message storage container of the server, so that the request message waiting to be processed is prevented from being lost.
The server of the embodiment judges the processing sequence of the message count values of the request messages and sequentially processes the sent request messages according to the sequence of the message count values; the server can clear the message processing sequence, so that even the late message can be processed first; the method can be applied to the practical application environment with large message concurrency and message processing sequence, and can effectively prevent the condition that the request is invalid or wrong due to network delay under the multi-link network.
Example two
The embodiment provides a message processing system in a network delay state, and the system executes the message processing method in the network delay state; the system comprises a network module, a message preprocessing module and a message processing module.
The network module is used for receiving a request message sent by the client through the wireless/wired network, wherein the request message comprises a message count value; wherein, the client increases/decreases the message count value according to the sending sequence of the request message.
The message preprocessing module is used for analyzing the message count value of the sent request message, judging the processing sequence of the message count value, namely, in the process of comparing the message count value of the currently received request message with the message count value of the previously processed request message, if the message count value of the currently received request message is continuous and increment or continuous and decrement with the message count value of the previously processed request message, the message preprocessing module accords with the processing sequence, and then the currently received request message can be processed.
The message processing module is used for sequentially processing the sent request messages according to the ascending/descending order of the message count value, and simultaneously returning the processed request messages to the client side to inform the client side of the current message processing progress.
Example III
The embodiment provides an electronic device, which comprises a processor, a memory and a computer program stored on the memory and capable of running on the processor, wherein the processor is used for realizing a message processing method in a network delay state in the first embodiment when executing the computer program; in addition, a computer readable storage medium is provided, on which a computer program is stored, which when executed implements the above-described message processing method in a network delay state.
The apparatus and the storage medium in this embodiment and the method in the foregoing embodiments are based on two aspects of the same inventive concept, and the detailed description of the method implementation process has been given above, so those skilled in the art can clearly understand the structure and implementation process of the apparatus and the storage medium in this embodiment according to the foregoing description, and the details are omitted herein for brevity.
The above embodiments are only preferred embodiments of the present invention, and the scope of the present invention is not limited thereto, but any insubstantial changes and substitutions made by those skilled in the art on the basis of the present invention are intended to be within the scope of the present invention as claimed.

Claims (10)

1. A method for processing a message in a network delay state, comprising:
receiving a request message sent by a client, wherein the request message comprises a message count value; the client increases/decreases the message count value according to the sending sequence of the request message;
analyzing the message count value of the request message, judging the processing sequence of the message count value, and sequentially processing the sent request message according to the ascending/descending sequence of the message count value.
2. The method for processing messages in a network delay state according to claim 1, further comprising, after each processing of any one of the request messages:
and reading the message count value of the processed request message and replying the message count value to the client.
3. The method for processing messages in a network delay state according to claim 1, wherein the method for determining the processing order of the message count value is as follows:
comparing the message count value of the currently received request message with the message count value of the previously processed request message, and processing the currently required request message if the message count value of the currently received request message and the message count value of the previously processed request message are continuous and incremental or continuous and decremental.
4. A message processing method in a network delay state according to claim 3, wherein in the process of determining the processing order of the message count value, if the message count value of the currently received request message is not continuous with the message count value of the previously processed request message, the processing of the current request message is suspended, and the processing order of the next transmitted request message is continued until the request message of continuous and increasing or continuous and decreasing message count value is received.
5. The method according to claim 4, wherein a pause waiting time is recorded during the pause processing of the request message, and an error reply is returned to the client if the pause waiting time exceeds a preset time.
6. The method according to claim 5, wherein if the retransmitted request message is received, the retransmitted request message and the request message which has been transmitted but is being queued are subjected to processing sequence judgment again; and the retransmitted request message is sent out according to the request message with failed transmission when the client receives the returned error reply, and the message count value of the retransmitted request message is updated.
7. The message processing method in the network delay state according to claim 1, wherein a count limit value of the request message is set by a message concurrency amount of the client, and if the message count value of any one of the request messages reaches the set count limit value, the message count value is counted again.
8. A message processing system in a network delay state, wherein a message processing method in a network delay state according to any one of claims 1 to 7 is performed, the system comprising:
the network module is used for receiving a request message sent by the client, wherein the request message comprises a message count value; the client increases/decreases the message count value according to the sending sequence of the request message;
the message preprocessing module is used for analyzing the message count value of the request message and judging the processing sequence of the message count value;
and the message processing module is used for sequentially processing the sent request messages according to the ascending/descending order of the message count value.
9. An electronic device, comprising: a memory for storing a program; a processor for executing the program stored in the memory, the processor being configured to execute the message processing method in the network delay state according to any one of claims 1 to 7 when the program is executed.
10. A computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, which when run on one or more processors performs a message processing method in a network delay state according to any of claims 1 to 7.
CN202311128873.6A 2023-09-01 2023-09-01 A message processing method, system, equipment and medium in network delay state Pending CN117135125A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311128873.6A CN117135125A (en) 2023-09-01 2023-09-01 A message processing method, system, equipment and medium in network delay state

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311128873.6A CN117135125A (en) 2023-09-01 2023-09-01 A message processing method, system, equipment and medium in network delay state

Publications (1)

Publication Number Publication Date
CN117135125A true CN117135125A (en) 2023-11-28

Family

ID=88858052

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311128873.6A Pending CN117135125A (en) 2023-09-01 2023-09-01 A message processing method, system, equipment and medium in network delay state

Country Status (1)

Country Link
CN (1) CN117135125A (en)

Similar Documents

Publication Publication Date Title
US5754754A (en) Transmission order based selective repeat data transmission error recovery system and method
EP2978171A1 (en) Communication method, communication device, and communication program
US8788689B2 (en) Techniques for improved clock offset measuring
CN111404872A (en) Message processing method, device and system
CN109981385B (en) Method, device and system for realizing packet loss detection
CN108234087A (en) Data transmission method and transmitting terminal
JP2002217988A (en) Data distribution management device and data distribution management method
CN106506124A (en) Method and device for determining retransmission message
CN117560304B (en) Network state monitoring method, system, equipment and medium
CN111970092B (en) A method of asynchronous communication in multi-protocol redundant network supporting reliability adjustment
US10419369B2 (en) Method for operating a memory buffer system implemented at a sender station for the fast data transport over a communication network, correspondingly adapted apparatus to perform the method, computer program product, and computer program
CN113645008B (en) Message protocol timeout retransmission method and system based on linked list
CN117135125A (en) A message processing method, system, equipment and medium in network delay state
CN113612737A (en) Long message reliable transmission method based on grouping and retransmission mechanism
JP5636574B2 (en) COMMUNICATION DEVICE, PACKET TRANSFER METHOD AND ITS PROGRAM
CN114244785B (en) 5G data flow out-of-order processing method and device
CN114337938B (en) A data transmission method, data retransmission method, device and related equipment
CN117439713A (en) A reliable transmission method for radar data
CN117714324A (en) RDMA request overtime monitoring method and device
CN120110594A (en) Data confirmation transmission method, network device and storage medium
CN116366700A (en) A command transmission method, device, equipment and medium
CN115988110A (en) Inter-chip communication method and storage medium
JP2014147011A5 (en)
CN115396066B (en) Data packet retransmission method, device, equipment and storage medium
CN120017218B (en) Data frame receiving methods, apparatus, storage media, and wireless communication devices

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