CN113157465B - Message sending method and device based on pointer linked list - Google Patents

Message sending method and device based on pointer linked list Download PDF

Info

Publication number
CN113157465B
CN113157465B CN202110445792.3A CN202110445792A CN113157465B CN 113157465 B CN113157465 B CN 113157465B CN 202110445792 A CN202110445792 A CN 202110445792A CN 113157465 B CN113157465 B CN 113157465B
Authority
CN
China
Prior art keywords
descriptor
pointer
sending
state
packet
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110445792.3A
Other languages
Chinese (zh)
Other versions
CN113157465A (en
Inventor
任秀江
曹志强
卢宏生
斯添浩
牟华先
周舟
李扬
冯冬明
周建毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi Jiangnan Computing Technology Institute
Original Assignee
Wuxi Jiangnan Computing Technology Institute
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuxi Jiangnan Computing Technology Institute filed Critical Wuxi Jiangnan Computing Technology Institute
Priority to CN202110445792.3A priority Critical patent/CN113157465B/en
Publication of CN113157465A publication Critical patent/CN113157465A/en
Application granted granted Critical
Publication of CN113157465B publication Critical patent/CN113157465B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

The embodiment of the invention provides a message sending method and a device based on a pointer linked list, wherein the method comprises the following steps: when the same asynchronous information sending queue is detected, adding a pointer linked list into the same asynchronous information sending queue; acquiring current sending packets in the same asynchronous information sending queue, allocating serial numbers to the current sending packets according to a preset sending sequence, acquiring descriptors corresponding to the current sending packets, and allocating corresponding suspension buffer numbers according to the descriptors; determining a head pointer and a tail pointer of a pointer linked list according to the head and the tail in the hanging buffer numbers; when detecting that the new descriptor is subjected to suspension buffering, modifying the next of the descriptor corresponding to the current tail pointer into the new descriptor, and modifying the position of the tail pointer into the new descriptor; and receiving response packets corresponding to all the descriptors to finish the same asynchronous information transmission. By adopting the method, the correct message sequence transmitted by multiple ports among the nodes can be ensured, the concurrency of the messages can be fully exerted, and the processing efficiency of the message engine is improved.

Description

Message sending method and device based on pointer linked list
Technical Field
The invention relates to the technical field of chip information transmission, in particular to a message transmission method and device based on a pointer linked list.
Background
The NIC chip is mainly used for a high-performance computing system and a high-speed data center, is an interface for connecting a CPU with a high-speed network, and realizes the sending and receiving of messages between nodes.
The rapid development of the current integrated circuit leads to the great improvement of the computing power of a CPU processor chip, and the improvement of the communication bandwidth of the interconnection network always depends on the improvement of the transmission rate of high-speed signals and is far behind the communication requirement of the CPU processor. In order to increase the communication bandwidth of the CPU processor, a multi-port mechanism is mostly adopted in modern NIC chips, that is, multiple network ports are configured on one NIC chip, and the communication bandwidth of a single NIC chip is increased by multiple network ports concurrently. The multi-network port structure design has the advantages that the message transmission bandwidth is improved by simultaneously using a plurality of network transmission channels, but the plurality of network ports are independent from each other when transmitting messages, so that the problem that the message sequence cannot be ensured is caused.
For example, node a sends two messages, message 1 and message 2, to B in sequence, a sends message 1 using channel 1 and channel 2 sends message 2, and due to congestion in channel 1, the order of arrival of the two messages at B becomes that message 2 arrives before message 1. Therefore, the sequence of messages received by the node B is not consistent with the sequence of messages sent by the node A, and the sequence of messages received by the node A is not consistent with the sequence of message sending, which may cause the change of communication semantics and further cause the error of program operation results. If a simple blocking manner is adopted, that is, the node a sends the message 1 first and then sends the message 2 after the message is completely finished, although the order between the message 1 and the message 2 can be ensured, the efficiency of message transmission can be reduced because the message 1 and the message 2 are completely executed in series. Especially, when there are messages to be sent to other nodes after the message 1 of the node a, the message sent to the node B should not block the message processing sent to other nodes, which also greatly reduces the efficiency of message transmission.
Therefore, solving the problem of message order of the multiport interconnection network system is an urgent problem to improve communication performance and ensure correct communication semantics.
Disclosure of Invention
Aiming at the problems in the prior art, the embodiment of the invention provides a message sending method and device based on a pointer linked list.
The embodiment of the invention provides a message sending method based on a pointer linked list, which comprises the following steps:
when the same asynchronous information sending queue is detected, adding a pointer linked list into the same asynchronous information sending queue;
acquiring current sending packets in the same asynchronous information sending queue, distributing sequence numbers for the current sending packets according to a preset sending sequence, acquiring descriptors corresponding to the current sending packets, and distributing corresponding suspension buffer numbers according to the descriptors;
determining a head pointer and a tail pointer of the pointer linked list according to the head and the tail in the suspension buffer serial number;
when detecting that a new descriptor is subjected to suspension buffering, modifying the next of the descriptor corresponding to the current tail pointer into the new descriptor, and modifying the position of the tail pointer into the new descriptor;
and when response packets corresponding to all the descriptors are received, the same asynchronous information transmission is completed.
In one embodiment, the method further comprises:
detecting the state of a descriptor corresponding to the current tail pointer;
when the descriptor corresponding to the current tail pointer is in a packet sending state, setting the new descriptor to be in a pause state;
and when the descriptor corresponding to the current tail pointer is in a waiting response state, setting the new descriptor to be in a packet sending state.
In one embodiment, the method further comprises:
when detecting that the condition of response packet loss exists in the sending process of the same asynchronous information, acquiring a next descriptor of a loss descriptor with the condition of response packet loss;
and acquiring a response packet of the next descriptor, starting from the head pointer according to the response packet of the next descriptor, completing all descriptors before the lost descriptor, and updating the head pointer to the next descriptor of the lost descriptor.
In one embodiment, the method further comprises:
when the condition that the response packet does not respond in the same asynchronous information sending process is detected, obtaining an unresponsive descriptor with the unresponsive condition, and scheduling the unresponsive descriptor to be in a retransmission state;
and acquiring a next descriptor of the unresponsive descriptor, modifying the next descriptor of the unresponsive descriptor into a packet waiting state, and updating the head pointer to the unresponsive descriptor.
In one embodiment, the method further comprises:
when detecting that the overtime retransmission phenomenon occurs in the same asynchronous information sending process, sequentially judging whether the descriptors are in a packet sending state or not from the descriptors corresponding to the head pointer to the descriptors corresponding to the tail pointer;
when the descriptors are all in a waiting response state, information retransmission is carried out;
and when the existing descriptor is in the packet sending state, waiting for the packet sending state in the descriptor to end, and then retransmitting the information.
In one embodiment, the method further comprises:
and adjusting the size of the pointer linked list according to the number of the suspended and buffered entries.
The embodiment of the invention provides a message sending device based on a pointer linked list, which comprises:
the detection module is used for adding a pointer linked list to the same asynchronous information sending queue when the same asynchronous information sending queue is detected;
an obtaining module, configured to obtain a current transmission packet in the same asynchronous information transmission queue, allocate a sequence number to the current transmission packet according to a preset transmission sequence, obtain a descriptor corresponding to the current transmission packet, and allocate a corresponding suspension buffer number according to the descriptor;
the pointer determining module is used for determining a head pointer and a tail pointer of the pointer linked list according to the head and the tail in the hanging buffer numbers;
a modifying module, configured to modify, when detecting that a new descriptor is subjected to suspension buffering, a next of the descriptor corresponding to the current tail pointer to be the new descriptor, and modify the position of the tail pointer to be the new descriptor;
and the receiving module is used for finishing the same asynchronous information transmission when receiving the response packets corresponding to all the descriptors.
In one embodiment, the apparatus further comprises:
the second detection module is used for detecting the state of the descriptor corresponding to the current tail pointer;
the first state module is used for setting the new descriptor to be in a pause state when the descriptor corresponding to the current tail pointer is in a packet sending state;
and the second state module is used for setting the new descriptor to be in a packet sending state when the descriptor corresponding to the current tail pointer is in a waiting response state.
The embodiment of the invention provides electronic equipment, which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the steps of the message sending method based on the pointer linked list when executing the program.
Embodiments of the present invention provide a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the above-mentioned message sending method based on a pointer linked list.
According to the message sending method and device based on the pointer linked list, provided by the embodiment of the invention, when the same asynchronous message sending queue is detected, the pointer linked list is added into the same asynchronous message sending queue; acquiring current sending packets in the same asynchronous information sending queue, distributing a sequence number for the current sending packets according to a preset sending sequence, acquiring descriptors corresponding to the current sending packets, and distributing corresponding hanging buffer numbers according to the descriptors; determining a head pointer and a tail pointer of the pointer linked list according to the head and the tail in the hanging buffer serial number; when detecting that the new descriptor is subjected to suspension buffering, modifying the next of the descriptor corresponding to the current tail pointer into the new descriptor, and modifying the position of the tail pointer into the new descriptor; and when response packets corresponding to all the descriptors are received, the same asynchronous information transmission is completed. Therefore, the correct message sequence sent by multiple ports among the nodes can be ensured, the concurrency of the messages can be fully exerted, and the processing efficiency of the message engine is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart of a method for sending messages based on a pointer linked list according to an embodiment of the present invention;
FIG. 2 is a block diagram of a pointer linked list based message sending apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device in an embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic flow chart of a method for circulating customized furniture informatization management and control information flow according to an embodiment of the present invention, and as shown in fig. 1, an embodiment of the present invention provides a method for circulating customized furniture informatization management and control information flow, including:
step S101, when the same asynchronous information sending queue is detected, adding a pointer linked list into the same asynchronous information sending queue.
Specifically, when detecting that the NIC chip has non-blocking transmission of messages in the same asynchronous message transmission queue, a pointer linked list is added to the same asynchronous message transmission queue, and a situation that multiple descriptors in the same queue are transmitted to the same destination is managed by the pointer linked list.
Step S102, obtaining the current sending packet in the same asynchronous information sending queue, distributing a sequence number to the current sending packet according to a preset sending sequence, obtaining a descriptor corresponding to the current sending packet, and distributing a corresponding suspension buffer number according to the descriptor.
Specifically, the current sending packets in the same asynchronous information sending queue are obtained, and a sequence number is allocated to the current sending packet according to a preset sending sequence, for example, 3 sending packets are sent according to the sequence of 1, 2, and 3, then sequence numbers of 1, 2, and 3 are allocated to the current sending packet, and a descriptor corresponding to the current sending packet is obtained, where the descriptor is a file descriptor corresponding to the sending packet (the file descriptor is an index value and points to a record table corresponding to each sending packet by a kernel), and a corresponding suspension buffer (descriptor buffer) is allocated according to the descriptor, and a suspension buffer number is allocated to the suspension buffer, where the specific number allocation may be performed according to the number of the sending packet, so as to obtain corresponding descriptors 1, 2, and 3. In addition, the size of the pointer linked list is adjusted according to the number of the items of the suspension buffer.
And step S103, determining a head pointer and a tail pointer of the pointer linked list according to the head part and the tail part in the hanging buffer number.
Specifically, according to the current transmission packet, that is, the head pointer and the tail pointer of the determined pointer linked list corresponding to the head and the tail in the current pending buffer number, it is ensured that the current transmission packet can be transmitted according to a preset transmission sequence.
And step S104, when detecting that the new descriptor is subjected to suspension buffering, modifying the next of the descriptor corresponding to the current tail pointer into the new descriptor, and modifying the position of the tail pointer into the new descriptor.
Specifically, when detecting that the new descriptor is subjected to suspension buffering, which indicates that a new transmission packet needs to be transmitted, the processing of the transmission sequence of the new descriptor corresponding to the new newspaper delivering device includes: and modifying the next of the descriptor corresponding to the current tail pointer into a new descriptor, and modifying the position of the tail pointer into the new descriptor, wherein the next of the descriptor refers to the direction of the descriptor, for example, the next of the descriptor 1 is the descriptor 2, and when the descriptor 1 receives a response packet corresponding to the descriptor 1, correspondingly sending the descriptor 2 according to the next of the descriptor 1.
In addition, when detecting that the new descriptor is subjected to suspension buffering, the state of the new descriptor may also be adjusted, specifically: and detecting the state of the descriptor corresponding to the current tail pointer, setting the new descriptor to be in a pause state when the descriptor corresponding to the current tail pointer is in a packet sending state and indicates that the descriptor before the new descriptor is not completely sent, and setting the new descriptor to be in a packet sending state when the descriptor corresponding to the current tail pointer is in a waiting response state and indicates that the descriptor before the new descriptor is completely sent.
And step S105, when response packets corresponding to all the descriptors are received, the same asynchronous information transmission is completed.
Specifically, when response packets corresponding to all descriptors (including the current descriptor and the new descriptor) are received, the response packets corresponding to all descriptors are confirmed, the confirmation ensures that the response packets are invented according to a preset sequence, and the step of completing the sending of the same asynchronous information is also shown when the information needing to be transmitted is completely transmitted.
According to the message sending method based on the pointer linked list, provided by the embodiment of the invention, when the same asynchronous message sending queue is detected, the pointer linked list is added into the same asynchronous message sending queue; acquiring current sending packets in the same asynchronous information sending queue, distributing a sequence number for the current sending packets according to a preset sending sequence, acquiring a descriptor corresponding to the current sending packets, and distributing a corresponding suspension buffer number according to the descriptor; determining a head pointer and a tail pointer of the pointer linked list according to the head and the tail in the hanging buffer serial number; when detecting that the new descriptor is subjected to suspension buffering, modifying the next of the descriptor corresponding to the current tail pointer into a new descriptor, and modifying the position of the tail pointer into the new descriptor; and when response packets corresponding to all the descriptors are received, the same asynchronous information transmission is completed. Therefore, the correct message sequence sent by multiple ports among the nodes can be ensured, the concurrency of the messages can be fully exerted, and the processing efficiency of the message engine is improved.
On the basis of the foregoing embodiment, the pointer linked list-based message sending method further includes:
when detecting that the condition of response packet loss exists in the sending process of the same asynchronous information, acquiring a next descriptor of a loss descriptor with the condition of response packet loss;
and acquiring a response packet of the next descriptor, starting from the head pointer according to the response packet of the next descriptor, completing all descriptors before the lost descriptor, and updating the head pointer to the next descriptor of the lost descriptor.
In the embodiment of the present invention, in the same asynchronous information sending process of a sending packet, a situation that a response packet corresponding to a certain descriptor is lost may occur, where the situation that the response packet is lost may be that when it is detected that the reply sequence of the response packet is different from the sending sequence of the corresponding descriptor, it indicates that the response packet is lost, a next descriptor of a lost descriptor in the situation that the response packet is lost is obtained, a response packet of the next descriptor is obtained, according to a merging confirmation principle of responses, all descriptors (including the lost descriptor) before the next descriptor (including the lost descriptor) are completed, that is, sending is completed, and then a head pointer is updated to the next descriptor of the lost descriptor.
In addition, in the same asynchronous information transmission process of the transmission packet, it may also occur, for example, if the response packet includes a retransmission instruction for the descriptor, the descriptor corresponding to the response packet is a retransmission descriptor, a retransmission descriptor with the retransmission instruction is obtained, the retransmission descriptor is scheduled to be in a retransmission state, a next descriptor of the retransmission descriptor is obtained, the next descriptor of the retransmission descriptor is modified to be in a packet waiting state, the retransmission is performed, and the head pointer is updated to the retransmission descriptor.
In addition, in the same asynchronous information sending process of sending packets, the situation of overtime retransmission may also occur, if overtime retransmission occurs, it needs to judge whether any descriptor is in a packet sending state from the descriptor where the head pointer is located, if all descriptors are in a waiting response state, retransmission can be started, otherwise, the state of the self is set to suspend the waiting packet sending state. The retransmission end checks whether the subsequent descriptor is in a waiting packet sending state, if so, the subsequent descriptor is scheduled to start the packet sending.
The embodiment of the invention correspondingly processes the conditions of response packet loss, response packet non-response and overtime retransmission which may occur in the same asynchronous information sending process, and ensures that the message sequence sent by adopting multiple ports among the nodes is correct.
Fig. 2 is a message sending apparatus based on a pointer linked list according to an embodiment of the present invention, including: the device comprises a detection module S201, an acquisition module S202, a pointer determination module S203, a modification module S204 and a receiving module S205, wherein:
the detecting module S201 is configured to add a pointer linked list to the same asynchronous information sending queue when the same asynchronous information sending queue is detected.
An obtaining module S202, configured to obtain a current sending packet in the same asynchronous information sending queue, allocate a sequence number to the current sending packet according to a preset sending sequence, obtain a descriptor corresponding to the current sending packet, and allocate a corresponding hanging buffer number according to the descriptor.
And the pointer determining module S203 is configured to determine a head pointer and a tail pointer of the pointer linked list according to the head and the tail in the suspension buffer number.
A modifying module S204, configured to modify, when it is detected that the new descriptor is subjected to suspension buffering, the next of the descriptor corresponding to the current tail pointer to be the new descriptor, and modify the position of the tail pointer to be the new descriptor.
The receiving module S205 is configured to complete sending the same asynchronous information when receiving response packets corresponding to all the descriptors.
In one embodiment, the apparatus may further comprise:
and the second detection module is used for detecting the state of the descriptor corresponding to the current tail pointer.
And the first state module is used for setting the new descriptor to be in a pause state when the descriptor corresponding to the current tail pointer is in a packet sending state.
And the second state module is used for setting the new descriptor to be in a packet sending state when the descriptor corresponding to the current tail pointer is in a waiting response state.
In one embodiment, the apparatus may further comprise:
a third detecting module, configured to, when it is detected that there is a response packet loss in the sending process of the same asynchronous information, obtain a next descriptor of a loss descriptor where there is the response packet loss.
And a second obtaining module, configured to obtain a response packet of the next descriptor, start from the head pointer according to the response packet of the next descriptor, and complete all descriptors of the missing descriptor, and update the head pointer to the next descriptor of the missing descriptor.
In one embodiment, the apparatus may further comprise:
a fourth detecting module, configured to, when it is detected that there is a case where the response packet is not responded in the sending process of the same asynchronous information, obtain an unresponsive descriptor where there is an unresponsive case, and schedule the unresponsive descriptor in a retransmission state.
And the third acquisition module is used for acquiring the next descriptor of the unresponsive descriptor, modifying the next descriptor of the unresponsive descriptor into a packet waiting state, and updating the head pointer to the unresponsive descriptor.
In one embodiment, the apparatus may further comprise:
and the fifth detection module is used for sequentially judging whether the descriptors are in a packet sending state or not from the descriptor corresponding to the head pointer to the descriptor corresponding to the tail pointer when the phenomenon of overtime retransmission in the same asynchronous information sending process is detected.
And the retransmission module is used for retransmitting the information when the descriptors are in a waiting response state.
And the waiting module is used for waiting for the completion of the packet sending state of the descriptor when the descriptor exists in the packet sending state, and then retransmitting the information.
For specific limitations of the pointer-linked-list-based message sending device, reference may be made to the above limitations on the circulation method of the customized furniture informatization management and control information flow, and details are not described here again. The modules in the above-mentioned pointer linked list-based message sending apparatus may be implemented wholly or partially by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
Fig. 3 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 3: a processor (processor) 301, a memory (memory) 302, a communication Interface (Communications Interface) 303 and a communication bus 304, wherein the processor 301, the memory 302 and the communication Interface 303 complete communication with each other through the communication bus 304. The processor 301 may call logic instructions in the memory 302 to perform the following method: when the same asynchronous information sending queue is detected, adding a pointer linked list into the same asynchronous information sending queue; acquiring current sending packets in the same asynchronous information sending queue, distributing a sequence number for the current sending packets according to a preset sending sequence, acquiring a descriptor corresponding to the current sending packets, and distributing a corresponding suspension buffer number according to the descriptor; determining a head pointer and a tail pointer of the pointer linked list according to the head and the tail in the hanging buffer serial number; when detecting that the new descriptor is subjected to suspension buffering, modifying the next of the descriptor corresponding to the current tail pointer into the new descriptor, and modifying the position of the tail pointer into the new descriptor; and when response packets corresponding to all the descriptors are received, the same asynchronous information transmission is completed.
Furthermore, the logic instructions in the memory 302 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention or a part thereof which substantially contributes to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
In another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform the transmission method provided in the foregoing embodiments when executed by a processor, for example, the method includes: when the same asynchronous information sending queue is detected, adding a pointer linked list into the same asynchronous information sending queue; acquiring current sending packets in the same asynchronous information sending queue, distributing a sequence number for the current sending packets according to a preset sending sequence, acquiring a descriptor corresponding to the current sending packets, and distributing a corresponding suspension buffer number according to the descriptor; determining a head pointer and a tail pointer of the pointer linked list according to the head and the tail in the hanging buffer serial number; when detecting that the new descriptor is subjected to suspension buffering, modifying the next of the descriptor corresponding to the current tail pointer into the new descriptor, and modifying the position of the tail pointer into the new descriptor; and when response packets corresponding to all the descriptors are received, the same asynchronous information transmission is completed.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (7)

1. A message sending method based on a pointer linked list is characterized by comprising the following steps:
when the same asynchronous information sending queue is detected, adding a pointer linked list into the same asynchronous information sending queue;
acquiring current sending packets in the same asynchronous information sending queue, distributing sequence numbers for the current sending packets according to a preset sending sequence, acquiring descriptors corresponding to the current sending packets, and distributing corresponding suspension buffer numbers according to the descriptors;
determining a head pointer and a tail pointer of the pointer linked list according to the head and the tail in the suspension buffer serial number;
when detecting that a new descriptor is subjected to suspension buffering, modifying the next of the descriptor corresponding to the current tail pointer into the new descriptor, and modifying the position of the tail pointer into the new descriptor;
when response packets corresponding to all descriptors are received, the same asynchronous information transmission is completed;
when detecting that the condition of response packet loss exists in the sending process of the same asynchronous information, acquiring a next descriptor of a loss descriptor with the condition of response packet loss;
acquiring a response packet of the next descriptor, completing all descriptors before the lost descriptor from the head pointer according to the response packet of the next descriptor, and updating the head pointer to the next descriptor of the lost descriptor;
when the condition that the response packet does not respond in the same asynchronous information sending process is detected, obtaining an unresponsive descriptor with the unresponsive condition, and scheduling the unresponsive descriptor to be in a retransmission state;
acquiring a next descriptor of the unresponsive descriptor, modifying the next descriptor of the unresponsive descriptor into a packet waiting state, and updating the head pointer to the unresponsive descriptor;
when detecting that the overtime retransmission phenomenon occurs in the same asynchronous information sending process, sequentially judging whether the descriptors are in a packet sending state or not from the descriptors corresponding to the head pointer to the descriptors corresponding to the tail pointer;
when the descriptors are all in a waiting response state, information retransmission is carried out;
and when the existing descriptor is in the packet sending state, waiting for the packet sending state in the descriptor to end, and then retransmitting the information.
2. The pointer linked list-based message sending method according to claim 1, wherein when detecting that the new descriptor is subject to suspension buffering, further comprising:
detecting the state of a descriptor corresponding to the current tail pointer;
when the descriptor corresponding to the current tail pointer is in a packet sending state, setting the new descriptor to be in a pause state;
and when the descriptor corresponding to the current tail pointer is in a waiting response state, setting the new descriptor to be in a packet sending state.
3. The method as claimed in claim 1, wherein the method further comprises:
and adjusting the size of the pointer linked list according to the number of the items of the suspension buffer.
4. An apparatus for sending messages based on a linked list of pointers, the apparatus comprising:
the detection module is used for adding a pointer linked list to the same asynchronous information sending queue when the same asynchronous information sending queue is detected;
an obtaining module, configured to obtain a current transmission packet in the same asynchronous information transmission queue, allocate a sequence number to the current transmission packet according to a preset transmission sequence, obtain a descriptor corresponding to the current transmission packet, and allocate a corresponding suspension buffer number according to the descriptor;
the pointer determining module is used for determining a head pointer and a tail pointer of the pointer linked list according to the head and the tail in the hanging buffer numbers;
a modifying module, configured to modify, when detecting that a new descriptor is subjected to suspension buffering, a next of the descriptor corresponding to the current tail pointer to be the new descriptor, and modify the position of the tail pointer to be the new descriptor;
the receiving module is used for finishing the sending of the same asynchronous information when receiving the response packets corresponding to all the descriptors;
when detecting that the condition of response packet loss exists in the sending process of the same asynchronous information, acquiring a next descriptor of a loss descriptor with the condition of response packet loss;
acquiring a response packet of the next descriptor, completing all descriptors from the head pointer to the position before the lost descriptor according to the response packet of the next descriptor, and updating the head pointer to the next descriptor of the lost descriptor;
when the condition that the response packet does not respond in the same asynchronous information sending process is detected, obtaining an unresponsive descriptor with the unresponsive condition, and scheduling the unresponsive descriptor to be in a retransmission state;
acquiring a next descriptor of the unresponsive descriptor, modifying the next descriptor of the unresponsive descriptor into a packet waiting state, and updating the head pointer to the unresponsive descriptor;
when detecting that the overtime retransmission phenomenon occurs in the same asynchronous information sending process, sequentially judging whether the descriptors are in a packet sending state or not from the descriptors corresponding to the head pointer to the descriptors corresponding to the tail pointer;
when the descriptors are all in a waiting response state, information retransmission is carried out;
and when the descriptor exists in the packet sending state, waiting for the completion of the packet sending state of the descriptor, and then retransmitting the information.
5. The pointer linked list based messaging apparatus of claim 4, wherein the apparatus further comprises:
the second detection module is used for detecting the state of the descriptor corresponding to the current tail pointer;
the first state module is used for setting the new descriptor to be in a pause state when the descriptor corresponding to the current tail pointer is in a packet sending state;
and the second state module is used for setting the new descriptor to be in a packet sending state when the descriptor corresponding to the current tail pointer is in a waiting response state.
6. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the pointer linked list based message sending method according to any one of claims 1 to 3 when executing the program.
7. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the steps of the pointer linked list based message transmission method of any one of claims 1 to 3.
CN202110445792.3A 2021-04-25 2021-04-25 Message sending method and device based on pointer linked list Active CN113157465B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110445792.3A CN113157465B (en) 2021-04-25 2021-04-25 Message sending method and device based on pointer linked list

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110445792.3A CN113157465B (en) 2021-04-25 2021-04-25 Message sending method and device based on pointer linked list

Publications (2)

Publication Number Publication Date
CN113157465A CN113157465A (en) 2021-07-23
CN113157465B true CN113157465B (en) 2022-11-25

Family

ID=76870811

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110445792.3A Active CN113157465B (en) 2021-04-25 2021-04-25 Message sending method and device based on pointer linked list

Country Status (1)

Country Link
CN (1) CN113157465B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114185693A (en) * 2021-11-22 2022-03-15 西安空间无线电技术研究所 Self-repairable multi-node aggregation shared queue management method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150304124A1 (en) * 2012-10-12 2015-10-22 Zte Corporation Message Processing Method and Device
CN106302238A (en) * 2015-05-13 2017-01-04 深圳市中兴微电子技术有限公司 A kind of queue management method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150304124A1 (en) * 2012-10-12 2015-10-22 Zte Corporation Message Processing Method and Device
CN106302238A (en) * 2015-05-13 2017-01-04 深圳市中兴微电子技术有限公司 A kind of queue management method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《Hybrid limited-pointer linked-list cache directory and cache coherence protocol》;Mostafa Mahmoud 等;《2013 Second International Japan-Egypt Conference on Electronics, Communications and Computers (JEC-ECC)》;20131231;全文 *
《稀疏矩阵带行指针数组的单链表存储结构及相加算法实现》;邬恩杰 等;《电脑知识与技术》;20161231;全文 *

Also Published As

Publication number Publication date
CN113157465A (en) 2021-07-23

Similar Documents

Publication Publication Date Title
WO2020236269A1 (en) System and method for facilitating efficient utilization of an output buffer in a network interface controller (nic)
CN107959636B (en) Method and device for sending BGP (Border gateway protocol) message
CN105511954B (en) Message processing method and device
CN101867511B (en) Pause frame sending method, associated equipment and system
CN108737296B (en) Data transmission method, device and network equipment
CN101616083A (en) A kind of message forwarding method and device
CN110661725A (en) Techniques for reordering network packets on egress
CN113485822A (en) Memory management method, system, client, server and storage medium
CN104468401A (en) Message processing method and device
CN103986585A (en) Message preprocessing method and device
JP2014033339A (en) Data transmission device, communication control method, and communication control program
CN115934625B (en) Doorbell knocking method, equipment and medium for remote direct memory access
CN108304272B (en) Data IO request processing method and device
CN113157465B (en) Message sending method and device based on pointer linked list
US10305772B2 (en) Using a single work item to send multiple messages
CN116204487A (en) Remote data access method and device
CN112765087A (en) System and method for synchronizing communications between multiple processors
CN111740922A (en) Data transmission method, device, electronic equipment and medium
KR20170117326A (en) Direct memory access control device for at least one processing unit having a random access memory
CN107920035B (en) Multi-core processor type device, system and vehicle for deterministic switched Ethernet
US9338219B2 (en) Direct push operations and gather operations
CN107547452B (en) Distributed communication equipment and message forwarding method and device thereof
US9128785B2 (en) System and method for efficient shared buffer management
WO2017016300A1 (en) Method and apparatus for processing token application, computer storage medium
CN111130968A (en) Method and terminal for solving Modbus bus communication packet sticking

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant