Network communication method, device and electronic equipment

By maintaining the sending queue of the receiving end at the sending end and switching messages according to the status, the problem of poor network communication quality in the data processing system is solved, and the order preservation and flow control functions are improved.

CN112398744BActive Publication Date: 2024-09-06ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910760236.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-16
Publication Date
2024-09-06
Estimated Expiration
2039-08-16

AI Technical Summary

Technical Problem

In the data processing system, in the network communication between roles, the message sending rate and processing rate of the sending end and the receiving end are different, causing the quality of network communication to be affected, and it is difficult to ensure the order preservation and flow control functions of communication with existing technology.

Method used

The sending end maintains the sending queue corresponding to the receiving end, sets the queue to have first and second states, caches and sends messages in the first state, and switches to the second state to clear the messages after receiving the reply to ensure message order and flow control functions. .

Benefits of technology

Through the first-in-first-out characteristics and status switching of the queue, the order preservation and flow control functions of network communication are ensured, the processing performance of the sender is improved, and the quality of network communication is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112398744B
    Figure CN112398744B
Patent Text Reader

Abstract

The embodiments of the present application provide a network communication method, device and electronic device, wherein the sending end caches the to-be-sent sending message in the first sending queue corresponding to the receiving end; detects whether the first sending queue is in the first state; wherein the initial state of the first sending queue is the first state; if the first sending queue is in the first state, sends at least one sending message currently cached in the first sending queue to the receiving end, and switches the first sending queue to the second state; receives a reply message from the receiving end to the at least one sending message, clears the at least one sending message in the first sending queue, and switches the first sending queue to the first state. The technical solution provided by the embodiments of the present application improves the quality of network communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of network communication technology, and in particular, to a network communication method, device and electronic device. Background Art

[0002] Currently, in many data processing systems, network communications between many roles are usually involved for message transmission and processing.

[0003] In these data processing systems, when roles communicate over the network, the message sent by the sender to the receiver requires the receiver to respond and reply. The sender usually sends many messages to the receiver in succession, and the message sending rate of the sender and the message processing rate of the receiver may also be different. These factors will affect the quality of network communication. Therefore, how to ensure the quality of network communication has become a technical problem that needs to be solved at present. Summary of the invention

[0004] The embodiments of the present application provide a network communication method, device and electronic device to improve the quality of network communication.

[0005] In a first aspect, an embodiment of the present application provides a network communication method, including:

[0006] The sending end caches the sending message to be sent in the first sending queue corresponding to the receiving end;

[0007] Detecting whether the first sending queue is in a first state;

[0008] If the first sending queue is in the first state, sending at least one sending message currently buffered in the first sending queue to the receiving end, and switching the first sending queue to the second state;

[0009] A reply message from the receiving end to the at least one sent message is received, the at least one sent message in the first sending queue is cleared, and the first sending queue is switched to the first state.

[0010] In a second aspect, an embodiment of the present application provides a network communication method, including:

[0011] The receiving end receives at least one sending message currently cached in the first sending queue sent by the sending end;

[0012] Processing the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages;

[0013] Buffering the one or more reply messages in a second sending queue;

[0014] Send at least one reply message currently buffered in the second sending queue to the sending end.

[0015] In a third aspect, an embodiment of the present application provides a network communication method, including:

[0016] The sender determines the message to be sent;

[0017] Searching for a third sending queue in a first state from among the plurality of sending queues;

[0018] Buffering the sent message in the third sending queue;

[0019] Sending at least one send message currently cached in the third send queue to the receiving end, and switching the third send queue to the second state;

[0020] A reply message from the receiving end to the at least one sent message is received, the at least one sent message is cleared from the third sending queue, and the third sending queue is switched to the first state.

[0021] In a fourth aspect, an embodiment of the present application provides a network communication method, including:

[0022] The receiving end receives at least one sending message currently buffered in the third sending queue sent by the sending end;

[0023] Processing the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages;

[0024] Buffering the one or more reply messages in a fourth sending queue;

[0025] At least one reply message currently buffered in the fourth sending queue is sent to the sending end.

[0026] In a fifth aspect, an embodiment of the present application provides a network communication device, including:

[0027] A first buffer module, used for buffering the to-be-sent message into a first sending queue corresponding to the receiving end;

[0028] A first detection module, used to detect whether the first sending queue is in a first state;

[0029] a first sending module, configured to send at least one sending message currently cached in the first sending queue to the receiving end if the first sending queue is in the first state, and switch the first sending queue to a second state;

[0030] The first processing module is used to receive a reply message from the receiving end to the at least one sent message, clear the at least one sent message in the first sending queue, and switch the first sending queue to the first state.

[0031] In a sixth aspect, an embodiment of the present application provides a network communication device, including:

[0032] A first receiving module, configured to receive at least one sending message currently cached in a first sending queue sent by a sending end;

[0033] A second processing module, configured to sequentially process the at least one sent message according to the cache order of the at least one sent message to obtain one or more reply messages;

[0034] A second cache module, used for caching the one or more reply messages into a second sending queue;

[0035] The second sending module is used to send at least one reply message currently cached in the second sending queue to the sending end.

[0036] In a seventh aspect, an embodiment of the present application provides a network communication device, including:

[0037] A message determination module, used to determine a message to be sent;

[0038] A search module, used for searching a third sending queue in a first state from a plurality of sending queues;

[0039] A third cache module, used for caching the sent message into the third sending queue;

[0040] A third sending module, used for sending at least one sending message currently cached in the third sending queue to the receiving end, and switching the third sending queue to the second state;

[0041] The third processing module is used to receive a reply message from the receiving end to the at least one sent message, clear the sent message from the third sending queue, and switch the third sending queue to the first state.

[0042] In an eighth aspect, an embodiment of the present application provides a network communication device, including:

[0043] A second receiving module, used for receiving at least one sending message currently cached in a third sending queue sent by a sending end;

[0044] A fourth processing module, configured to sequentially process the at least one sent message according to the cache order of the at least one sent message to obtain one or more reply messages;

[0045] A fourth cache module, used for caching the one or more reply messages into a fourth sending queue;

[0046] The fourth sending module is used to send at least one reply message currently cached in the fourth sending queue to the sending end.

[0047] In a ninth aspect, an embodiment of the present application provides an electronic device, including a processing component and a storage component;

[0048] The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component;

[0049] The processing component is used to:

[0050] Cache the to-be-sent message in a first sending queue corresponding to the receiving end;

[0051] Detecting whether the first sending queue is in a first state;

[0052] If the first sending queue is in the first state, sending at least one sending message currently buffered in the first sending queue to the receiving end, and switching the first sending queue to the second state;

[0053] A reply message from the receiving end to the at least one sent message is received, the at least one sent message in the first sending queue is cleared, and the first sending queue is switched to the first state.

[0054] In a tenth aspect, an embodiment of the present application provides an electronic device, including a processing component and a storage component;

[0055] The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component;

[0056] The processing component is used to:

[0057] receiving at least one sending message currently cached in a first sending queue sent by a sending end;

[0058] Processing the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages;

[0059] Buffering the one or more reply messages in a second sending queue;

[0060] Send at least one reply message currently buffered in the second sending queue to the sending end.

[0061] In an eleventh aspect, an embodiment of the present application provides an electronic device, including a processing component and a storage component;

[0062] The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component;

[0063] The processing component is used to:

[0064] Determine the send message to be sent;

[0065] Searching for a third sending queue in a first state from among the plurality of sending queues;

[0066] Buffering the sent message in the third sending queue;

[0067] Sending at least one send message currently cached in the third send queue to the receiving end, and switching the third send queue to the second state;

[0068] A reply message from the receiving end to the at least one sent message is received, the at least one sent message is cleared from the third sending queue, and the third sending queue is switched to the first state.

[0069] In a twelfth aspect, an embodiment of the present application provides an electronic device, including a processing component and a storage component;

[0070] The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component;

[0071] The processing component is used to:

[0072] receiving at least one sending message currently cached in a third sending queue sent by a sending end;

[0073] Processing the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages;

[0074] Buffering the one or more reply messages in a fourth sending queue;

[0075] At least one reply message currently buffered in the fourth sending queue is sent to the sending end.

[0076] In a thirteenth aspect, an embodiment of the present application provides a network communication method, including:

[0077] The sending end caches the sending message to be sent in the first sending queue corresponding to the receiving end;

[0078] The sending end detects whether the first sending queue is in a first state;

[0079] If the first sending queue is in the first state, the sending end sends at least one sending message currently buffered in the first sending queue to the receiving end, and switches the first sending queue to the second state;

[0080] The receiving end processes the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages;

[0081] The receiving end caches the one or more reply messages in a second sending queue;

[0082] The receiving end sends at least one reply message currently buffered in the second sending queue to the sending end;

[0083] The sending end receives a reply message to the at least one sent message, clears the at least one sent message in the first sending queue, and switches the first sending queue to the first state.

[0084] In a fourteenth aspect, an embodiment of the present application provides a network communication system, including a transmitting end and a receiving end;

[0085] The sending end is used to cache the send message to be sent in the first send queue corresponding to the receiving end; detect whether the first send queue is in the first state; if the first send queue is in the first state, send at least one send message currently cached in the first send queue to the receiving end, and switch the first send queue to the second state; receive a reply message from the receiving end to the at least one send message, clear the at least one send message in the first send queue, and switch the first send queue to the first state;

[0086] The receiving end is used to receive at least one sending message currently cached in the first sending queue sent by the sending end; process the at least one sending message in sequence according to the cache order of the at least one sending message to obtain one or more reply messages; cache the one or more reply messages in the second sending queue; and send at least one reply message currently cached in the second sending queue to the sending end.

