CN111669431B - Message transmission method and device, computer equipment and storage medium - Google Patents

Message transmission method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111669431B
CN111669431B CN202010378175.1A CN202010378175A CN111669431B CN 111669431 B CN111669431 B CN 111669431B CN 202010378175 A CN202010378175 A CN 202010378175A CN 111669431 B CN111669431 B CN 111669431B
Authority
CN
China
Prior art keywords
message
sequence number
waiting
target
forwarded
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
Application number
CN202010378175.1A
Other languages
Chinese (zh)
Other versions
CN111669431A (en
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.)
Shenzhen Huarui Distributed Technology Co.,Ltd.
Original Assignee
Shenzhen Archforce Financial Technology 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 Shenzhen Archforce Financial Technology Co Ltd filed Critical Shenzhen Archforce Financial Technology Co Ltd
Priority to CN202010378175.1A priority Critical patent/CN111669431B/en
Publication of CN111669431A publication Critical patent/CN111669431A/en
Application granted granted Critical
Publication of CN111669431B publication Critical patent/CN111669431B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • 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
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1809Selective-repeat protocols
    • 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
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • H04L1/188Time-out mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/562Brokering proxy services

Landscapes

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

Abstract

The application relates to a message transmission method, a message transmission device, computer equipment and a storage medium. The method comprises the following steps: when a message to be forwarded is received, acquiring a message serial number corresponding to the message to be forwarded; comparing the message serial number with a target serial number to obtain a comparison result; when the comparison result is that the message sequence number is larger than the target sequence number, acquiring a current waiting set comprising at least one waiting sequence number; matching the message serial number with the waiting serial number, and determining a target waiting set to which the message serial number belongs according to a matching result; and when the target waiting set meets the sending condition, sequentially sending the messages to be forwarded corresponding to the waiting sequence number in the target waiting set to a receiving end. By adopting the method, the transmission efficiency of the message can be effectively improved while the transmission sequence of the message is ensured.

Description