[0087] In an embodiment of the present application, a corresponding first sending queue is maintained for the receiving end in the sending end, and the first sending queue is set to have a first state and a second state. When the first sending queue is in the first state, the sending message to be sent to the receiving end will first be cached in the first sending queue. If the first sending queue is in the first state, at least one message currently cached in the first sending queue will be sent to the receiving end. When a message sending event occurs, the first sending queue will be switched to the second state until a reply message to at least one message is received, and then the first sending queue will be switched back to the first state, and the at least one message that has been replied to will be cleared, so that the message can continue to be cached in the first sending queue and sent. Since the queue has a first-in-first-out feature, each message in the queue has a certain cache order, so that the receiving end can process at least one message in the cache order, thereby ensuring the order preservation of network communication, and by caching the message in the queue first, multiple messages can be sent to the receiving end as a message packet, thereby ensuring the flow control function of network communication. In addition, when the first sending queue is in the second state, the message cannot be sent, and the processing performance of the sending end can be guaranteed. Therefore, the quality of network communication is guaranteed by the embodiment of the present application.

[0088] These and other aspects of the present application will become more apparent from the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0089] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0090] Figure 1 A flowchart of an embodiment of a network communication method provided by the present application is shown;

[0091] Figure 2 A flowchart of another embodiment of a network communication method provided by the present application is shown;

[0092] Figure 3 A schematic diagram of network communication interaction in a practical application of an embodiment of the present application is shown;

[0093] Figure 4 A schematic diagram showing multiple sending queues maintained by a sending end in an actual application of an embodiment of the present application is shown;

[0094] Figure 5 A flowchart of another embodiment of a network communication method provided by the present application is shown;

[0095] Figure 6 A schematic diagram of network communication interaction in a practical application of an embodiment of the present application is shown;

[0096] Figure 7 A flowchart of another embodiment of a network communication method provided by the present application is shown;

[0097] Figure 8 A schematic diagram showing the structure of an embodiment of a network communication device provided by the present application is shown;

[0098] Fig. 9 A schematic structural diagram of an embodiment of an electronic device provided by the present application is shown;

[0099] Fig.10 A schematic diagram showing the structure of another embodiment of a network communication device provided by the present application is shown;

[0100] Fig.11 A structural schematic diagram of another embodiment of an electronic device provided by the present application is shown;

[0101] Fig.12 A schematic diagram showing the structure of another embodiment of a network communication device provided by the present application is shown;

[0102] Fig.13 A structural schematic diagram of another embodiment of an electronic device provided by the present application is shown;

[0103] Fig.14 A schematic diagram showing the structure of another embodiment of a network communication device provided by the present application is shown;

[0104] Fig.15 A structural schematic diagram of another embodiment of an electronic device provided by the present application is shown. DETAILED DESCRIPTION

[0105] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0106] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

[0107] The technical solution of the embodiment of the present application can be applied to any network communication scenario, such as network communication between various roles in a data processing system. In a practical application, it can be specifically applied to a distributed data processing system. Since the distributed processing system includes multiple nodes, a node may need to communicate with multiple nodes, and a node may send messages of different message types. The communication environment is more complex and the quality requirements for network communication are also higher.

[0108] In a complex network communication environment such as a data processing system, the message sent from the sender to the receiver requires the receiver to respond and reply, and the sender usually sends many messages to the receiver. The message sending rate of the sender and the message processing rate of the receiver may also be different. These factors may affect the quality of network communication.

[0109] The inventor found in the research that in order to ensure the quality of network communication, network communication is required to have high performance, order preservation and flow control functions, among which high performance includes ensuring the processing performance of the sender, because when objective factors such as machine failure, network disconnection, process restart, etc. occur, the message sent by the sender cannot reach the receiver, and the sender cannot receive the reply message, and may continue to send messages frequently, which will affect the performance of the sender. Order preservation means: when the sender sends multiple messages to the receiver continuously, it is hoped that the arrival order of the multiple messages is consistent with the sending order, because if it is inconsistent, an error failure will occur. For example, the sender first sends the first message to the receiver to execute 3 tasks, and then sends the second message to the receiver to execute 4 tasks. If the second message arrives at the receiver before the first message, it will cause the receiver to eventually execute 3 tasks, resulting in a processing error; the flow control function includes ensuring the processing performance of the receiver, because if the sending rate of the sender is greater than the processing rate of the receiver, especially when multiple messages are sent continuously, it may cause the receiver to be paralyzed and unable to process messages.

[0110] In view of this, the inventor has proposed the technical solution of the present application. In the embodiment of the present application, a first sending queue corresponding to the receiving end is maintained in the sending end, and the first sending queue is set to have a first state and a second state. When the first sending queue is in the first state, the sending message to be sent to the receiving end will first be cached in the first sending queue. If the first sending queue is in the first state, at least one message currently cached in the first sending queue will be sent to the receiving end. When a message sending event occurs, the first sending queue will be switched to the second state until a reply message to at least one message is received, and then the first sending queue will be switched back to the first state and cleared. By removing the at least one message that has been replied to, it is possible to continue to cache messages in the first sending queue and send them. Since the queue has a first-in-first-out feature, each message in the queue has a certain cache order, so that the receiving end can process at least one message in the cache order, thereby ensuring the order of network communication. By caching the messages in the queue first, multiple messages can be sent to the receiving end as a message packet, thereby ensuring the flow control function of network communication. In addition, when the first sending queue is in the second state, messages cannot be sent, which can ensure the processing performance of the sending end. Therefore, the quality of network communication is guaranteed by the embodiments of the present application.

[0111] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0112] Figure 1 A flowchart of an embodiment of a network communication method provided in an embodiment of the present application, the method is executed by a sending end and may include the following steps:

[0113] 101: Cache the message to be sent in the first sending queue corresponding to the receiving end.

[0114] The message to be sent is used to be sent to the receiving end.

[0115] The first sending queue is a special linear table that allows queue elements to be inserted at only one end and deleted at the other end, so the first sending queue is a first-in-first-out linear table. The sending messages cached in the first sending queue refer to the queue elements.

[0116] Optionally, in order to further ensure the processing performance of the sending end, in actual applications, the sending end may need to communicate with multiple receiving ends over the network. Therefore, the sending end can maintain corresponding sending queues for different receiving ends respectively, and cache the sending messages to each receiving end in the sending queue corresponding to each receiving end.

[0117] In an embodiment of the present application, there is a message to be sent to a receiving end. The sending operation is not performed immediately, but is first cached in a first sending queue. When the sending end needs to send multiple messages to the receiving end, the multiple messages are cached in sequence in the first sending queue to ensure the message processing order.

[0118] 102: Detect whether the first sending queue is in the first state, if so, execute step 103, otherwise continue to execute step 102.

[0119] The initial state of the first sending queue is the first state; the first state may also refer to a message sendable state.

[0120] The initial state of the first sending queue is the first state.

[0121] 103: Send at least one sending message currently cached in the first sending queue to the receiving end, and switch the first sending queue to the second state.

[0122] The second state may refer to a state where the message cannot be sent. If the first sending queue is not in the first state but in the second state, the first sending queue may be continuously detected, and when the second sending queue is in the second state, if the sending end generates a new message to be sent to the receiving end, it will continue to be cached in the first sending queue, so that at least one sending message may have been cached in the first sending queue.

[0123] Therefore, if the first sending queue is in the first sending state, at least one sending message currently buffered in the first sending queue is sent.

[0124] The at least one send message currently cached in the first send queue is, that is, all messages currently cached in the first send queue.

[0125] Since at least one sent message is sequentially cached in the first sending queue and has a cache order, the receiving end may process the at least one message sequentially according to the cache order of the at least one sent message.

[0126] To facilitate processing at the receiving end, as yet another embodiment, the method may further include:

[0127] According to the cache order, a message sequence number is set for each message cached in the sending queue; then the receiving end can specifically process the at least one message in sequence according to the cache order indicated by the message sequence number of the at least one message.

[0128] In order to further facilitate determining the cache order, setting a message sequence number for each message in the sending queue according to the cache order includes:

[0129] According to the cache order, message sequence numbers are set for each message cached in the first sending queue using consecutive numbers starting from number 1.

[0130] Optionally, Arabic numerals may be used. That is, starting from Arabic numeral 1, consecutive Arabic numerals are set as message numbers for each message cached in the first sending queue in ascending order, that is, 1, 2, 3, 4, etc. Therefore, the message number indicates the number of messages cached in the first sending queue. The smaller the message number, the earlier the cache time of the message, and the larger the message number, the later the cache time of the message.

[0131] In some embodiments, in order to facilitate understanding of the message cache status in the first sending queue, the method may further include:

[0132] A first sending field is set for the first sending queue; wherein the first sending field is used to store the maximum message sequence number of the messages buffered in the first sending queue; therefore, the value of the first sending field is also the maximum message sequence number of the messages buffered in the first sending queue. When the message sequence number is represented by continuous Arabic numerals, it can be determined based on the value of the first sending field that the sending end has requested the receiving end to send multiple sending messages.

[0133] The at least one message can be sent to the receiving end as a data packet at the same time to save network resources. The receiving end can process the at least one message in sequence according to the message sequence number of the at least one message.

[0134] 104: receiving a reply message from the receiving end to the at least one sent message, clearing the at least one sent message in the first sending queue, and switching the first sending queue to the first state.

[0135] If a reply message is received from the receiving end for the at least one sent message, it can be considered that the receiving end has processed the at least one sent message, that is, the at least one sent message can be cleared from the first sending queue to avoid repeated sending. In addition, the receipt of the reply message from the receiving end indicates that the network is unobstructed and the receiving end has good processing performance. Therefore, the first sending queue can also be switched to the first state so that messages can continue to be sent to the receiving end.

[0136] Among them, the reply message of the receiving end to the at least one sent message may include one or more messages, that is, the reply results obtained by the receiving end after processing the at least one sent message can be sent to the sending end as reply message requests respectively, or packaged into a data packet and then sent to the sending end as a reply message request.