Message transmission method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a message transmission method, an apparatus, a computer device, and a storage medium.
Background
With the development of computer technology, the application scenarios of message transmission technology are increasing day by day, and the requirements for message transmission capability are also continuously increasing. The message may be lost due to network failure, and the like, and the message loss is an important factor that causes the message transmission capability to be low. Therefore, the lost message is usually obtained by retransmission, so as to avoid the influence caused by message loss.
For an application scenario with a message order requirement, in a conventional manner, messages are generally required to be transmitted in an ordered manner. When a message loss occurs, it is necessary to wait for retransmission of the lost message before sequentially processing the next message, which results in a reduction in the transmission efficiency of the message.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a message transmission method, a message transmission apparatus, a computer device, and a storage medium, which can improve message transmission efficiency while ensuring message transmission order.
A method of message transmission, the method comprising:
when a message to be forwarded is received, acquiring a message serial number corresponding to the message to be forwarded;
comparing the message serial number with a target serial number to obtain a comparison result;
when the comparison result is that the message sequence number is larger than the target sequence number, acquiring a current waiting set comprising at least one waiting sequence number;
matching the message serial number with the waiting serial number, and determining a target waiting set to which the message serial number belongs according to a matching result;
and when the target waiting set meets the sending condition, sequentially sending the messages to be forwarded corresponding to the waiting sequence number in the target waiting set to a receiving end.
In one embodiment, after the comparing result is that the message sequence number is greater than the target sequence number, the method further includes:
detecting whether a waiting set exists;
and when the waiting set does not exist, marking the target sequence number and the sequence number between the target sequence number and the message sequence number as waiting sequence numbers, and generating the waiting set according to the waiting sequence numbers.
In one embodiment, after the matching the message sequence number with the waiting sequence number, the method further comprises:
and when the message sequence number is not matched with any one of the waiting sequence numbers and the message sequence number is not continuous, generating a next waiting set according to the maximum waiting sequence number in the current waiting set and the message sequence number.
In one embodiment, the method further comprises:
generating a retransmission request according to the waiting sequence number in the waiting set;
and sending the retransmission request to a sending end, and receiving a retransmission message sent by the sending end according to the retransmission request.
In one embodiment, after the comparing result is that the message sequence number is greater than the target sequence number, the method further includes:
obtaining cache data, wherein the cache data comprises a cache serial number corresponding to a cache message;
matching the message sequence number with the cache sequence number;
and when the message sequence number is not matched with any one of the cache sequence numbers, marking the message sequence number as a cache sequence number, and caching the message to be forwarded.
In one embodiment, the sequentially sending the messages to be forwarded corresponding to the waiting sequence number in the target waiting set to a receiving end when the target waiting set meets the sending condition includes:
when the sending condition comprises a time threshold, monitoring the waiting time corresponding to the target waiting set;
when the waiting time corresponding to the target waiting set reaches the time threshold, determining a sequence number to be forwarded in the target waiting set according to the target sequence number;
and acquiring target forwarding messages corresponding to the sequence number to be forwarded, sequentially sending the target forwarding messages to the receiving end, and updating the target sequence number according to a sending result.
In one embodiment, after comparing the message sequence number with the target sequence number to obtain a comparison result, the method further includes:
when the comparison result is that the message sequence number is equal to the target sequence number, acquiring a continuous sequence number continuous with the message sequence number;
determining the message to be forwarded and the continuous messages corresponding to the continuous sequence numbers as target forwarding messages;
and sequentially sending the target forwarding messages to the receiving end, and updating the target sequence number according to the sending result.
In one embodiment, the comparing the message sequence number with the target sequence number includes:
acquiring a current channel corresponding to the message to be forwarded;
comparing the current channel with a previous channel corresponding to a previous message to be forwarded;
when the current channel is inconsistent with the previous channel, acquiring transmission information associated with the current channel, wherein the transmission information comprises a target serial number;
and comparing the target sequence number corresponding to the current channel with the message sequence number.
A message transmission apparatus, the apparatus comprising:
the serial number comparison module is used for acquiring a message serial number corresponding to a message to be forwarded when the message to be forwarded is received; comparing the message serial number with a target serial number to obtain a comparison result;
a waiting set matching module, configured to obtain a current waiting set including at least one waiting sequence number when the comparison result indicates that the message sequence number is greater than the target sequence number; matching the message serial number with the waiting serial number, and determining a target waiting set to which the message serial number belongs according to a matching result;
and the message transmission module is used for sequentially transmitting the messages to be forwarded corresponding to the waiting sequence numbers in the target waiting set to a receiving end when the target waiting set meets the transmitting condition.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the above message transmission method when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned message transmission method.
According to the message transmission method, the message transmission device, the computer equipment and the storage medium, when the message to be forwarded is received, the message serial number corresponding to the message to be forwarded is obtained, the message serial number is compared with the target serial number, and when the message serial number is larger than the target serial number according to the comparison result, the message to be forwarded can be determined to have a lost message. The message sequence number and the waiting sequence number are matched by acquiring a current waiting set comprising at least one waiting sequence number, and the current waiting set to which the waiting sequence number belongs is determined to be a target waiting set to which the message sequence number belongs according to a matching result. When the target waiting set meets the sending condition, the message to be forwarded corresponding to the waiting sequence number in the target waiting set is sent to the receiving end in sequence, and the waiting set is used for processing a plurality of messages to be forwarded in parallel without accumulating the time delay of waiting for retransmission, so that the message transmission sequence is ensured, and the message transmission efficiency is effectively improved.
Drawings
FIG. 1 is a diagram of an application environment of a message transmission method in one embodiment;
FIG. 2 is a flow diagram illustrating a method for message transmission in one embodiment;
FIG. 3 is a flowchart illustrating the steps of comparing a message sequence number to a target sequence number in one embodiment;
FIG. 4 is a flow chart illustrating a message transmission method according to another embodiment;
FIG. 5 is a flow chart illustrating a message transmission method according to another embodiment;
FIG. 6 is a block diagram showing the structure of a message transmission apparatus according to an embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The message transmission method provided by the application can be applied to the application environment shown in fig. 1. The forwarding server 104 communicates with the sending end 102 and the receiving end 106 via a network. Sender 102 and receiver 104 are message senders and receivers as compared to forwarding server 104. Sender 102 sends the message to be forwarded to forwarding server 104. When the forwarding server 104 receives a message to be forwarded sent by the sending end 102, the forwarding server 104 obtains a message sequence number corresponding to the message to be forwarded. And the forwarding server compares the message serial number with the target serial number to obtain a comparison result. When the comparison result is that the message sequence number is greater than the target sequence number, the forwarding server 104 obtains a current waiting set including at least one waiting sequence number. The forwarding server 104 matches the message sequence number with the waiting sequence number, and determines a target waiting set to which the message sequence number belongs according to a matching result. When the target waiting set meets the sending condition, the forwarding server 104 sends the messages to be forwarded corresponding to the waiting sequence numbers in the target waiting set to the receiving end 106 in sequence. The forwarding server 104 may be one of a variety of servers. The sender 102 and the receiver 106 may specifically be terminals, and may also be servers. The terminal can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices, and the server can be implemented by an independent server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, a message transmission method is provided, which is described by taking the method as an example applied to the forwarding server 104 in fig. 1, and includes the following steps:
step 202, when receiving the message to be forwarded, obtaining a message sequence number corresponding to the message to be forwarded.
The message to be forwarded refers to a message which is sent by a sending end and needs to be forwarded to a receiving end by a forwarding server. The message to be forwarded may include a plurality of messages, where a plurality refers to two or more than two. In different application scenarios, the message content of the message to be forwarded may be different. For example, in the field of transactions, messages to be forwarded may include market by market messages. The market information refers to a single message in the transaction process, and the transaction information may specifically include, but is not limited to, an entrusting message, a transaction message, and the like.
The forwarding server (hereinafter referred to as "server") may receive a message to be forwarded, which is sent by a sending end through a gateway, through a communication connection established based on a communication protocol with the sending end. The sending end may specifically be a terminal, and may also be a server. For example, in the field of transaction, the sending end may specifically be a server corresponding to the transaction. The sending end can send a large amount of generated messages to be forwarded to the server, so that the server sends the messages to be forwarded to the receiving end in sequence, and the accuracy of the message sequence received by the receiving end is guaranteed.
When the server receives the message to be forwarded sent by the sending end, the server can traverse the received message to be forwarded and process the received message to be forwarded. Specifically, the server may obtain a message sequence number corresponding to the message to be forwarded. The message to be forwarded may be a message generated by the sending end according to a Communication Protocol (Communication Protocol) with the server, and the Communication Protocol may include a numbering policy corresponding to the message to be forwarded. The server can analyze the message to be forwarded according to the communication protocol to obtain a message serial number corresponding to the message to be forwarded. The communication Protocol may specifically be TCP/IP (Transmission Control Protocol/Internet Protocol ), UDP (User Datagram Protocol, User Datagram Protocol), or the like. The message sequence number refers to the number of the message to be forwarded in the message sequence, and the message sequence number can uniquely mark the message to be forwarded and the position of the message to be forwarded in the message sequence. The message sequence number may specifically comprise numbers, letters, or special symbols, etc.
And step 204, comparing the message serial number with the target serial number to obtain a comparison result.
The target sequence number refers to a sequence number corresponding to a message which needs to be transmitted currently in a message sequence. The server may determine the target sequence number according to a transmission result corresponding to the message to be forwarded. Specifically, the server may determine, according to a numbering policy corresponding to the message to be forwarded, a next sequence number corresponding to a last message that has been sequentially sent. The next sequence number may indicate a sequence number of a message currently required to be transmitted according to the numbering order after the server sends the last message, and the server may mark the next sequence number corresponding to the last sent message as the target sequence number. In one embodiment, after the server sends the message to the receiving end, the target sequence number may be updated according to the message sequence number corresponding to the sent message.
The server can compare the message serial number corresponding to the received message to be forwarded with the target serial number to obtain a comparison result. The sequence number may represent a position of a corresponding message in the message sequence, and the server may determine a position of the message sequence number compared to the target sequence number by comparing the message sequence number with the target sequence number. Specifically, the sequence number includes a number used for representing the sequence, and the server may compare the size relationship between the message sequence number and the target sequence number to obtain a comparison result. The comparison result between the message sequence number and the target sequence number may be one of the message sequence number being smaller than the target sequence number, the message sequence number being equal to the target sequence number, or the message sequence number being larger than the target sequence number.
It is understood that when the message sequence number is smaller than the target sequence number, it may indicate that the message to be forwarded received by the server is an already sent message. When the message sequence number is equal to the target sequence number, the message to be forwarded received by the server can be represented as a message which needs to be transmitted currently. When the message sequence number is greater than the target sequence number, it may indicate that the message to be forwarded received by the server is a message that needs to be transmitted currently and is preceded by a message that at least includes a message corresponding to the target sequence number.
And step 206, when the comparison result is that the message sequence number is greater than the target sequence number, acquiring a current waiting set comprising at least one waiting sequence number.
And the server compares the message serial number with the target serial number to obtain a comparison result between the message serial number and the target serial number. And when the comparison result between the message sequence number and the target sequence number is that the message sequence number is greater than the target sequence number, indicating that the target sequence number and the message corresponding to the sequence number between the target sequence number and the message sequence number are lost. The server may obtain a current wait set including at least one wait sequence number. Wherein, the current waiting set refers to a currently existing sequence number set comprising one or more waiting sequence numbers. The current waiting set may include one or more, or there may be no current waiting set. There is no intersection between multiple current waiting sets. The waiting sequence number refers to a sequence number corresponding to a lost message determined by the server according to a message sequence number corresponding to a received message to be forwarded in the message transmission process. When a current waiting set exists, the current waiting set may include at least the target sequence number.
In one embodiment, after determining that the comparison result is that the message sequence number is greater than the target sequence number, the server may detect whether a waiting set currently exists. Specifically, the waiting set may be a set of sequence numbers that the server generates according to the sequence numbers corresponding to the lost messages and is currently waiting for message retransmission. The server may detect whether there are currently waiting sets waiting for retransmission of the message, and when there are one or more waiting sets, the server may acquire the currently existing one or more waiting sets, and register the currently existing waiting set as the current waiting set. When the waiting set does not exist, the server can take the target sequence number and the sequence number between the target sequence number and the message sequence number as waiting sequence numbers, and the message corresponding to the waiting sequence numbers is a lost message. The server may generate a waiting set according to the waiting sequence number, and wait for the sending end to retransmit a message corresponding to the waiting sequence number.
For ease of illustration, the various embodiments may be illustrated with simple numbers representing serial numbers. It can be understood that, in the actual application process, the serial number can be set according to the actual application requirement. For example, the server may send the messages to be forwarded to the receiver according to a message sequence order, and the message sequence may be represented as "0, 1, 2, 3 … …". After the server has sent the message to be forwarded with message sequence numbers "0", "1", and "2", it may be determined that the target sequence number corresponding to the message that needs to be forwarded is "3". When receiving the message to be forwarded, the server may obtain a message sequence number corresponding to the message to be forwarded. For example, the message sequence number is denoted as "7". And after the server compares the message sequence number with the target sequence number, determining that the message sequence number '7' is greater than the target sequence number '3'. The server may detect whether there is currently a waiting set. When there is a waiting set, the server may acquire the waiting set as the current waiting set. When there is no waiting set, the server may determine that the messages corresponding to sequence numbers "3" to "6" are lost messages. The server can cache the message to be forwarded corresponding to the message sequence number, and record the target sequence number "3" and the sequence number between the target sequence number and the message sequence number as the waiting sequence number, and generate a waiting set according to the waiting sequence number. The wait sequence numbers in the wait set may specifically include "3", "4", "5", and "6".
And 208, matching the message sequence number with the waiting sequence number, and determining a target waiting set to which the message sequence number belongs according to a matching result.
The server can read the waiting sequence number included in the obtained current waiting set, match the message sequence number corresponding to the message to be forwarded with the waiting sequence number, and determine the target waiting set to which the message sequence number belongs according to the matching result. Specifically, when the server obtains a current waiting set, the server may match the message sequence number with a waiting sequence number included in the current waiting set, and determine whether the message sequence number matches any one waiting sequence number in the current waiting set. When the message sequence number is matched with any one waiting sequence number in the current waiting set, it is determined that the message sequence number belongs to the current waiting set, and the server may mark the current waiting set as a target waiting set, which indicates that the message to be forwarded corresponding to the message sequence number is a lost message retransmitted by the sending end on which the server is waiting.
When the server obtains a plurality of current waiting sets, the server may match the waiting sequence numbers included in the plurality of current waiting sets with the message sequence numbers, respectively, and the server may mark the current waiting set to which the waiting sequence number matched with the message sequence number belongs as a target waiting set, indicating that the message to be forwarded corresponding to the message sequence number is a lost message waiting for retransmission corresponding to the target waiting set.
And step 210, when the target waiting set meets the sending condition, sequentially sending the messages to be forwarded corresponding to the waiting sequence numbers in the target waiting set to a receiving end.
The server may monitor whether the target waiting set meets the sending condition, and when the target waiting set meets the sending condition, the server may send the target waiting set including the message to be forwarded corresponding to the waiting sequence number to the receiving end in sequence. Specifically, the transmission condition may specifically be a transmission time condition, or a transmission message condition, or the like. When the target waiting set meets the sending condition, the server may obtain the cached message to be forwarded corresponding to the waiting sequence number according to the waiting sequence number included in the target waiting set. The server can send the sequence of the messages to be forwarded to the receiving end according to the sequence of the sequence numbers corresponding to the waiting sequence numbers.
In one embodiment, when there are multiple waiting sets, the server may monitor whether the multiple waiting sets meet the sending condition in parallel. When any waiting set in the waiting sets meets the sending condition, the server sends the messages to be forwarded corresponding to the waiting set to the receiving end in sequence, and accumulation of retransmission delay is avoided by waiting for retransmission messages corresponding to the waiting sets in parallel, so that the transmission efficiency of the messages is effectively improved.
It can be understood that, in the conventional manner, in order to ensure the transmission order of the messages, when a lost message occurs, it is necessary to wait for the sender to retransmit the lost message, and when the retransmitted message is received or the wait time expires, the next message will be processed. When there are multiple lost messages in sequence, the time for the terminal to retransmit the lost message in the traditional mode needs to be accumulated. In this embodiment, the server may determine whether the message to be forwarded is a retransmission message or a missing message according to the message sequence number corresponding to the received message to be forwarded. When the lost message occurs, the server can process the subsequent message to be forwarded while waiting for the message to be retransmitted, and the time for waiting for the message to be retransmitted does not need to be accumulated, so that the transmission efficiency of the message is effectively improved on the premise of ensuring the transmission sequence of the message.
In this embodiment, when the server receives the message to be forwarded, the server obtains a message sequence number corresponding to the message to be forwarded, compares the message sequence number with the target sequence number, and determines whether the message to be forwarded is a message sent in the current sequence. And when the comparison result shows that the message sequence number is larger than the target sequence number, determining that the lost message exists before the message sequence number. The server matches the message sequence number with the waiting sequence number by acquiring a current waiting set comprising at least one waiting sequence number, and judges whether the message to be forwarded corresponding to the message sequence number is a waiting retransmission message corresponding to the current waiting set. The server can determine a target waiting set to which the message sequence number belongs according to the matching result, and when the target waiting set meets the sending condition, sequentially send the messages to be forwarded corresponding to the waiting sequence number in the target waiting set to the receiving end. By parallel processing of the received messages to be forwarded, when the messages corresponding to the waiting sequence number in the waiting set are retransmitted, the messages to be forwarded which are subsequently received can be continuously processed, the time delay of waiting for retransmission does not need to be accumulated, the message cache pressure is reduced, and the message transmission sequence is ensured, and meanwhile, the message transmission efficiency is effectively improved.
In an embodiment, as shown in fig. 3, the step of comparing the message sequence number with the target sequence number includes:
step 302, a current channel corresponding to the message to be forwarded is obtained.
Step 304, comparing the current channel with the previous channel corresponding to the previous message to be forwarded.
Step 306, when the current channel is inconsistent with the previous channel, obtaining transmission information associated with the current channel, wherein the transmission information includes a target sequence number.
Step 308, comparing the target sequence number corresponding to the current channel with the message sequence number.
After receiving the message to be forwarded, the server may obtain a message sequence number corresponding to the message to be forwarded, and determine whether the received message to be forwarded is a message that needs to be sequentially forwarded currently according to a comparison result by comparing the message sequence number with the target sequence number. Specifically, when a plurality of communication channels exist between the server and the sending end, after receiving the message to be forwarded, the server may obtain a current channel corresponding to the message to be forwarded. The current channel is also called a current communication channel, and refers to a communication channel used by the sending end to send the message to be forwarded to the server. The message transmission by the server for different communication channels may be different.
The server can compare the current channel with the previous channel corresponding to the previous message to be forwarded, and determine whether a communication channel for transmitting the message between the sending end and the server is switched. When the current channel is consistent with the previous channel, it is determined that the communication channel between the sending end and the server is not switched, and the server can continue to process the message to be forwarded. When the current channel is inconsistent with the previous channel, it is determined that the communication channel between the sending end and the server is switched, and the server can acquire the transmission information associated with the current channel. The server can set transmission information according to the correspondence of each of the plurality of communication information, and the transmission information is uniquely associated with the communication channel.
In one embodiment, when the current channel is switched, the server may sequentially send the messages to be forwarded in the current sending queue to the receiving end, so as to sequentially send the messages to be forwarded transmitted by different communication channels in sequence.
The transmission information may include a target sequence number that needs to be sequentially transmitted currently, and the server may obtain the target sequence number corresponding to the current channel from the transmission information corresponding to the current channel. The corresponding target sequence numbers may be different in the transmission information corresponding to different communication channels. The server can compare the target sequence number corresponding to the current channel with the message sequence number, and determine whether the message to be forwarded corresponding to the message sequence number is the message currently transmitted in sequence according to the comparison result between the target sequence number and the message sequence number.
In this embodiment, the server obtains the current channel corresponding to the message to be forwarded, compares the current channel with the previous channel corresponding to the previous message to be forwarded, obtains the target sequence number corresponding to the current channel and compares the message sequence number when the current channel is inconsistent with the previous channel, distinguishes a plurality of communication channels between the sending end and the server, and compares the target sequence number corresponding to the current channel with the message sequence number, thereby identifying the sequence position of the message to be forwarded in the message sequence of the corresponding channel, and effectively improving the accuracy of identifying and transmitting the message transmitted by the plurality of communication channels.
In an embodiment, as shown in fig. 4, after the step of comparing the message sequence number with the target sequence number to obtain a comparison result, the method further includes:
and 402, when the message sequence number is equal to the target sequence number according to the comparison result, acquiring a continuous sequence number continuous to the message sequence number.
Step 404, determining the message to be forwarded and the continuous message corresponding to the continuous sequence number as the target forwarding message.
And step 406, sequentially sending the target forwarding messages to the receiving end, and updating the target sequence number according to the sending result.
And the server compares the message serial number with the target serial number to obtain a comparison result between the message serial number and the target serial number. And when the comparison result shows that the message sequence number is equal to the target sequence number, the message sequence number is consistent with the target sequence number, and the message to be forwarded corresponding to the message sequence number is the message which should be transmitted in sequence at present according to the message sequence. The server may obtain the cache data, which means that when the server determines that the message to be forwarded is not the message transmitted in the current sequence corresponding to the target sequence number after receiving the message to be forwarded sent by the sending end, the server may cache the received message to be forwarded to obtain the cache data. The cache data may specifically include the received cache message cached by the server and a cache sequence number corresponding to the cache message. For example, when the target sequence number is "4", the server receives the message to be forwarded with the message sequence number of "6", and the server may cache the message to be forwarded, so as to subsequently send the message to be forwarded to the receiving end.
The server may count a cache sequence number corresponding to the cache message in the cache data. In one embodiment, the server may generate a cache sequence number list according to the cache sequence numbers and the order between the cache sequence numbers, so as to determine the cache messages included in the cache data according to the cache sequence numbers. The server may retrieve from the buffered data a consecutive sequence number consecutive to the message sequence number.
For example, when the target sequence number is "4" and the server receives the message to be forwarded with the message sequence numbers of "5" and "6", respectively, the server may cache the received message to be forwarded with the message sequence numbers of "5" and "6", respectively. The server may continue to receive the message to be forwarded sent by the sending end, determine that the message sequence number is the same as the target sequence number when the message sequence number corresponding to the message to be forwarded is "4", and the server may obtain, from the cache data, consecutive sequence numbers "5" and "6" that are consecutive to the message sequence number.
The server may obtain continuous messages corresponding to the continuous sequence numbers from the buffered data, and record the received messages to be forwarded and the continuous messages as target forwarding messages. The server can put the target forwarding messages into the sending queue, and after traversal of the messages to be forwarded is finished, the target forwarding messages in the sending queue are sequentially sent to the receiving end according to the sequence number sequence among the target forwarding messages. The server may update the target sequence number according to the transmission result. Specifically, the server may determine a next sequence number corresponding to a last message sequence number in the sent message as the target sequence number. For example, after the server transmits to the receiving end a message to be forwarded having a message sequence number ("4") equal to the target sequence number and consecutive messages corresponding to consecutive sequence numbers ("5" and "6") consecutive to the message sequence number, the server may determine a sequence number "7" as the target sequence number according to the transmission result.
In this embodiment, when the message sequence number is equal to the target sequence number, the consecutive sequence numbers consecutive to the message sequence number are obtained, the target forwarding message is sequentially sent to the receiving end by determining the message to be forwarded and the consecutive messages corresponding to the consecutive sequence numbers as the target forwarding message, and the target sequence number is updated according to the sending result.
In one embodiment, when the comparison result is that the message sequence number is smaller than the target sequence number, it indicates that the message to be forwarded is a message that has been sent or waits for retransmission timeout. In order to ensure the transmission sequence of the messages, the messages to be forwarded with the message sequence numbers smaller than the target sequence number are unnecessary messages, the server can delete the messages to be forwarded corresponding to the message sequence numbers smaller than the target sequence number, the unnecessary messages do not need to be cached, and the message caching pressure is effectively reduced.
In an embodiment, after the step of comparing when the message sequence number is greater than the target sequence number, the method further includes: obtaining cache data, wherein the cache data comprises a cache serial number corresponding to the cache message; matching the message sequence number with the cache sequence number; and when the message sequence number is not matched with any cache sequence number, the message sequence number is marked as the cache sequence number, and the message to be forwarded is cached.
After the server determines that the message sequence number is greater than the target sequence number as a result of the comparison between the message sequence number and the target sequence number, the server may determine that the message to be forwarded corresponding to the message sequence number is temporarily not a message that needs to be sequentially transmitted currently. The server may obtain cache data, where the cache data includes a cache message after the target sequence number received by the server and a cache sequence number corresponding to the cache message. The server can match the cache sequence number in the cache data with the message sequence number and judge whether the message sequence number is consistent with any cache sequence number.
And when the message sequence number is not matched with any cache sequence number in the cache data, the message to be forwarded corresponding to the message sequence number is not cached in the cache data. The server may record the message sequence number as a cache sequence number, and cache the message to be forwarded corresponding to the message sequence number, so as to sequentially send the cache message in the cache data to the receiving end.
In one embodiment, when the message sequence number matches any one of the cache sequence numbers in the cache data, it indicates that the cache data includes a message consistent with the message to be forwarded, that is, the server repeatedly receives the message to be forwarded corresponding to the message sequence number. The server can delete the message to be forwarded, thereby effectively reducing the message caching pressure.
In this embodiment, when the message sequence number is greater than the target sequence number, it is determined that the message to be forwarded corresponding to the message sequence number is not the message sent in the current sequence temporarily, and the server may cache the message to be forwarded, so as to send the cached message to be forwarded to the receiving end subsequently. The server compares the cache serial number with the message serial number by acquiring the cache serial number included in the cache data, and caches the message to be forwarded when the message serial number is not matched with any one cache serial number, so that repeated caching of the message to be forwarded is avoided, and the message cache pressure is effectively reduced.
In one embodiment, after the matching the message sequence number with the waiting sequence number, the method further includes: and when the message sequence number is not matched with any waiting sequence number and the message sequence number is not continuous with the waiting sequence number, generating a next waiting set according to the maximum waiting sequence number and the message sequence number in the current waiting set.
After caching the message to be forwarded corresponding to the message serial number greater than the target serial number, the server may obtain the current waiting set, and match the waiting serial number in the current waiting set with the message serial number to obtain a matching result. When the message sequence number matches any one of the waiting sequence numbers in the current waiting set, the server may determine that the message sequence number belongs to the current waiting set to which the matching waiting sequence number belongs. When the message sequence number does not match any waiting sequence number and the message sequence number is not continuous, the server can generate a next waiting set according to the maximum waiting sequence number and the message sequence number in the current waiting set.
Specifically, the server may match the message sequence number with the plurality of waiting sequence numbers one by one to obtain a matching result. The server may further obtain a maximum waiting sequence number of the plurality of waiting sequence numbers, and the server may compare the maximum waiting sequence number with a last sequence number corresponding to the message sequence number. When the maximum waiting sequence number is smaller than the last sequence number corresponding to the message sequence number, the server may determine that the message sequence number is not matched with any one of the waiting sequence numbers, and the message sequence number is not consecutive with any one of the waiting sequence numbers. The server can quickly judge whether the message sequence number is continuous with any waiting sequence number by comparing the maximum waiting sequence number with the last sequence number corresponding to the message sequence number, thereby effectively improving the sequential transmission efficiency of the message.
When the maximum waiting sequence number is smaller than the last sequence number corresponding to the message sequence number, the server may mark, as the waiting sequence number, the next sequence number corresponding to the maximum waiting sequence number in the current waiting set, the last sequence number corresponding to the message sequence number, and the sequence numbers therebetween, and generate the next waiting set according to the waiting sequence number between the next sequence number corresponding to the maximum waiting sequence number and the last sequence number corresponding to the message sequence number. It is to be understood that the next waiting set is relative to the current waiting set, and the server may generate one or more waiting sets according to the relationship between the received message to be forwarded and the waiting sets. The waiting set represents a set of sequence numbers corresponding to messages that have been lost.
For example, the target sequence number may be represented as "4", the current waiting set may include "4", "5", "6", and "7", and the server may receive the message to be forwarded sent by the sender, when the message sequence number corresponding to the message to be forwarded is "11". The server may obtain the largest waiting sequence number "7" in the current waiting set after determining that the message sequence number "11" is greater than the target sequence number "4". The server may compare the maximum sequence number "7" with the last sequence number "10" corresponding to the message sequence number, and determine that the maximum sequence number "7" is less than the last sequence number "10" corresponding to the message sequence number. The server may determine that the next sequence number "8" corresponding to the largest sequence number, the last sequence number "10" corresponding to the message sequence number, and the sequence numbers in between are the waiting sequence numbers, and determine that the message corresponding to the waiting sequence number is a lost message. The server may generate a waiting set without intersection with the current waiting set according to the waiting sequence number, and wait for the sending end to retransmit a message corresponding to the waiting sequence number.
In one embodiment, the waiting sequence number may represent a sequence number corresponding to a lost message, and the server may generate a retransmission request according to the waiting sequence number in the waiting set, send the retransmission request to the sending end, and wait for the sending end to send a corresponding retransmission message according to the retransmission request. Specifically, when the server determines that the message sequence number is greater than the target sequence number and that the waiting set does not exist currently, the server may determine that the target sequence number and the sequence number between the target sequence number and the message sequence number are sequence numbers corresponding to lost messages. The server may record the sequence number corresponding to the lost message as the waiting sequence number. The server may generate a retransmission request according to the waiting sequence number, and send the retransmission request to the sending end.
When the server determines that the message sequence number is not matched with any current waiting sequence number and determines that the message sequence number is not continuous with the waiting sequence number, the server can determine a sequence number between the maximum waiting sequence number in the current waiting set and the message sequence number as the waiting sequence number. The server can generate a retransmission request according to the waiting sequence number and send the retransmission request to the sending end, so that lost messages sent again by the sending end according to the retransmission request are received, the influence caused by message loss is avoided, and the accuracy of message transmission is effectively improved.
In this embodiment, when the message sequence number is not matched with any one of the waiting sequence numbers and the message sequence number is not consecutive, a next waiting set is generated according to the largest waiting sequence number in the current waiting set and the message sequence number, and when a server is lost, a plurality of waiting sets are generated according to a received message, and a sending end is waited to retransmit the lost message in parallel, without accumulating the time delay of waiting for retransmission, so that the message transmission sequence is ensured, and the message sequential transmission efficiency is effectively improved.
In an embodiment, the step of sequentially sending the messages to be forwarded corresponding to the waiting sequence numbers in the target waiting set to the receiving end when the target waiting set meets the sending condition includes: when the sending condition comprises a time threshold, monitoring the waiting time corresponding to the target waiting set; when the waiting time corresponding to the target waiting set reaches a time threshold, determining a serial number to be forwarded in the target waiting set according to the target serial number; and acquiring target forwarding messages corresponding to the sequence numbers to be forwarded, sequentially sending the target forwarding messages to a receiving end, and updating the target sequence numbers according to the sending results.
The sending condition corresponding to the waiting set may specifically include that the waiting time reaches a time threshold. When the server generates a waiting set, the server may determine a time threshold corresponding to the waiting set according to the waiting set. The time threshold may represent a waiting duration of a message corresponding to a waiting sequence number included in the waiting set for retransmission by the sending end. The server may record the waiting time corresponding to the waiting set from the time of generating the waiting set through a timer, and when the waiting time reaches a time threshold, the server may determine that the waiting set meets the sending condition. The waiting duration corresponding to the waiting set may be fixed. For example, the waiting time period may be a fixed time length preset according to the actual application requirement. The wait period may also vary. For example, the server may determine the waiting duration corresponding to the waiting set according to the number of waiting sequence numbers included in the waiting set, and the waiting durations corresponding to waiting sets including different numbers of waiting sequence numbers may be different. The server may determine the time threshold corresponding to the waiting set according to the time for generating the waiting set and the waiting duration corresponding to the waiting set.
The server may monitor the waiting time corresponding to the waiting set from the generation of the waiting set. The server may monitor the waiting time corresponding to the target waiting set corresponding to the message to be forwarded. And when the waiting time corresponding to the waiting set reaches a time threshold, determining that the target waiting set meets the sending condition. The server may determine the sequence number to be forwarded in the target waiting set according to the target sequence number. Specifically, the server may record a waiting sequence number in the target waiting set, which is a sequence number after the target sequence number, as the sequence number to be forwarded. The server may obtain the target forwarding message corresponding to the sequence number to be forwarded from the buffered data.
In one embodiment, the server may further obtain, from the buffered data, a consecutive sequence number consecutive to the sequence number to be forwarded and consecutive messages corresponding to the consecutive sequence number, and the server may record, as the sequence number to be forwarded, the consecutive sequence number consecutive to the sequence number to be forwarded. The manner of obtaining the continuous sequence number continuous with the sequence number to be forwarded is similar to the manner of obtaining the continuous sequence number continuous with the message sequence number in the above embodiment, and therefore, the details are not repeated herein. By sequentially sending the target forwarding message and the continuous messages to the receiving end together, the cache serial number does not need to be compared with the target serial number one by one, so that unnecessary comparison operation is reduced, and the sequential transmission efficiency of the messages is effectively improved.
The server can send the corresponding target forwarding message sequence to the receiving end according to the sequence number sequence among the serial numbers to be forwarded. The server may update the target sequence number according to the transmission result. Specifically, the server may obtain a message sequence number corresponding to the last target forwarding message in the sent target forwarding messages, and update the target sequence number to a next sequence number corresponding to the last message sequence number that has been sent.
In this embodiment, the server monitors the waiting time corresponding to the target waiting set, determines the sequence number to be forwarded according to the target sequence number when the waiting time reaches a time threshold, sequentially sends the target forwarding message corresponding to the sequence number to be forwarded to the receiving end, and updates the target sequence number according to the sending result. When a plurality of waiting sets appear according to the message loss condition, the server can monitor the waiting time corresponding to each of the waiting sets in parallel, and the waiting time corresponding to the waiting sets does not need to be accumulated, so that the message sequential transmission efficiency is effectively improved.
In one embodiment, as shown in fig. 5, there is provided a message transmission method including the steps of:
step 502, when receiving the message to be forwarded, obtaining a message sequence number corresponding to the message to be forwarded.
Step 504, obtaining a current channel corresponding to the message to be forwarded; and comparing the current channel with the previous channel corresponding to the previous message to be forwarded.
Step 506, when the current channel is inconsistent with the previous channel, obtaining transmission information associated with the current channel, wherein the transmission information comprises a target sequence number.
Step 508, compare the target sequence number corresponding to the current channel with the message sequence number. When the message sequence number is equal to the target sequence number, step 510 is performed. When the message sequence number is less than the target sequence number, step 516 is performed. When the message sequence number is greater than the target sequence number, step 518 is performed.
At step 510, a consecutive sequence number is obtained that is consecutive to the message sequence number.
Step 512, determining the message to be forwarded and the continuous message corresponding to the continuous sequence number as the target forwarding message.
And 514, sequentially sending the target forwarding messages to the receiving end, and updating the target sequence number according to the sending result.
And step 516, deleting the message to be forwarded.
Step 518, obtaining cache data, wherein the cache data comprises a cache serial number corresponding to the cache message; and judging whether the message sequence number is matched with any cache sequence number. If not, go to step 520. If yes, go to step 516.
Step 520, recording the message sequence number as a buffer sequence number, and buffering the message to be forwarded.
At step 522, it is checked whether there is a waiting set. If not, go to step 524. If so, go to step 526.
Step 524, the target sequence number and the sequence number between the target sequence number and the message sequence number are recorded as waiting sequence numbers, and a waiting set is generated according to the waiting sequence numbers.
Step 526, obtaining a current waiting set including at least one waiting sequence number; it is determined whether the message sequence number matches any of the waiting sequence numbers. If not, go to step 528. If yes, go to step 530.
Step 528, generate the next waiting set according to the maximum waiting sequence number and the message sequence number in the current waiting set.
Step 530, determining a target waiting set to which the message sequence number belongs; and when the sending condition comprises a time threshold, monitoring the waiting time corresponding to the target waiting set.
Step 532, when the waiting time corresponding to the target waiting set reaches the time threshold, determining the sequence number to be forwarded in the target waiting set according to the target sequence number.
Step 534, obtaining the target forwarding message corresponding to the serial number to be forwarded, sequentially sending the target forwarding message to the receiving end, and updating the target serial number according to the sending result.
It should be understood that although the various steps in the flow charts of fig. 2-5 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-5 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 6, there is provided a message transmission apparatus including: a sequence number comparison module 602, a waiting set matching module 604, and a message transmission module 606, wherein:
a sequence number comparison module 602, configured to obtain a message sequence number corresponding to a message to be forwarded when the message to be forwarded is received; and comparing the message serial number with the target serial number to obtain a comparison result.
A waiting set matching module 604, configured to obtain a current waiting set including at least one waiting sequence number when the comparison result is that the message sequence number is greater than the target sequence number; and matching the message sequence number with the waiting sequence number, and determining a target waiting set to which the message sequence number belongs according to a matching result.
And a message transmission module 606, configured to send the sequence of the messages to be forwarded corresponding to the waiting sequence numbers in the target waiting set to the receiving end when the target waiting set meets the sending condition.
In one embodiment, the wait set matching module 604 is further configured to detect whether a wait set exists; and when the waiting set does not exist, marking the target sequence number and the sequence number between the target sequence number and the message sequence number as waiting sequence numbers, and generating the waiting set according to the waiting sequence numbers.
In an embodiment, the waiting set matching module 604 is further configured to generate a next waiting set according to a maximum waiting sequence number and a message sequence number in the current waiting set when the message sequence number does not match any waiting sequence number and the message sequence number is not consecutive.
In an embodiment, the message transmission apparatus further includes a retransmission request module, configured to generate a retransmission request according to the waiting sequence number in the waiting set; and sending the retransmission request to a sending end, and receiving a retransmission message sent by the sending end according to the retransmission request.
In an embodiment, the message transmission apparatus further includes a message cache module, configured to obtain cache data, where the cache data includes a cache sequence number corresponding to the cache message; matching the message sequence number with the cache sequence number; and when the message sequence number is not matched with any cache sequence number, the message sequence number is marked as the cache sequence number, and the message to be forwarded is cached.
In an embodiment, the message transmission module 606 is further configured to monitor a waiting time corresponding to the target waiting set when the sending condition includes a time threshold; when the waiting time corresponding to the target waiting set reaches a time threshold, determining a serial number to be forwarded in the target waiting set according to the target serial number; and acquiring target forwarding messages corresponding to the sequence numbers to be forwarded, sequentially sending the target forwarding messages to a receiving end, and updating the target sequence numbers according to the sending results.
In an embodiment, the message transmission module 606 is further configured to, when the comparison result is that the message sequence number is equal to the target sequence number, obtain a continuous sequence number that is continuous with the message sequence number; determining a message to be forwarded and continuous messages corresponding to the continuous sequence numbers as target forwarding messages; and sequentially sending the target forwarding messages to a receiving end, and updating the target sequence number according to the sending result.
In an embodiment, the serial number comparison module 602 is further configured to obtain a current channel corresponding to the message to be forwarded; comparing the current channel with the previous channel corresponding to the previous message to be forwarded; when the current channel is inconsistent with the previous channel, acquiring transmission information associated with the current channel, wherein the transmission information comprises a target serial number; and comparing the target sequence number corresponding to the current channel with the message sequence number.
For specific limitations of the message transmission device, reference may be made to the above limitations of the message transmission method, which is not described herein again. The respective modules in the above message transmission device may be wholly or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store message transmission data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a message transmission method.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the steps of the above message transmission method embodiment when executing the computer program.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the above-mentioned message transmission method embodiment.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of message transmission, the method comprising:
when a message to be forwarded is received, acquiring a message serial number corresponding to the message to be forwarded;
comparing the message serial number with a target serial number to obtain a comparison result;
when the comparison result is that the message serial number is larger than the target serial number, cache data are obtained; the cache data comprises cache serial numbers corresponding to the cache messages;
matching the message sequence number with the cache sequence number;
when the message serial number is matched with the cache serial number, deleting the message to be forwarded;
when the message serial number is not matched with any cache serial number, marking the message serial number as a cache serial number, caching the message to be forwarded, and acquiring a current waiting set comprising at least one waiting serial number; the message corresponding to the waiting sequence number is a lost message waiting for retransmission;
matching the message sequence number with the waiting sequence number;
when the message serial number is not matched with any waiting serial number and the message serial number is not continuous, generating a next waiting set according to the maximum waiting serial number in the current waiting set and the message serial number, generating a retransmission request according to the waiting serial number in the next waiting set, sending the retransmission request to a sending end, and receiving a retransmission message sent by the sending end according to the retransmission request;
when the message sequence number is matched with any waiting sequence number, determining a target waiting set to which the message sequence number belongs;
when the target waiting set meets the sending condition, marking the waiting serial number behind the target serial number as a serial number to be forwarded in the target waiting set, and sequentially sending the target forwarding message which is acquired from the cache data and corresponds to the serial number to be forwarded to a receiving end; and when the message sequence number is smaller than the target sequence number, deleting the message to be forwarded corresponding to the message sequence number.
2. The method according to claim 1, wherein after the comparing results in that the message sequence number is greater than the target sequence number, the method further comprises:
detecting whether a waiting set exists;
and when the waiting set does not exist, marking the target sequence number and the sequence number between the target sequence number and the message sequence number as waiting sequence numbers, and generating the waiting set according to the waiting sequence numbers.
3. The method according to claim 1, wherein the message to be forwarded is a message generated by a sending end according to a communication protocol with a server.
4. The method of claim 3, wherein the communication protocol comprises a TCP protocol and a UDP protocol.
5. The method according to claim 1, wherein when the target waiting set meets the sending condition, marking a waiting sequence number in the target waiting set after the target sequence number as a to-be-forwarded sequence number, and sequentially sending the target forwarding messages, which are obtained from the cached data and correspond to the to-be-forwarded sequence number, to a receiving end comprises:
when the sending condition comprises a time threshold, monitoring the waiting time corresponding to the target waiting set;
when the waiting time corresponding to the target waiting set reaches the time threshold, determining a sequence number to be forwarded in the target waiting set according to the target sequence number;
and acquiring target forwarding messages corresponding to the sequence number to be forwarded, sequentially sending the target forwarding messages to the receiving end, and updating the target sequence number according to a sending result.
6. The method of claim 1, wherein after comparing the message sequence number with a target sequence number to obtain a comparison result, the method further comprises:
when the comparison result is that the message sequence number is equal to the target sequence number, acquiring a continuous sequence number continuous with the message sequence number;
determining the message to be forwarded and the continuous messages corresponding to the continuous sequence numbers as target forwarding messages;
and sequentially sending the target forwarding messages to the receiving end, and updating the target sequence number according to the sending result.
7. The method of claim 1, wherein comparing the message sequence number to a target sequence number comprises:
acquiring a current channel corresponding to the message to be forwarded;
comparing the current channel with a previous channel corresponding to a previous message to be forwarded;
when the current channel is inconsistent with the previous channel, acquiring transmission information associated with the current channel, wherein the transmission information comprises a target serial number;
and comparing the target sequence number corresponding to the current channel with the message sequence number.
8. A message transmission apparatus, characterized in that the apparatus comprises:
the serial number comparison module is used for acquiring a message serial number corresponding to a message to be forwarded when the message to be forwarded is received; comparing the message serial number with a target serial number to obtain a comparison result; when the message serial number is smaller than the target serial number, deleting the message to be forwarded corresponding to the message serial number;
a waiting set matching module, configured to obtain cache data when the comparison result indicates that the message sequence number is greater than the target sequence number; the cache data comprises cache serial numbers corresponding to the cache messages; matching the message sequence number with the cache sequence number; when the message serial number is matched with the cache serial number, deleting the message to be forwarded; when the message serial number is not matched with any cache serial number, marking the message serial number as a cache serial number, caching the message to be forwarded, and acquiring a current waiting set comprising at least one waiting serial number; matching the message sequence number with the waiting sequence number; when the message serial number is not matched with any waiting serial number and the message serial number is not continuous, generating a next waiting set according to the maximum waiting serial number in the current waiting set and the message serial number, generating a retransmission request according to the waiting serial number in the next waiting set, sending the retransmission request to a sending end, and receiving a retransmission message sent by the sending end according to the retransmission request; when the message sequence number is matched with any waiting sequence number, determining a target waiting set to which the message sequence number belongs; the message corresponding to the waiting sequence number is a lost message waiting for retransmission;
and the message transmission module is used for marking the waiting sequence number in the target waiting set from the next target sequence number as a to-be-forwarded sequence number when the target waiting set meets the sending condition, and sequentially sending the target forwarding message which is acquired from the cache data and corresponds to the to-be-forwarded sequence number to a receiving end.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202010378175.1A 2020-05-07 2020-05-07 Message transmission method and device, computer equipment and storage medium Active CN111669431B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010378175.1A CN111669431B (en) 2020-05-07 2020-05-07 Message transmission method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010378175.1A CN111669431B (en) 2020-05-07 2020-05-07 Message transmission method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111669431A CN111669431A (en) 2020-09-15
CN111669431B true CN111669431B (en) 2021-11-19