[0137] In this embodiment, a first sending queue corresponding to the receiving end is maintained in the sending end, and the first sending queue is set to have a first state and a second state. When the first sending queue is in the first state, the sending message to be sent to the receiving end will be first cached in the first sending queue. If the first sending queue is in the first state, at least one message currently cached in the first sending queue will be sent to the receiving end. When a message sending event occurs, the first sending queue will be switched to the second state until a reply message to at least one message is received, and then the first sending queue will be switched back to the first state, and the at least one message that has been replied to will be cleared, so that the message can continue to be cached and sent in the first sending queue. Since the queue has a first-in-first-out feature, each message in the queue has a certain cache order, so that the receiving end can process at least one message in the cache order, thereby ensuring the order preservation of network communication, and by caching the message in the queue first, multiple messages can be sent to the receiving end as a message packet, thereby ensuring the flow control function of network communication. In addition, when the first sending queue is in the second state, the message cannot be sent, and the processing performance of the sending end can be guaranteed. Therefore, the quality of network communication is guaranteed by the embodiment of the present application.

[0138] In order to further improve the quality of network communication, network communication is also required to be reliable, that is, the message sent to the receiving end may not be received by the receiving end due to various faults. After the fault is overcome, it is hoped that the message can be automatically sent successfully again.

[0139] In an embodiment of the present application, when there are messages cached in the first sending queue, attempts will be made to continuously send at least one currently cached sending message to the receiving end. However, since the first sending queue can only send successfully when it is in the first state, the initial state of the first sending queue is the first state. After the first message is sent, it will be set to the second state. If the first sending queue is in the second state, the first sending queue cannot send messages.

[0140] In order to ensure that the message can be sent to the receiving end, a timeout period can be set. The first sending queue is set to be within a predetermined time after a sending. If no reply message from the receiving end is received, the message in the first sending queue can be forcibly sent to the receiving end to ensure that the message can be automatically sent successfully after the cause of the fault is resolved.

[0141] Therefore, in some embodiments, the method may further include:

[0142] If a reply message from the receiving end to the at least one message currently cached in the first sending queue is not received within a predetermined time after the at least one message currently cached in the first sending queue is sent to the receiving end, the at least one message currently cached in the first sending queue is forcibly sent to the receiving end.

[0143] It is understandable that, because during the waiting time for the receiving end to feedback the reply message, the sending end may still have messages to be sent, and the messages to be sent will still be sent according to Figure 1 In the embodiment shown, the first message is cached in the first sending queue. Therefore, after a predetermined time, the number of messages of at least one message currently cached in the first sending queue at the time of forced sending may have been sent. In short, every time a message is sent, all messages in the first sending queue are sent.

[0144] The scheduled time may be set according to actual business needs.

[0145] As can be seen from the above description, a first sending field will be set for the first sending queue. For the convenience of description, the first sending field will be represented by the symbol "sendId_s" below.

[0146] In order to facilitate the sender to determine whether the receiver has processed the sent message, the receiver can set a second receive field, which is often represented by the symbol "ackId_r" below. The second receive field is used to store the maximum message sequence number of the message sent by the sender that the receiver has processed.

[0147] Therefore, in some embodiments, the receiving a reply message from the receiving end to the at least one message, clearing the at least one message in the sending queue, and switching the sending queue to the first state includes:

[0148] Receive at least one reply message and a second receiving field value sent by the receiving end; wherein the second receiving field is used to store the maximum message sequence number among the messages sent by the sending end that have been processed by the receiving end;

[0149] If the second receiving field value is the same as the first sending field value, the sending queue is switched to the first state, and messages corresponding to message sequence numbers less than or equal to the second receiving field value in the first sending queue are cleared.

[0150] Among them, when at least one reply message sent by the receiving end is received, in order to determine whether the at least one reply message is a response processing made by the receiving end to the sending message sent by the sending end, the second receiving field value can be sent to the sending end at the same time as the at least one reply message.

[0151] If the second receiving field value is the same as the first sending field value, it indicates that all sending messages sent by the sending end are processed by the receiving end. At this time, the messages corresponding to the message sequence numbers less than or equal to the second receiving field value in the first sending queue can be cleared, and the first sending queue can be switched to the first state.

[0152] If the second receiving field value is different from the first sending field value, it indicates that the receiving end has not processed all the sending messages sent by the sending end, but the messages with message sequence numbers less than or equal to the second receiving field value have been processed. At this time, the messages corresponding to the message sequence numbers less than or equal to the second receiving field value in the first sending queue can also be cleared.

[0153] Among them, the second receiving field value is different from the first sending field value. It may be that after the messages corresponding to the message sequence numbers less than or equal to the second receiving field value are sent to the receiving end, the sending end has new messages to be sent cached in the first sending queue, then these messages can continue to be discovered. Therefore, optionally, the first sending queue can also be switched to the first state at this time. Of course, in order to further ensure the quality of network communication, the first sending queue can also be kept in the second state until a reply message to all sent messages is received, or a predetermined time is reached for forced sending.

[0154] The receiving end may maintain a second sending queue, and the receiving end may sequentially cache reply messages to be sent by the sending end into the second sending queue.

[0155] The sending end may set a first receiving field for the first sending queue, which is often represented by "ackId_s" below. The first receiving field may be used to store the maximum message sequence number of the message sent by the receiving end that has been received by the sending end.

[0156] The receiving end may set a second sending field for the second sending queue, which is hereinafter represented by "sendId_r", and the second sending field may store the maximum message sequence number of the reply message currently cached in the second sending queue.

[0157] Therefore, in some embodiments, the method may further include:

[0158] A first receiving field is set for the first sending queue; wherein the first receiving field is used to store the maximum message sequence number of the message sent by the receiving end and received by the sending end; the receiving end maintains a second sending queue for the sending end to cache the reply message to be sent to the sending end;

[0159] When sending at least one sending message currently cached in the first sending queue to the receiving end, the first receiving field value is sent to the receiving end so that the receiving end can clear the reply messages corresponding to each message sequence number less than or equal to the first receiving field in the second sending queue.

[0160] In addition, in actual applications, the sending end may send messages of different message types to the receiving end. The receiving end processes the messages of different message types independently and without interference. If the same sending queue is used to send messages of different message types, the message transmission efficiency will be affected, thereby affecting the network communication efficiency. Therefore, in some embodiments, the sending end may cache the message to be sent in the first sending queue corresponding to the receiving end, which may include:

[0161] Determining a message type of a send message to be sent;

[0162] Determine a first sending queue corresponding to the message type from a plurality of sending queues maintained for the receiving end; wherein the sending end maintains a plurality of first sending queues corresponding to different message types for different receiving ends respectively;

[0163] The send message to be sent is cached in a first send queue corresponding to the message type.

[0164] That is, the sender will maintain multiple send queues for different message types for the same receiver, so that the send messages of the same message type will be cached in the same send queue, so that the send messages of different message types can be sent concurrently to ensure network communication efficiency.

[0165] Figure 2 This is a flowchart of another embodiment of a network communication method provided in an embodiment of the present application. This embodiment is executed by a receiving end. The method may include the following steps:

[0166] 201: Receive at least one sending message currently buffered in a first sending queue sent by a sending end.

[0167] Optionally, the sending end may send at least one sending message currently buffered in the first sending queue as a data packet to the sending end at the same time.

[0168] 202: Process the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages.

[0169] The at least one message cached in the first sending queue has a cache order, so that the receiving end can process the at least one message in sequence according to the cache order of the at least one message, thereby obtaining one or more reply messages.

[0170] The receiving end may package the reply contents obtained by processing at least one sent message into one reply message or multiple reply messages.

[0171] To facilitate processing at the receiving end, the sending end can set a message sequence number for each message cached in the sending queue according to the cache order; then the receiving end can specifically process the at least one message in sequence according to the cache order indicated by the message sequence number of the at least one message.

[0172] In addition, in order to further facilitate the determination of the cache order, the message sequence number may be set starting from 1 with consecutive numbers for each message cached in the first sending queue.

[0173] 203: Cache the one or more reply messages in a second sending queue.

[0174] In an embodiment of the present application, the receiving end may also maintain a sending queue, namely, a second sending queue, that is, the reply message obtained by processing the sending message sent by the sending end may be cached in the second sending queue.

[0175] The one or more reply messages may be cached in the second sending queue in sequence according to the processing time.

[0176] 204: Send at least one reply message currently buffered in the second sending queue to the sending end.

[0177] In this embodiment, after the receiving end processes at least one sending message according to the cache order, it can cache one or more reply messages in the second sending queue, so that at least one reply message in the second sending queue also has a cache order, so as to facilitate the sending end to receive and process, thereby ensuring the order of message delivery and the quality of network communication.

[0178] In some embodiments, sending at least one reply message currently buffered in the second sending queue to the sending end may include:

[0179] Detecting whether the second sending queue is in a first state; wherein, when receiving a sending message from the sending end, switching the second sending queue to the first state;

[0180] If the second sending queue is in the first state, at least one reply message currently buffered in the second sending queue is sent to the sending end, and the second sending queue is switched to the second state.

[0181] In order to ensure the performance of the receiving end, the receiving end may also set the first state and the second state for the second sending queue.

[0182] The receiving end may also set a message sequence number for each reply message in the second sending queue. Therefore, in some embodiments, the method may further include:

[0183] According to the cache order, a message sequence number is set for each reply message cached in the second sending queue.

[0184] In some embodiments, setting a message sequence number for each reply message cached in the second sending queue according to the cache order may include:

[0185] According to the cache order, message sequence numbers are set for each reply message cached in the second sending queue using consecutive numbers starting from number 1.

[0186] Furthermore, in some embodiments, the method may further include:

[0187] Setting a second sending field for the second sending queue; wherein the second sending field is used to store the maximum message sequence number of the reply message currently cached in the second sending queue;