Family

ID=72383332

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010378175.1A Active CN111669431B (en) 2020-05-07 2020-05-07 Message transmission method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111669431B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116700989A (en) * 2023-07-03 2023-09-05 中科驭数(北京)科技有限公司 Data transmission method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102684818A (en) * 2011-03-11 2012-09-19 华为技术有限公司 Data retransmission method, relay station, base station and communication system
CN109167819A (en) * 2018-08-13 2019-01-08 苏州科达科技股份有限公司 Data synchronous system, method, apparatus and storage medium

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7751404B2 (en) * 2006-10-06 2010-07-06 Broadcom Corporation Method, system, and computer program product for high performance bonding resequencing
CN101237688A (en) * 2007-01-31 2008-08-06 大唐移动通信设备有限公司 A network call tracking method and device
CN101369877B (en) * 2007-12-27 2012-08-22 华为技术有限公司 Wireless transmission control protocol processing method and equipment
WO2012126424A2 (en) * 2012-05-18 2012-09-27 华为技术有限公司 Method and device for forwarding data packet
CN104219168B (en) * 2014-09-29 2017-11-14 新华三技术有限公司 Control message processing method and device based on UDP transmission
CN107231283B (en) * 2016-03-23 2020-12-18 阿里巴巴集团控股有限公司 Message management method and device and message pre-reading method and device
CN109981548B (en) * 2017-12-28 2021-09-10 中移信息技术有限公司 Method and device for analyzing charging message
US10455264B2 (en) * 2018-01-31 2019-10-22 Salesforce.Com, Inc. Bulk data extraction system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102684818A (en) * 2011-03-11 2012-09-19 华为技术有限公司 Data retransmission method, relay station, base station and communication system
CN109167819A (en) * 2018-08-13 2019-01-08 苏州科达科技股份有限公司 Data synchronous system, method, apparatus and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
《增强应答的链路级重传协议设计_宋新亮》;宋新亮,张清波;《计算机工程》;20041231;第30卷;第12-16页 *