[0188] The at least one sending message currently cached in the first sending queue sent by the receiving sending end includes:

[0189] Receive at least one send message currently cached in a first send queue sent by a sender and a first receive field value; wherein the first receive field value is used to store the maximum message sequence number in the reply message sent by the receiving end that has been received by the sender;

[0190] Clear the messages corresponding to the message sequence numbers that are less than or equal to the first receiving field value in the second sending queue.

[0191] For ease of understanding, Figure 3 In the network communication interaction diagram shown, the sending end 301 caches the sending message to be sent to the receiving end 302 in the first sending queue 31; when the first sending queue 303 is in the first state, at least one sending message currently cached in the first sending queue can be sent to the receiving end 302, and the at least one sending message is sent to the receiving end 302 as a data packet, which can save sending resources.

[0192] In addition, the sending end 301 can maintain a state for the first sending queue 31, receiveReply=true indicates that it is in the first state, and receiveReply=flush indicates that it is in the second state.

[0193] Assuming that the first message to be sent to the receiving end 302 is currently cached in the first sending queue 303 by the sending end 301, the message sequence number 1 can be set for the sending message. At this time, the first sending field sendId_s=1 and the first receiving field ackId_s=0 maintained by the first sending queue 303. Since receiveReply=true, the sending message in the first sending queue 31 will be sent to the receiving end 302, and then receiveReply will be switched to false. At the same time, ackId_s=0 can be sent to the receiving end 302 synchronously with the sending message.

[0194] If the receiving end 302 cannot receive the sent message due to network reasons, the sending end 301 may not receive a reply message within a certain period of time. In order to ensure that the receiving end 302 can receive the sent message, the sending end 301 will keep trying to send the sent message in the first sending queue 31, but because receiveReply is false, it cannot be sent. At this time, a timeout can be set. If the reply message of the receiving end 302 is not received within a predetermined time after sending the message, all the sent messages in the first sending queue 31 can be forcibly re-sent.

[0195] Assuming that the scheduled receiving time has not arrived, the sender 301 caches another send message into the first send queue 31. At this time, sendId_s=2, ackId_s=0. Since receiveReply is false, these two send messages will not be sent.

[0196] When the scheduled time is reached, the sender 301 forces the two send messages in the first send queue 31 to be sent to the receiver 302. Assuming that the receiver 302 receives the two send messages, it can process the two send messages and generate two reply messages. The receiver 302 can maintain the second send queue 32 and cache the two reply messages in the second send queue 32 in sequence. At this time, the sendId_r of the receiver 302 is 2, and the ackId_r is 2. The receiver 302 sends ackId_r=2 to the sender 301 at the same time.

[0197] After the sender 301 receives the two reply messages, since ackId_r=2 is equal to sendId_s=2, the two send messages with message numbers less than or equal to sendId_s=2 in the first send queue 31 can be cleared, and receiveReply is switched to true. At this time, sendId_s=2, ackId_s=2.

[0198] After that, the sender 301 caches another send message to the first send queue 31. At this time, sendId_s=3, ackId_s=2. Since receiveReply is true, the send message can be sent to the receiver 302, and ackId_s=2 is sent at the same time. The receiver 302 receives the send message and performs corresponding processing as described above. Assuming that a reply message is obtained and cached in the second send queue 32, and according to ackId_s=2 being equal to sendId_r=2, the two reply messages with message sequence numbers less than or equal to ackId_s=2 cached in the second send queue 304 can be cleared. At this time, in the second send queue 32, sendId_r=3, ackId_r=3.

[0199] In addition, the sender can maintain corresponding send queues for different receivers.

[0200] In addition, since the sender may send messages of different message types to the receiver, in order to improve network communication, the sender can create a send queue for each receiver for different message types, such as Figure 4 As shown in , the sending end 301 can maintain multiple sending queues 30 for different receiving ends, so as to send messages of different message types.

[0201] Of course, the receiving end can also maintain multiple sending queues for reply messages of different message types for the same sending end.

[0202] In actual applications, the sender may send messages of different message types to the receiver. The processing of these messages is independent and does not interfere with each other. If the same sending queue is used, it will cause too much pressure on the sending queue. Therefore, as another optional method, the sender can maintain multiple sending queues. Each time there is a message to be sent, one of the sending queues can be selected for caching and sending. Figure 5 As shown, it is a flowchart of another embodiment of a network communication method provided by an embodiment of the present application. The technical solution of this embodiment is executed by the sending end. The method may include the following steps:

[0203] 501: Confirm the message to be sent.

[0204] 502: Search for a third sending queue in a first state from a plurality of sending queues; wherein the initial state of the sending queue is the first state.

[0205] The third sending queue is any sending queue in the first state among the multiple sending queues.

[0206] 503: Cache the sent message to the third sending queue;

[0207] 504: Send at least one sending message in the third sending queue to the receiving end, and switch the third sending queue to the second state.

[0208] 505: receiving a reply message from the receiving end to the at least one sent message, clearing the at least one sent message from the third sending queue, and switching the third sending queue to the first state.

[0209] In this embodiment, the sending end can maintain multiple sending queues. For the sending messages to be sent, a sending queue in the first state can be selected as the third sending queue, which is cached in the third sending queue, and at least one sending message currently cached is sent from the third sending queue to the receiving end, and after receiving the reply message of the receiving end to the at least one sending message, the third sending queue is switched to the first state so that it can continue to send other messages. For each sending message to be sent, any sending queue in the first state can be selected for sending, so that the sending performance of the sending end can be guaranteed, and the queue has a first-in-first-out feature, so that each message in the queue has a certain cache order, so that the receiving end can process at least one message in the cache order, which ensures the order of network communication. Therefore, the quality of network communication is guaranteed by the embodiment of the present application.

[0210] like Figure 6 In the network communication interaction diagram in the sending end shown, multiple sending queues 60 can be created in the sending end 601. For the sending messages to be sent, a third sending queue 61 in the first state can be selected from the multiple sending queues 60, cached in the third sending queue 61, and at least one sending message currently cached in the third sending queue 61 can be sent to the receiving end 602.

[0211] In some embodiments, the method may further include:

[0212] If no reply message from the receiving end is received within a predetermined time after the sending message is sent to the receiving end, the sending message in the third sending queue is forcibly sent to the receiving end. This ensures that the receiving end can receive the sending message and avoids frequent sending to waste resources.

[0213] In some embodiments, the method may further include:

[0214] If the multiple sending queues are all in the second state, selecting any one sending queue;

[0215] Buffering the sent message in any one of the sending queues;

[0216] Sending at least one send message currently buffered in any one of the send queues to the receiving end;

[0217] A reply message to the at least one sent message is received, and any one of the sending queues is switched to the first state.

[0218] Optionally, the method may further include:

[0219] If no reply message from the receiving end is received within a predetermined time after at least one sending message currently cached in any sending queue is sent to the receiving end, at least one sending message currently cached in any sending queue is forcibly sent to the receiving end.

[0220] Furthermore, in some embodiments, the method may further include:

[0221] According to the cache order, message sequence numbers are set for each send message cached in the third send queue using consecutive numbers starting from number 1.

[0222] In some embodiments, the method may further include:

[0223] Setting a first sending field for the third sending queue; wherein the first sending field is used to store the maximum message sequence number of the cached messages in the third sending queue;

[0224] The receiving a reply message from the receiving end to the sent message, clearing the sent message from the third sending queue, and switching the third sending queue to the first state includes:

[0225] Receive at least one reply message and a second receiving field value sent by the receiving end; wherein the second receiving field is used to store the maximum message sequence number among the sending messages sent by the sending end that have been processed by the receiving end;

[0226] If the second receiving field value is the same as the first sending field value, switch the third sending queue to the first state, and clear the sending messages corresponding to each message sequence number less than or equal to the second receiving field value in the third sending queue.

[0227] Among them, optionally, if the second receiving field value is different from the first sending field value, the sending messages corresponding to the message sequence numbers less than or equal to the second receiving field value in the third sending queue can be cleared.

[0228] In some embodiments, the method may further include:

[0229] A first receiving field is set for the third sending queue; wherein the first receiving field is used to store the maximum message sequence number of the reply message sent by the receiving end and received by the sending end; the receiving end maintains a fourth sending queue for the sending end to cache the reply message to be sent to the sending end;

[0230] While sending at least one sending message currently cached in the third sending queue to the receiving end, the first receiving field value is sent to the receiving end so that the receiving end can clear the reply messages corresponding to each message sequence number in the third sending queue that is less than or equal to the first receiving field.

[0231] In order to facilitate searching for a sending queue in the first state, in some embodiments, the method may further include:

[0232] Setting a list of available resources based on the queue identifiers of the multiple sending queues;

[0233] When the multiple sending queues are in an initial state, sequentially storing queue identifiers of the multiple sending queues in the available resource list;

[0234] After caching the sent message to the third sending queue and switching the third sending queue to the second state, the method further includes:

[0235] The queue identifier of the third sending queue is deleted from the available resource list.

[0236] After switching the third sending queue to the first state, the method further includes:

[0237] The queue identifier of the third sending queue is stored in the available resource list.

[0238] Then, searching for a third sending queue in the first state from a plurality of sending queues may include:

[0239] Select any queue identifier from the list of available resources;

[0240] A sending queue represented by any one of the queue identifiers is determined as a third sending queue.

[0241] Optionally, the first queue identifier may be selected from the available resource list, and the sending queue corresponding to the first queue identifier may be used as the third sending queue. After the third sending queue is switched back to the first state, the queue identifier of the third sending queue may be stored at the end of the available resource list.

[0242] Figure 7 This is a flowchart of another embodiment of a network communication method provided in an embodiment of the present application. The technical solution of this embodiment is executed by a receiving end. The method may include the following steps:

[0243] 701: Receive at least one sending message currently buffered in a third sending queue sent by a sending end.

[0244] 702: Process the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages.

[0245] 703: Cache the one or more reply messages in a fourth sending queue.

[0246] 704: Send at least one reply message currently buffered in the fourth sending queue to the sending end.

[0247] In this embodiment, after the receiving end processes at least one sending message according to the cache order, it can cache one or more reply messages in the fourth sending queue, so that at least one reply message in the fourth sending queue also has a cache order, so as to facilitate the sending end to receive and process, thereby ensuring the order of message delivery and the quality of network communication.

[0248] In some embodiments, sending the at least one reply message currently buffered in the fourth sending queue to the sending end may include:

[0249] Detecting whether the fourth sending queue is in the first state; wherein, when receiving a sending message from the sending end, switching the fourth sending queue to the first state;

[0250] If the fourth sending queue is in the first state, at least one reply message currently buffered in the fourth sending queue is sent to the sending end, and the fourth sending queue is switched to the second state.

[0251] In order to ensure the performance of the receiving end, the receiving end may also set the first state and the second state for the fourth sending queue.

[0252] The receiving end may also set a message sequence number for each reply message in the fourth sending queue. Therefore, in some embodiments, the method may further include:

[0253] According to the cache order, a message sequence number is set for each activation message cached in the fourth sending queue.

[0254] In some embodiments, setting a message sequence number for each reply message cached in the fourth sending queue according to the cache order may include:

[0255] According to the cache order, message sequence numbers are set for each reply message cached in the fourth sending queue using consecutive numbers starting from number 1.

[0256] Furthermore, in some embodiments, the method may further include:

[0257] Setting a second sending field for the fourth sending queue; wherein the second sending field is used to store the maximum message sequence number of the reply message currently cached in the fourth sending queue;

[0258] The at least one sending message currently cached in the third sending queue sent by the receiving sending end includes:

[0259] Receive at least one currently cached send message in a third send queue sent by a sender and a first receive field value; wherein the first receive field value is used to store the maximum message sequence number in the reply message sent by the receiving end that has been received by the sender;

[0260] Clear the messages corresponding to the message sequence numbers that are less than or equal to the first receiving field value in the fourth sending queue.

[0261] In a practical application, the technical solution of the embodiment of the present application can be applied to a distributed job processing system, in which the machine node is responsible for providing machine resources, each machine resource can run a job node, and the job submitted by the user can be assigned to multiple job nodes for execution, so as to realize distributed processing. In order to facilitate resource management, the job processing system is performed by the resource manager for resource scheduling, and the job manager is responsible for the management and control of the job nodes. Specifically, the resource manager is responsible for receiving the pending jobs submitted by the user and creating a job manager in the machine node; the job manager applies for a certain number of machine resources from the resource manager based on the pending jobs; the resource manager performs resource allocation based on the available resources of different machine nodes, and feeds back the resource allocation results (how many machine resources are allocated in different machine nodes, etc.) to the job manager; the job manager creates a job node in the corresponding machine node based on the resource allocation results to execute the job.

[0262] From the above description, it can be seen that there are network communications between multiple roles in the job processing system, including between the resource manager and the job manager, between the resource manager and the machine node, between the job manager and the machine node, and between the job manager and the job node, etc. When any two roles communicate over the network, the technical solution provided in the embodiment of the present application can be used to implement it.

[0263] Figure 8 A schematic diagram of a structure of an embodiment of a network communication device provided in an embodiment of the present application, the device may include:

[0264] A first buffer module 801 is used to buffer the to-be-sent message into a first sending queue corresponding to the receiving end;

[0265] A first detection module 802 is used to detect whether the first sending queue is in a first state; wherein the initial state of the first sending queue is the first state;

[0266] A first sending module 803, configured to send at least one sending message currently cached in the first sending queue to a receiving end if the first sending queue is in the first state, and switch the first sending queue to a second state;

[0267] The first processing module 804 is configured to receive a reply message from the receiving end to the at least one sent message, clear the at least one sent message in the first sending queue, and switch the first sending queue to the first state.

[0268] In some embodiments, the first sending module is also used to force the sending of at least one sending message currently cached in the first sending queue to the receiving end if no reply message from the receiving end to the at least one message is received within a predetermined time after the at least one sending message currently cached in the first sending queue is sent to the receiving end.

[0269] In some embodiments, the apparatus may further include:

[0270] The first sequence number setting module is used to set a message sequence number for each send message cached in the send queue according to the cache order; wherein the receiving end processes the at least one send message in sequence according to the cache order indicated by the message sequence number of the at least one send message.

[0271] In some embodiments, the first sequence number setting module is specifically used to set message sequence numbers for each send message cached in the first send queue using consecutive numbers starting from number 1 in accordance with the cache order.

[0272] In some embodiments, the apparatus may further include:

[0273] A first field setting module, configured to set a first sending field for the first sending queue; wherein the first sending field is used to store the maximum message sequence number of the cached messages in the first sending queue;

[0274] The first processing module is specifically used to receive at least one reply message and a second receiving field value sent by the receiving end; wherein, the second receiving field is used to store the maximum message sequence number in the sending message sent by the sending end that has been processed by the receiving end; if the second receiving field value is the same as the first sending field value, switch the first sending queue to the first state, and clear the reply messages corresponding to each message sequence number less than or equal to the second receiving field value in the first sending queue.

[0275] In some embodiments, the first processing module is further used to clear the send messages corresponding to each message sequence number less than or equal to the second receive field value in the first send queue if the second receive field value is different from the first receive field value.

[0276] In some embodiments, the first field setting module is further used to set a first receiving field for the first sending queue; wherein the first receiving field is used to store the maximum message sequence number of the reply message sent by the receiving end and received by the sending end; the receiving end maintains a second sending queue for the sending end to cache the reply message to be sent to the sending end;

[0277] The first sending module is also used to send the first receiving field value to the receiving end when sending at least one sending message currently cached in the first sending queue to the receiving end, so that the receiving end can clear the reply messages corresponding to each message sequence number in the second sending queue that is less than or equal to the first receiving field.

[0278] The sending end maintains corresponding sending queues for different receiving ends respectively.

[0279] In some embodiments, the first sending module can be specifically used to determine the message type of the sending message to be sent; determine the first sending queue corresponding to the message type from multiple sending queues maintained for the receiving end; wherein the sending end maintains multiple first sending queues corresponding to different message types for the same receiving end; and cache the sending message to be sent to the first sending queue corresponding to the message type.

[0280] Figure 8 The network communication device can execute Figure 1The implementation principle and technical effect of the network communication method described in the illustrated embodiment will not be described in detail. The specific manner in which each module and unit performs operations in the network communication device in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.

[0281] In one possible design, Figure 8 The network communication device of the embodiment shown can be implemented as an electronic device, such as Fig. 9 As shown, the electronic device may include a storage component 901 and a processing component 902;

[0282] The storage component 901 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 902 .

[0283] The processing component 902 is used to:

[0284] Cache the to-be-sent message in a first sending queue corresponding to the receiving end;

[0285] Detecting whether the first sending queue is in a first state; wherein the initial state of the first sending queue is the first state;

[0286] If the first sending queue is in the first state, sending at least one sending message currently buffered in the first sending queue to the receiving end, and switching the first sending queue to the second state;

[0287] A reply message from the receiving end to the at least one sent message is received, the at least one sent message in the first sending queue is cleared, and the first sending queue is switched to the first state.

[0288] The processing component 902 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0289] The storage component 901 is configured to store various types of data to support operations in the electronic device. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0290] Of course, the electronic device may also include other components, such as input / output interfaces, communication components, etc.

[0291] The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc.

[0292] The communication component is configured to facilitate, among other things, wired or wireless communications between the electronic device and other devices.

[0293] Among them, the electronic device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the electronic device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.

[0294] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 1 The network communication method of the illustrated embodiment.

[0295] Fig.10 A schematic diagram of a structure of an embodiment of a network communication device provided in an embodiment of the present application, the device may include:

[0296] The first receiving module 1001 is used to receive at least one sending message currently cached in the first sending queue sent by the sending end;

[0297] The second processing module 1002 is used to process the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages;

[0298] A second cache module 1003, configured to cache the one or more reply messages into a second sending queue;

[0299] The second sending module 1004 is used to send at least one reply message currently buffered in the second sending queue to the sending end.

[0300] In some embodiments, the second sending module is specifically used to detect whether the second sending queue is in a first state; wherein, when a sending message from the sending end is received, the second sending queue is switched to the first state; if the second sending queue is in the first state, at least one reply message currently cached in the second sending queue is sent to the sending end, and the first sending queue is switched to the second state.

[0301] In some embodiments, the apparatus may further include:

[0302] The second sequence number setting module is used to set a message sequence number for each reply message cached in the second sending queue using consecutive numbers starting from 1 according to the cache order.

[0303] In some embodiments, the apparatus may further include:

[0304] A second field setting module, configured to set a second sending field for the second sending queue; wherein the second sending field is used to store the maximum message sequence number of the reply message currently cached in the second sending queue;

[0305] The first receiving module is specifically used to receive at least one sending message currently cached in the first sending queue sent by the sending end and a first receiving field value; wherein the first receiving field value is used to store the maximum message sequence number in the reply message sent by the receiving end that has been received by the sending end;

[0306] The second processing module is specifically used to clear the messages corresponding to the message sequence numbers that are less than or equal to the first receiving field value in the second sending queue.

[0307] Fig.10 The network communication device can execute Figure 2 The implementation principle and technical effect of the network communication method described in the illustrated embodiment will not be described in detail. The specific manner in which each module and unit performs operations in the network communication device in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.

[0308] In one possible design, Fig.11 The network communication device of the embodiment shown can be implemented as an electronic device, such as Fig.11 As shown, the electronic device may include a storage component 1101 and a processing component 1102;