Also Published As

Publication number Publication date
CN111669431A (en) 2020-09-15

Similar Documents

Publication Publication Date Title
WO2021121370A1 (en) Message loss detection method and apparatus for message queue
US10645145B2 (en) Method and apparatus for accelerating data transmission in a network communication system
US20170054640A1 (en) Device and method for establishing connection in load-balancing system
CN111796948B (en) Shared memory access method and device, computer equipment and storage medium
WO2016082371A1 (en) Ssh protocol-based session parsing method and system
CN110519265B (en) Method and device for defending attack
US10708820B2 (en) Apparatus and method for data delivery in delay-tolerant network (DTN)
CN108347350B (en) Communication method and device
CN113835902B (en) Data processing method, device, computer equipment and storage medium
CN111669431B (en) Message transmission method and device, computer equipment and storage medium
CN111181698B (en) Data processing method, device, equipment and medium
CN114500633A (en) Data forwarding method, related device, program product and data transmission system
US11444882B2 (en) Methods for dynamically controlling transmission control protocol push functionality and devices thereof
WO2017005118A1 (en) Method, device, terminal and server for maintaining communication connection
EP3480696A1 (en) Adaptive event aggregation
CN113630442B (en) Data transmission method, device and system
US10476919B2 (en) System and method for reliable messaging between application sessions across volatile networking conditions
CN112615760B (en) Data transmission method, device, base station and storage medium
CN113542388A (en) Reliable data transmission method and device, computer equipment and storage medium
CN112583935A (en) Buffer window adjusting method, gateway device and storage medium
CN112230880A (en) Data transmission control method and device, FPGA (field programmable Gate array) and medium
CN109688085B (en) Transmission control protocol proxy method, storage medium and server
CN107548105B (en) Data transmission confirmation method based on UDP (user Datagram protocol) and base station
CN115442320B (en) Method, device and storage medium for realizing fragment reassembly of RDMA (remote direct memory Access) multi-queue messages
WO2021237431A1 (en) Data processing method and apparatus, processing device, and data storage system

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
CB02 Change of applicant information