[0309] The storage component 1101 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 1102 .

[0310] The processing component 1102 is used to:

[0311] receiving at least one sending message currently cached in a first sending queue sent by a sending end;

[0312] Processing the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages;

[0313] Buffering the one or more reply messages in a second sending queue;

[0314] Send at least one reply message currently buffered in the second sending queue to the sending end.

[0315] The processing component 1102 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0316] The storage component 1101 is configured to store various types of data to support operations in the electronic device. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0317] Of course, the electronic device may also include other components, such as input / output interfaces, communication components, etc.

[0318] The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc.

[0319] The communication component is configured to facilitate, among other things, wired or wireless communications between the electronic device and other devices.

[0320] Among them, the electronic device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the electronic device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.

[0321] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 2 The network communication method of the illustrated embodiment.

[0322] Fig.12 A schematic diagram of a structure of another embodiment of a network communication device provided in an embodiment of the present application, the device may include:

[0323] The message determination module 1201 is used to determine the message to be sent;

[0324] A search module 1202 is used to search a third sending queue in a first state from a plurality of sending queues; wherein the initial state of the third sending queue is the first state;

[0325] A third cache module 1203, configured to cache the sent message to the third sending queue;

[0326] The third sending module 1204 is used to send at least one sending message currently cached in the third sending queue to the receiving end, and switch the third sending queue to the second state;

[0327] The third processing module 1205 is used to receive a reply message from the receiving end to the at least one sent message, clear the sent message from the third sending queue, and switch the third sending queue to the first state.

[0328] In some embodiments, the third processing module can also be used to force the sending of at least one send message currently cached in the third send queue to the receiving end if no reply message from the receiving end is received within a predetermined time after sending the at least one send message to the receiving end.

[0329] In some embodiments, the apparatus may further include:

[0330] The fourth processing module is used to select any one of the sending queues if the multiple sending queues are all in the second state; cache the sending message in any one of the sending queues; send at least one sending message currently cached in any one of the sending queues to the receiving end; and switch any one of the sending queues to the first state upon receiving a reply message to the at least one sending message.

[0331] In some embodiments, the apparatus may further include:

[0332] The third sequence number setting module is used to set message sequence numbers for each send message cached in the third send queue using consecutive numbers starting from number 1 in accordance with the cache order.

[0333] In some embodiments, the apparatus may further include:

[0334] A third field setting module, configured to set a first sending field for the third sending queue; wherein the first sending field is used to store the maximum message sequence number of the cached messages in the third sending queue;

[0335] The third processing module is specifically used to receive at least one reply message and a second receiving field value sent by the receiving end; wherein, the second receiving field is used to store the maximum message sequence number in the sending message sent by the sending end that has been processed by the receiving end; if the second receiving field value is the same as the first sending field value, switch the third sending queue to the first state, and clear the sending messages corresponding to each message sequence number less than or equal to the second receiving field value in the third sending queue.

[0336] In some embodiments, the third field setting module is specifically used to set a first receiving field for the third sending queue; wherein the first receiving field is used to store the maximum message sequence number of the reply message sent by the receiving end that has been received by the sending end; the receiving end maintains a fourth sending queue for the sending end to cache the reply message to be sent to the sending end;

[0337] The third processing module is also used to send the first receiving field value to the receiving end while sending at least one sending message currently cached in the third sending queue to the receiving end, so that the receiving end can clear the reply messages corresponding to each message sequence number less than or equal to the first receiving field in the fourth sending queue.

[0338] In some embodiments, the apparatus may further include:

[0339] A list setting module, configured to set an available resource list based on the queue identifiers of the multiple sending queues; and sequentially store the queue identifiers of the multiple sending queues in the available resource list when the multiple sending queues are in an initial state;

[0340] The list setting module is also used to delete the queue identifier of the third sending queue from the available resource list; and after switching the third sending queue to the first state, store the queue identifier of the third sending queue in the available resource list.

[0341] In addition, the search module can be specifically used to select any queue identifier from the available resource list; and determine the sending queue represented by any queue identifier as the third sending queue.

[0342] Fig.12 The network communication device can execute Figure 5The implementation principle and technical effect of the network communication method described in the illustrated embodiment will not be described in detail. The specific manner in which each module and unit performs operations in the network communication device in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.

[0343] In one possible design, Fig.12 The network communication device of the embodiment shown can be implemented as an electronic device, such as Fig.13 As shown, the electronic device may include a storage component 1301 and a processing component 1302;

[0344] The storage component 1301 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 1302 .

[0345] The processing component 1302 is used to:

[0346] Determine the send message to be sent;

[0347] Searching for a third sending queue in a first state from a plurality of sending queues; wherein an initial state of the third sending queue is the first state;

[0348] Buffering the sent message in the third sending queue;

[0349] Sending at least one send message currently cached in the third send queue to the receiving end, and switching the third send queue to the second state;

[0350] A reply message from the receiving end to the at least one sent message is received, the sent message is cleared from the third sending queue, and the third sending queue is switched to the first state.

[0351] The processing component 1302 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0352] The storage component 1301 is configured to store various types of data to support operations in the electronic device. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0353] Of course, the electronic device may also include other components, such as input / output interfaces, communication components, etc.

[0354] The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc.

[0355] The communication component is configured to facilitate, among other things, wired or wireless communications between the electronic device and other devices.

[0356] Among them, the electronic device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the electronic device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.

[0357] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 5 The network communication method of the illustrated embodiment.

[0358] Fig.14 A schematic diagram of a structure of another embodiment of a network communication device provided in an embodiment of the present application, the device may include:

[0359] The second receiving module 1401 is used to receive at least one sending message currently cached in the third sending queue sent by the sending end;

[0360] The fourth processing module 1402 is used to process the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages;

[0361] The fourth cache module 1403 is used to cache the one or more reply messages in a fourth sending queue;

[0362] The fourth sending module 1404 is used to send at least one reply message currently cached in the fourth sending queue to the sending end.

[0363] Fig.14 The network communication device can execute Figure 6The implementation principle and technical effect of the network communication method described in the illustrated embodiment will not be described in detail. The specific manner in which each module and unit performs operations in the network communication device in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.

[0364] In one possible design, Fig.14 The network communication device of the embodiment shown can be implemented as an electronic device, such as Fig.15 As shown, the electronic device may include a storage component 1501 and a processing component 1502;

[0365] The storage component 1501 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 1502 .

[0366] The processing component 1502 is used to:

[0367] receiving at least one sending message currently cached in a third sending queue sent by a sending end;

[0368] Processing the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages;

[0369] Buffering the one or more reply messages in a fourth sending queue;

[0370] At least one reply message currently buffered in the fourth sending queue is sent to the sending end.

[0371] The processing component 1502 may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0372] The storage component 1501 is configured to store various types of data to support operations in the electronic device. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0373] Of course, the electronic device may also include other components, such as input / output interfaces, communication components, etc.

[0374] The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc.

[0375] The communication component is configured to facilitate, among other things, wired or wireless communications between the electronic device and other devices.

[0376] Among them, the electronic device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the electronic device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.

[0377] The present application also provides a computer-readable storage medium storing a computer program, wherein the computer program can achieve the above-mentioned Figure 6 The network communication method of the illustrated embodiment.

[0378] In addition, in combination with the above description, from an overall perspective, the embodiment of the present application further provides a network communication method, including:

[0379] The sending end caches the sending message to be sent in the first sending queue corresponding to the receiving end;

[0380] The sending end detects whether the first sending queue is in a first state;

[0381] If the first sending queue is in the first state, the sending end sends at least one sending message currently buffered in the first sending queue to the receiving end, and switches the first sending queue to the second state;

[0382] The receiving end processes the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages;

[0383] The receiving end caches the one or more reply messages in a second sending queue;

[0384] The receiving end sends at least one reply message currently buffered in the second sending queue to the sending end;

[0385] The sending end receives a reply message to the at least one sent message, clears the at least one sent message in the first sending queue, and switches the first sending queue to the first state.

[0386] The specific operations performed by the sending end and the receiving end can be found in the above description and will not be repeated here.

[0387] In addition, an embodiment of the present application further provides a network communication system, including a transmitting end and a receiving end;

[0388] The sending end is used to cache the send message to be sent in the first send queue corresponding to the receiving end; detect whether the first send queue is in the first state; if the first send queue is in the first state, send at least one send message currently cached in the first send queue to the receiving end, and switch the first send queue to the second state; receive a reply message from the receiving end to the at least one send message, clear the at least one send message in the first send queue, and switch the first send queue to the first state;

[0389] The receiving end is used to receive at least one sending message currently cached in the first sending queue sent by the sending end; process the at least one sending message in sequence according to the cache order of the at least one sending message to obtain one or more reply messages; cache the one or more reply messages in the second sending queue; and send at least one reply message currently cached in the second sending queue to the sending end.

[0390] The specific operations performed by the sending end and the receiving end can be found in the above description and will not be repeated here.

[0391] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0392] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0393] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0394] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A network communication method, characterized in that: include: The sending end caches the to-be-sent message in a first sending queue corresponding to the receiving end, wherein the first sending queue is provided with a first sending field, and the first sending field is used to store the maximum message sequence number of the cached message in the first sending queue; Detecting whether the first sending queue is in a first state; If the first sending queue is in the first state, sending at least one sending message currently buffered in the first sending queue to the receiving end, and switching the first sending queue to the second state; receiving a reply message from the receiving end to the at least one sent message and a second received field value, clearing the at least one sent message in the first sent queue, and switching the first sent queue to the first state when the second received field value is the same as the first sent field value, the second received field being used to store the maximum message sequence number among the sent messages sent by the sending end that have been processed by the receiving end; The initial state of the first sending queue is the first state, and the first state refers to a state in which messages can be sent; when the first sending queue is in the second state, messages cannot be sent.

2. The method according to claim 1, characterized in that Also includes: If a reply message from the receiving end to at least one message is not received within a predetermined time after at least one sending message currently cached in the first sending queue is sent to the receiving end, at least one sending message currently cached in the first sending queue is forcibly sent to the receiving end.

3. The method according to claim 1, characterized in that Also includes: According to the cache order, a message sequence number is set for each send message cached in the send queue; wherein the receiving end processes the at least one send message in sequence according to the cache order indicated by the message sequence number of the at least one send message.

4. The method according to claim 3, characterized in that: The step of setting a message sequence number for each send message in the send queue according to the cache order includes: According to the cache order, message sequence numbers are set for each send message cached in the first send queue using consecutive numbers starting from number 1.

5. The method according to claim 4, characterized in that Also includes: Setting a first sending field for the first sending queue; wherein the first sending field is used to store the maximum message sequence number of the cached messages in the first sending queue; The receiving a reply message from the receiving end to at least one message, clearing the at least one sent message in the sending queue, and switching the sending queue to the first state includes: Receive at least one reply message and a second receiving field value sent by the receiving end; wherein the second receiving field is used to store the maximum message sequence number among the sending messages sent by the sending end that have been processed by the receiving end; If the second receiving field value is the same as the first sending field value, switch the first sending queue to the first state, and clear the reply messages corresponding to the message sequence numbers less than or equal to the second receiving field value in the first sending queue.

6. The method according to claim 5, characterized in that Also includes: If the second receiving field value is different from the first sending field value, clear the sending messages corresponding to the message sequence numbers less than or equal to the second receiving field value in the first sending queue.

7. The method according to claim 5, characterized in that Also includes: A first receiving field is set for the first sending queue; wherein the first receiving field is used to store the maximum message sequence number of the reply message sent by the receiving end and received by the sending end; the receiving end maintains a second sending queue for the sending end to cache the reply message to be sent to the sending end; When sending at least one sending message currently cached in the first sending queue to the receiving end, the first receiving field value is sent to the receiving end so that the receiving end can clear the reply messages corresponding to each message sequence number less than or equal to the first receiving field in the second sending queue.

8. The method according to claim 1, characterized in that The sending end maintains corresponding sending queues for different receiving ends respectively.

9. The method according to claim 1, characterized in that: The sending end buffers the to-be-sent message in a first sending queue corresponding to the receiving end, including: Determining a message type of a send message to be sent; Determine a first sending queue corresponding to the message type from a plurality of sending queues maintained for the receiving end; wherein the sending end maintains a plurality of first sending queues corresponding to different message types for the same receiving end; The send message to be sent is cached in a first send queue corresponding to the message type.

10. A network communication method, characterized in that: include: The receiving end receives at least one sending message currently cached in a first sending queue sent by the sending end and a first receiving field value, wherein the first receiving field value is used to store the maximum message sequence number in the reply message sent by the receiving end that has been received by the sending end; Processing the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages; caching the one or more reply messages in a second sending queue, wherein the second sending queue is provided with a second sending field, and the second sending field is used to store the maximum message sequence number of the reply message currently cached in the second sending queue; Sending at least one reply message currently buffered in the second sending queue to the sending end; The sending of at least one reply message currently buffered in the second sending queue to the sending end comprises: Detecting whether the second sending queue is in a first state; wherein, when receiving a sending message from the sending end, switching the second sending queue to the first state; If the second sending queue is in the first state, at least one reply message currently cached in the second sending queue is sent to the sending end, and when the second sending field value is the same as the first receiving field value, the first sending queue is switched to the second state, wherein the first state refers to a message sendable state; when the second sending queue is in the second state, messages cannot be sent.

11. The method according to claim 10, characterized in that Also includes: According to the cache order, message sequence numbers are set for each reply message cached in the second sending queue using consecutive numbers starting from number 1.

12. The method according to claim 11, characterized in that Also includes Setting a second sending field for the second sending queue; wherein the second sending field is used to store the maximum message sequence number of the reply message currently cached in the second sending queue; The at least one sending message currently cached in the first sending queue sent by the receiving sending end includes: Receive at least one send message currently cached in a first send queue sent by a sender and a first receive field value; wherein the first receive field value is used to store the maximum message sequence number in the reply message sent by the receiving end that has been received by the sender; Clear the messages corresponding to the message sequence numbers that are less than or equal to the first receiving field value in the second sending queue.

13. A network communication method, characterized in that: include: The sender determines the message to be sent; Searching a third sending queue in a first state from a plurality of sending queues, wherein the third sending queue is provided with a first sending field, and the first sending field is used to store a maximum message sequence number of cached messages in the third sending queue; Buffering the sent message in the third sending queue; Sending at least one send message currently cached in the third send queue to the receiving end, and switching the third send queue to the second state; receiving a reply message from the receiving end to the at least one sent message and a second received field value, removing the at least one sent message from the third sent queue, and switching the third sent queue to the first state when the second received field value is the same as the first sent field value, the second received field being used to store the maximum message sequence number among the sent messages sent by the sending end that have been processed by the receiving end; The initial state of the third sending queue is the first state, and the first state refers to a state in which messages can be sent; when the third sending queue is in the second state, messages cannot be sent.

14. The method according to claim 13, characterized in that Also includes: If no reply message from the receiving end is received within a predetermined time after the at least one sending message is sent to the receiving end, at least one sending message currently buffered in the third sending queue is forcibly sent to the receiving end.

15. The method according to claim 13, characterized in that Also includes: If the multiple sending queues are all in the second state, selecting any one sending queue; Buffering the sent message in any one of the sending queues; Sending at least one send message currently buffered in any one of the send queues to the receiving end; Upon receiving a reply message to the at least one sent message, switching any one of the sending queues to the first state.

16. The method according to claim 13, characterized in that Also includes: According to the cache order, message sequence numbers are set for each send message cached in the third send queue using consecutive numbers starting from number 1.

17. The method according to claim 16, characterized in that Also includes: Setting a first sending field for the third sending queue; wherein the first sending field is used to store the maximum message sequence number of the cached messages in the third sending queue; The receiving a reply message from the receiving end to the at least one sent message, clearing the sent message from the third sending queue, and switching the third sending queue to the first state includes: Receive at least one reply message and a second receiving field value sent by the receiving end; wherein the second receiving field is used to store the maximum message sequence number among the sending messages sent by the sending end that have been processed by the receiving end; If the second receiving field value is the same as the first sending field value, switch the third sending queue to the first state, and clear the sending messages corresponding to each message sequence number less than or equal to the second receiving field value in the third sending queue.

18. The method according to claim 16, characterized in that Also includes: A first receiving field is set for the third sending queue; wherein the first receiving field is used to store the maximum message sequence number of the reply message sent by the receiving end and received by the sending end; the receiving end maintains a fourth sending queue for the sending end to cache the reply message to be sent to the sending end; While sending at least one sending message currently cached in the third sending queue to the receiving end, the first receiving field value is sent to the receiving end so that the receiving end can clear the reply messages corresponding to each message sequence number less than or equal to the first receiving field in the fourth sending queue.

19. The method according to claim 13, characterized in that Also includes: Setting a list of available resources based on the queue identifiers of the multiple sending queues; When the multiple sending queues are in an initial state, sequentially storing queue identifiers of the multiple sending queues in the available resource list; After caching the sent message to the third sending queue and switching the third sending queue to the second state, the method further includes: Deleting the queue identifier of the third sending queue from the available resource list; After switching the third sending queue to the first state, the method further includes: The queue identifier of the third sending queue is stored in the available resource list.

20. The method according to claim 19, characterized in that The step of searching for a third sending queue in the first state from a plurality of sending queues comprises: Select any queue identifier from the list of available resources; A sending queue represented by any one of the queue identifiers is determined as a third sending queue.

21. A network communication method, characterized in that: include: The receiving end receives at least one currently cached sending message in the third sending queue sent by the sending end and a first receiving field value, wherein the first receiving field value is used to store the maximum message sequence number in the reply message sent by the receiving end that has been received by the sending end; Processing the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages; caching the one or more reply messages in a fourth sending queue, wherein the fourth sending queue is provided with a second sending field, and the second sending field is used to store the maximum message sequence number of the reply message currently cached in the fourth sending queue; Sending at least one reply message currently cached in the fourth sending queue to the sending end; The sending of at least one reply message currently buffered in the fourth sending queue to the sending end comprises: Detecting whether the fourth sending queue is in the first state; wherein, when receiving a sending message from the sending end, switching the fourth sending queue to the first state; If the fourth sending queue is in the first state, sending at least one reply message currently cached in the fourth sending queue to the sending end, and switching the fourth sending queue to the second state when the first receiving field value is the same as the second sending field value; The first state refers to a state in which messages can be sent; when the fourth sending queue is in the second state, messages cannot be sent.

22. A network communication device, characterized in that: include: A first cache module, used for caching a to-be-sent message in a first sending queue corresponding to a receiving end, wherein the first sending queue is provided with a first sending field, and the first sending field is used for storing a maximum message sequence number of cached messages in the first sending queue; A first detection module, used to detect whether the first sending queue is in a first state; a first sending module, configured to send at least one sending message currently cached in the first sending queue to the receiving end if the first sending queue is in the first state, and switch the first sending queue to a second state; A first processing module, configured to receive a reply message from the receiving end to the at least one sent message and a second received field value, clear the at least one sent message in the first sent queue, and switch the first sent queue to the first state when the second received field value is the same as the first sent field value, wherein the second received field is used to store a maximum message sequence number among the sent messages sent by the sending end that have been processed by the receiving end; The initial state of the first sending queue is the first state, and the first state refers to a state in which messages can be sent; when the first sending queue is in the second state, messages cannot be sent.