Address after: Room 2301, building 5, Shenzhen new generation industrial park, 136 Zhongkang Road, Meidu community, Meilin street, Futian District, Shenzhen City, Guangdong Province

Applicant after: SHENZHEN ARCHFORCE FINANCIAL TECHNOLOGY Co.,Ltd.

Address before: 518048 603-604, block a, Tianjing building, Tian'an Digital City, Futian District, Shenzhen City, Guangdong Province

Applicant before: SHENZHEN ARCHFORCE FINANCIAL TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: Room 2301, building 5, Shenzhen new generation industrial park, 136 Zhongkang Road, Meidu community, Meilin street, Futian District, Shenzhen City, Guangdong Province

Patentee after: Shenzhen Huarui Distributed Technology Co.,Ltd.

Address before: Room 2301, building 5, Shenzhen new generation industrial park, 136 Zhongkang Road, Meidu community, Meilin street, Futian District, Shenzhen City, Guangdong Province

Patentee before: SHENZHEN ARCHFORCE FINANCIAL TECHNOLOGY Co.,Ltd.

CP01 Change in the name or title of a patent holder
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Message transmission methods, devices, computer equipment, and storage media

Effective date of registration: 20231226

Granted publication date: 20211119

Pledgee: Shenzhen Futian Sub branch of Industrial and Commercial Bank of China Ltd.

Pledgor: Shenzhen Huarui Distributed Technology Co.,Ltd.

Registration number: Y2023980074303

PE01 Entry into force of the registration of the contract for pledge of patent right