23. A network communication device, characterized in that: include: A first receiving module, used to receive at least one send message currently cached in a first send queue sent by a sender and a first receive field value, wherein the first receive field value is used to store the maximum message sequence number in the reply message sent by the receiving end that has been received by the sender; A second processing module, configured to sequentially process the at least one sent message according to the cache order of the at least one sent message to obtain one or more reply messages; A second cache module, used for caching the one or more reply messages into a second sending queue, wherein the second sending queue is provided with a second sending field, and the second sending field is used for storing a maximum message sequence number of the reply message currently cached in the second sending queue; A second sending module, configured to send at least one reply message currently cached in the second sending queue to the sending end; The second sending module is specifically used to detect whether the second sending queue is in a first state; wherein, when a sending message from the sending end is received, the second sending queue is switched to the first state; if the second sending queue is in the first state, at least one reply message currently cached in the second sending queue is sent to the sending end, and when the second sending field value is the same as the first receiving field value, the first sending queue is switched to the second state, wherein the first state refers to a message sendable state; when the second sending queue is in the second state, messages cannot be sent.

24. A network communication device, characterized in that: include: A message determination module, used to determine a message to be sent; A search module, used to search a third sending queue in a first state from a plurality of sending queues, wherein the third sending queue is provided with a first sending field, and the first sending field is used to store a maximum message sequence number of cached messages in the third sending queue; A third cache module, used for caching the sent message into the third sending queue; A third sending module, used for sending at least one sending message currently cached in the third sending queue to the receiving end, and switching the third sending queue to the second state; a third processing module, configured to receive a reply message from the receiving end to the at least one sent message and a second received field value, clear the sent message from the third sending queue, and switch the third sending queue to the first state when the second received field value is the same as the first sent field value, wherein the second received field is used to store a maximum message sequence number among the sent messages sent by the sending end that have been processed by the receiving end; The initial state of the third sending queue is the first state, and the first state refers to a state in which messages can be sent; when the third sending queue is in the second state, messages cannot be sent.

25. A network communication device, characterized in that: include: A second receiving module, used to receive at least one send message currently cached in a third send queue sent by a sender and a first receive field value, wherein the first receive field value is used to store a maximum message sequence number in a reply message sent by the receiving end that has been received by the sender; A fourth processing module, configured to sequentially process the at least one sent message according to the cache order of the at least one sent message to obtain one or more reply messages; a fourth cache module, used to cache the one or more reply messages in a fourth sending queue, wherein the fourth sending queue is provided with a second sending field, and the second sending field is used to store the maximum message sequence number of the reply message currently cached in the fourth sending queue; a fourth sending module, configured to send at least one reply message currently cached in the fourth sending queue to the sending end; The fourth sending module is specifically used to detect whether the fourth sending queue is in the first state; wherein, when receiving a sending message from the sending end, the fourth sending queue is switched to the first state; if the fourth sending queue is in the first state, at least one reply message currently cached in the fourth sending queue is sent to the sending end, and the fourth sending queue is switched to the second state when the first receiving field value is the same as the second sending field value; wherein, the first state refers to a message sendable state; and messages cannot be sent when the fourth sending queue is in the second state.

26. An electronic device, characterized in that: including a processing component and a storage component; The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component; The processing component is used to: Cache the to-be-sent message in a first sending queue corresponding to the receiving end, wherein the first sending queue is provided with a first sending field, and the first sending field is used to store the maximum message sequence number of the cached message in the first sending queue; Detecting whether the first sending queue is in a first state; If the first sending queue is in the first state, sending at least one sending message currently buffered in the first sending queue to the receiving end, and switching the first sending queue to the second state; receiving a reply message from the receiving end to the at least one sent message and a second received field value, clearing the at least one sent message in the first sent queue, and switching the first sent queue to the first state when the second received field value is the same as the first sent field value, the second received field being used to store the maximum message sequence number among the sent messages sent by the sending end that have been processed by the receiving end; The initial state of the first sending queue is the first state, and the first state refers to a state in which messages can be sent; when the first sending queue is in the second state, messages cannot be sent.

27. An electronic device, characterized in that: including a processing component and a storage component; The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component; The processing component is used to: Receive at least one send message currently cached in a first send queue sent by a sender and a first receive field value, wherein the first receive field value is used to store a maximum message sequence number in a reply message sent by the receiving end that has been received by the sender; Processing the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages; caching the one or more reply messages in a second sending queue, wherein the second sending queue is provided with a second sending field, and the second sending field is used to store the maximum message sequence number of the reply message currently cached in the second sending queue; Sending at least one reply message currently buffered in the second sending queue to the sending end; The sending of at least one reply message currently buffered in the second sending queue to the sending end comprises: Detecting whether the second sending queue is in a first state; wherein, when receiving a sending message from the sending end, switching the second sending queue to the first state; If the second sending queue is in the first state, at least one reply message currently cached in the second sending queue is sent to the sending end, and when the second sending field value is the same as the first receiving field value, the first sending queue is switched to the second state, wherein the first state refers to a message sendable state; when the second sending queue is in the second state, messages cannot be sent.

28. An electronic device, characterized in that: including a processing component and a storage component; The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component; The processing component is used to: Determine the send message to be sent; Searching a third sending queue in a first state from a plurality of sending queues, wherein the third sending queue is provided with a first sending field, and the first sending field is used to store a maximum message sequence number of cached messages in the third sending queue; Buffering the sent message in the third sending queue; Sending at least one send message currently cached in the third send queue to the receiving end, and switching the third send queue to the second state; receiving a reply message from the receiving end to the at least one sent message and a second received field value, removing the at least one sent message from the third sent queue, and switching the third sent queue to the first state when the second received field value is the same as the first sent field value, the second received field being used to store the maximum message sequence number among the sent messages sent by the sending end that have been processed by the receiving end; The initial state of the third sending queue is the first state, and the first state refers to a state in which messages can be sent; when the third sending queue is in the second state, messages cannot be sent.

29. An electronic device, characterized in that: including a processing component and a storage component; The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component; The processing component is used to: Receive at least one send message currently cached in a third send queue sent by a sender and a first receive field value, wherein the first receive field value is used to store a maximum message sequence number in a reply message sent by the receiving end that has been received by the sender; Processing the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages; caching the one or more reply messages in a fourth sending queue, wherein the fourth sending queue is provided with a second sending field, and the second sending field is used to store the maximum message sequence number of the reply message currently cached in the fourth sending queue; Sending at least one reply message currently cached in the fourth sending queue to the sending end; The sending of at least one reply message currently buffered in the fourth sending queue to the sending end comprises: Detecting whether the fourth sending queue is in the first state; wherein, when receiving a sending message from the sending end, switching the fourth sending queue to the first state; If the fourth sending queue is in the first state, sending at least one reply message currently cached in the fourth sending queue to the sending end, and switching the fourth sending queue to the second state if the first receiving field value is the same as the second sending field value; The first state refers to a state in which messages can be sent; when the fourth sending queue is in the second state, messages cannot be sent.

30. A network communication method, characterized in that: include: The sending end caches the to-be-sent message in a first sending queue corresponding to the receiving end, wherein the first sending queue is provided with a first sending field, and the first sending field is used to store the maximum message sequence number of the cached message in the first sending queue; The sending end detects whether the first sending queue is in a first state; If the first sending queue is in the first state, the sending end sends at least one sending message currently buffered in the first sending queue to the receiving end, and switches the first sending queue to the second state; The receiving end processes the at least one sent message in sequence according to the cache order of the at least one sent message to obtain one or more reply messages; The receiving end caches the one or more reply messages in a second sending queue; The receiving end sends at least one reply message currently buffered in the second sending queue to the sending end; The sending end receives a reply message and a second receiving field value for the at least one sent message, clears the at least one sent message in the first sending queue, and switches the first sending queue to the first state when the second receiving field value is the same as the first sending field value, the second receiving field being used to store the maximum message sequence number among the sent messages sent by the sending end that have been processed by the receiving end; The initial state of the first sending queue is the first state, and the first state refers to a state in which messages can be sent; when the first sending queue is in the second state, messages cannot be sent.

31. A network communication system, characterized in that: Including the sending end and the receiving end; The sending end is used to cache the sending message to be sent in the first sending queue corresponding to the receiving end, the first sending queue is provided with a first sending field, and the first sending field is used to store the maximum message sequence number of the cached messages in the first sending queue; detect whether the first sending queue is in a first state; if the first sending queue is in the first state, send at least one sending message currently cached in the first sending queue to the receiving end, and switch the first sending queue to a second state; receive a reply message and a second receiving field value from the receiving end to the at least one sending message, clear the at least one sending message in the first sending queue, and switch the first sending queue to the first state when the second receiving field value is the same as the first sending field value, the second receiving field is used to store the maximum message sequence number of the sending message sent by the sending end that has been processed by the receiving end; The receiving end is used to receive at least one sending message currently cached in a first sending queue sent by the sending end and a first receiving field value, the first receiving field value is used to store the maximum message sequence number in the reply message sent by the receiving end that has been received by the sending end; according to the cache order of the at least one sending message, the at least one sending message is processed in sequence to obtain one or more reply messages; the one or more reply messages are cached in a second sending queue, the second sending queue is provided with a second sending field, the second sending field is used to store the maximum message sequence number of the reply message currently cached in the second sending queue; and the at least one reply message currently cached in the second sending queue is sent to the sending end; The process of sending at least one reply message currently cached in the second sending queue to the sending end includes: detecting whether the second sending queue is in a first state; wherein, upon receiving a sending message from the sending end, switching the second sending queue to the first state; if the second sending queue is in the first state, sending at least one reply message currently cached in the second sending queue to the sending end, and when the second sending field value is the same as the first receiving field value, switching the first sending queue to the second state, wherein the first state refers to a message sendable state; and messages cannot be sent when the second sending queue is in the second state.