A message transmission method and device, computer device and storage medium

CN117118923BActive Publication Date: 2026-08-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311079459.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-25
Publication Date
2026-08-28
Estimated Expiration
2043-08-25

AI Technical Summary

Technical Problem

[0005]有鉴于此,本发明提供了一种消息传输方法、装置、计算机设备及存储介质,以解决消息发送端的发送消息队列的消息出队耗时长,消息接收端,从接收消息队列提取接收到的消息耗时长,导致工作线程调度不及时的问题

Benefits of technology

[0042]本实施例提供的消息传输方法,获取消息包,并将消息包加入接收消息队列;解析消息包,得到第二数量个待发送消息;在待发送消息的序列号与接收消息队列的序列号匹配成功的情况下,将待发送消息放入消息内容缓冲池;根据第二目标内核的线程调度情况,对消息内容缓冲池中的待发送消息进行第二异步并行操作。通过上述过程,在消息接收端,不再串行执行消息出队及业务模块消息内容提取、校验、逻辑处理等动作,把消息出队与后续的提取处理改为异步执行,提高消息的处理效率。另外,在消息包全部解析完成的情况下,发送应答反馈至消息发送端,便于后续任务调度。解决了消息接收端,从接收消息队列提取接收到的消息耗时长,导致工作线程调度不及时的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117118923B_ABST
    Figure CN117118923B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of computer, disclose a kind of message transmission method, device, computer equipment and storage medium, the method comprises: in the case where current port resource, current channel and to-be-sent message match successfully, determine the serial number of to-be-sent message, to-be-sent message is put into current port resource;According to the size of current port resource and the size of to-be-sent message, obtain redundancy, according to redundancy, put several to-be-sent messages in sending message queue into current port resource;According to the situation that the objective function of first target kernel is called, the first asynchronous parallel operation is carried out to the to-be-sent message in current port resource, and message package is obtained;Based on current channel, message package is sent to message receiving end, and response feedback is obtained from message receiving end, and whether message resource is recycled is judged according to response feedback.The present application solves the problem that the message of sending message queue of message sending end is de-queued for a long time, which causes the problem that work thread scheduling is not timely.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of storage system technology, and specifically to a message transmission method, apparatus, computer device, and storage medium. Background Technology

[0002] In storage systems, the controller is used to control the communication between cluster nodes and must meet high reliability requirements such as no data loss, no data loss, and low communication latency. As the amount of cluster communication increases, the controller must not only ensure reliability but also meet the requirements of timeliness and high performance. Under the existing cluster communication architecture, the controller is difficult to meet these requirements.

[0003] The existing cluster communication architecture is based on the TCP / IP (Transmission Control Protocol / Internet Protocol) architecture, employing a layered message transmission mechanism with layered packet encapsulation and isolation. However, in this architecture, the message sending end experiences long queue times for message dequeueing from the message queue, and the message receiving end experiences long queue times for business modules to retrieve received messages from the WL (Window Layer) message queue, leading to untimely worker thread scheduling.

[0004] Therefore, existing technologies suffer from problems such as long message dequeueing time at the message sending end and long message retrieval time at the message receiving end, leading to untimely scheduling of worker threads. Summary of the Invention

[0005] In view of this, the present invention provides a message transmission method, apparatus, computer device and storage medium to solve the problems of long message dequeueing time in the message sending queue at the message sending end and long message retrieval time in the message receiving end from the received message queue, resulting in untimely scheduling of worker threads.

[0006] In a first aspect, the present invention provides a message transmission method, which is applied at a message sending end, the method comprising:

[0007] If a message to be sent is successfully matched with the current port resource, the current channel, and the message queue, determine the sequence number of the message to be sent, dequeue the message to be sent, and put the message to be sent into the current port resource.

[0008] Based on the current port resource size and the size of the messages to be sent, the redundancy is obtained. Based on the redundancy, the first number of messages to be sent in the message queue are placed into the current port resource.

[0009] Based on the call status of the target function of the first target kernel, the first asynchronous parallel operation is performed on the message to be sent in the current port resource to obtain the message packet. The first target kernel is a kernel other than the kernel bound to the message queue.

[0010] Based on the current channel, send the message packet to the message receiver;

[0011] Based on the current channel, obtain the response feedback from the message receiver, and determine whether to reclaim message resources based on the response feedback.

[0012] The message transmission method provided in this embodiment first matches the current port resource, the current channel, and the message to be sent. If the match is successful, the sequence number of the message to be sent is determined, the message to be sent is dequeued directly, and then placed into the current port resource. Next, the redundancy of the current port resource is calculated, and based on the redundancy, a first number of messages to be sent are placed into the current port resource. Based on the calling status of the target function of the first target kernel, a first asynchronous parallel operation is performed on the messages to be sent in the current port resource to obtain message packets, which are then sent to the message receiving end. Through the above process, this invention separates message dequeueing from message memory concatenation and message packaging operations, executing them asynchronously, thus improving the message dequeueing speed when sending messages. Furthermore, this embodiment determines whether to reclaim message resources based on response feedback, facilitating subsequent task scheduling. This solves the problem of long message dequeueing time in the message sending queue at the message sending end, leading to untimely worker thread scheduling.

[0013] In one optional implementation, a redundancy is obtained based on the current port resource size and the size of the messages to be sent. Based on the redundancy, a first number of messages to be sent from the message queue are placed into the current port resource, including:

[0014] The redundancy is obtained by subtracting the size of all messages to be sent in the current port resource from the current port resource size.

[0015] The redundancy is compared with the size of the messages to be dequeued in the message queue, where the number of messages to be dequeued is determined based on the messages to be sent in the current port resources;

[0016] If the redundancy is greater than the size of the message to be dequeued, the message to be dequeued is treated as a message to be sent. The message to be dequeued is placed into the current port resource. The redundancy is obtained by subtracting the size of all messages to be sent in the current port resource from the size of the current port resource. The subsequent steps are executed until the redundancy is less than the size of the message to be dequeued. Then the dequeuing of messages to be dequeued from the message sending queue is stopped.

[0017] When the redundancy is equal to the size of the message to be dequeued, the message to be dequeued is treated as a message to be sent, the message to be dequeued is placed in the current port resource, and the dequeueing of messages to be dequeued from the message sending queue is stopped.

[0018] If the redundancy is less than the size of the messages to be dequeued, stop dequeuing messages from the message queue.

[0019] In this implementation, the redundancy is obtained by subtracting the total size of all messages to be sent from the current port resource size. This redundancy is then compared to the size of messages to be dequeued in the message queue to determine whether messages can be added to the current port resource. This process maximizes the number of messages to be sent in the current port resource, fully utilizing both port and hardware resources, reducing node communication latency, and improving IOPS and throughput.

[0020] In one optional implementation, based on the invocation of the target function of the first target kernel, a first asynchronous parallel operation is performed on the messages to be sent in the current port resources to obtain a message packet, including:

[0021] When the target function of the first target kernel is called, the first target kernel performs memory splicing and message packaging on all messages to be sent in the current port resources to obtain a message packet.

[0022] Store the message packet in the current port resource.

[0023] In this embodiment, the message queue binding kernel is used to perform message dequeueing operations, and other kernels besides the message queue binding kernel are used for memory splicing and message packaging. This can make full use of CPU hardware resources and communication link resources, reduce message sending latency, and improve data transmission bandwidth.

[0024] In one optional implementation, sending the message packet to the message receiver based on the current channel includes:

[0025] Based on the current channel and message packet, a protocol command carrying the message is obtained, wherein the protocol command corresponds to the current channel and the protocol command carrying the message contains the message packet;

[0026] Send the protocol command carrying the message to the message receiver.

[0027] In this embodiment, a message packet is carried by a protocol command corresponding to the current channel and sent to the message receiving end, thereby realizing the sending of the message to be sent to the message receiving end.

[0028] In one optional implementation, based on the current channel, an acknowledgment feedback is obtained from the message receiver, and a determination is made based on the acknowledgment feedback as to whether to reclaim message resources, including:

[0029] Obtain the protocol command carrying the response feedback from the message receiver;

[0030] The protocol command carrying the response feedback is transmitted to the window layer of the message sender, and the window layer and the protocol command carrying the response feedback are used to determine whether a response operation or a retransmission operation is needed.

[0031] When a response is required, the window layer instructs the application module at the message sender to reclaim message resources.

[0032] In this embodiment, the message sender obtains the response feedback from the message receiver by acquiring a protocol command carrying the response feedback, and determines whether a response operation or a retransmission operation is needed based on the response feedback. If a response operation is needed, the application module reclaims message resources to facilitate subsequent task scheduling.

[0033] In an optional implementation, before determining the sequence number of the message to be sent, dequeuing the message to be sent, and placing the message to be sent into the current port resource, if a match is found between the current port resource, the current channel, and the message queue, the method further includes:

[0034] Allocate messages to be sent from the message resource pool and add them to the message sending queue.

[0035] In this embodiment, messages to be sent are allocated from the message resource pool and added to the message sending queue, providing a basis for sending the messages to the message receiving end in the future.

[0036] Secondly, the present invention provides a message transmission method, which is applied at a message receiving end, the method comprising:

[0037] Based on the current channel, obtain the message packet sent by the message sender and add the message packet to the received message queue;

[0038] Parse the message packet to obtain the second number of messages to be sent;

[0039] If the sequence number of the message to be sent matches the sequence number of the received message queue, the message to be sent is placed into the message content buffer pool.

[0040] Once all message packets have been parsed, an acknowledgment is sent back to the message sender based on the current channel and the sequence number of the received message queue.

[0041] Based on the thread scheduling of the second target kernel, a second asynchronous parallel operation is performed on the messages to be sent in the message content buffer pool. The second target kernel is a kernel other than the kernel bound to the receiving message queue.

[0042] The message transmission method provided in this embodiment obtains a message packet and adds it to a receiving message queue; parses the message packet to obtain a second number of messages to be sent; if the sequence number of the message to be sent matches the sequence number in the receiving message queue, the message to be sent is placed in a message content buffer pool; and according to the thread scheduling of the second target kernel, a second asynchronous parallel operation is performed on the messages to be sent in the message content buffer pool. Through the above process, at the message receiving end, the actions of message dequeueing and message content extraction, verification, and logical processing of business modules are no longer executed serially. Message dequeueing and subsequent extraction processing are changed to asynchronous execution, improving message processing efficiency. In addition, after all message packets are parsed, a response is sent back to the message sending end, facilitating subsequent task scheduling. This solves the problem that the message receiving end spends a long time retrieving received messages from the receiving message queue, leading to untimely scheduling of worker threads.

[0043] In one optional implementation, based on the current channel, the message packet sent by the message sender is acquired, and the message packet is added to the received message queue, including:

[0044] Retrieve the protocol command carrying the message sent by the message sender, wherein the protocol command carrying the message contains a message packet;

[0045] Add the protocol command carrying the message to the receive message queue.

[0046] In this embodiment, the protocol command carrying the message corresponding to the current channel is obtained, and the message packet is obtained, thus realizing the reception of the message to be sent sent by the message sender.

[0047] In an optional implementation, before parsing the message packet to obtain the second number of messages to be sent, the method further includes:

[0048] Lock the message receiving queue.

[0049] In this embodiment, the receiving message queue is locked before parsing the message packet to prevent parsing errors caused by changes in the receiving message queue during the parsing process.

[0050] In one optional implementation, based on the current channel, an acknowledgment is sent back to the message sender according to the sequence number of the received message queue, including:

[0051] Unlock the message receiving queue;

[0052] Assign the sequence number of the received message queue to the protocol command corresponding to the current channel to obtain the protocol command carrying the response feedback;

[0053] Send the protocol command carrying the response feedback to the message sender.

[0054] In this embodiment, a response feedback is sent to the message sender via a protocol command carrying the response feedback. This allows the message sender to determine whether a response or retransmission operation is needed based on the response feedback. If a response operation is required, the application module reclaims message resources to facilitate subsequent task scheduling.

[0055] In one optional implementation, based on the thread scheduling of the second target kernel, a second asynchronous parallel operation is performed on the messages to be sent in the message content buffer pool, including:

[0056] When the second target kernel is scheduled, the message content extraction, verification, and business logic processing of the message to be sent are performed through the second target kernel.

[0057] In this embodiment, the message dequeue operation of the message queue is performed by using the kernel bound to the message queue, and the second asynchronous parallel operation is performed by using other kernels outside the kernel bound to the message queue. This can make full use of CPU hardware resources and communication link resources, reduce message sending latency, and improve data transmission bandwidth.

[0058] Thirdly, the present invention provides a message transmission device deployed at a message sending end, the device comprising:

[0059] The dequeue module is used to determine the sequence number of the message to be sent when a match is found in the current port resource, the current channel, and the message queue, then dequeue the message and put it into the current port resource.

[0060] The first module is used to determine the redundancy based on the current port resource size and the size of the message to be sent, and then to put the first number of messages to be sent from the message queue into the current port resource based on the redundancy.

[0061] The module is used to perform a first asynchronous parallel operation on the messages to be sent in the current port resources according to the call status of the target function of the first target kernel, and obtain message packets. The first target kernel is a kernel other than the kernel bound to the message queue.

[0062] The first sending module is used to send message packets to the message receiving end based on the current channel;

[0063] The first acquisition module is used to acquire response feedback from the message receiver based on the current channel, and determine whether to reclaim message resources based on the response feedback.

[0064] Fourthly, the present invention provides a message transmission device deployed at a message receiving end, the device comprising:

[0065] The second acquisition module is used to acquire message packets sent by the message sender based on the current channel and add the message packets to the received message queue.

[0066] The parsing module is used to parse message packets to obtain a second number of messages to be sent;

[0067] The second module is used to put the message to be sent into the message content buffer pool when the sequence number of the message to be sent matches the sequence number of the received message queue.

[0068] The second sending module is used to send a response feedback to the message sending end based on the current channel and the sequence number of the received message queue after all message packets have been parsed.

[0069] The operation module is used to perform a second asynchronous parallel operation on the messages to be sent in the message content buffer pool according to the thread scheduling of the second target kernel. The second target kernel is a kernel other than the kernel bound to the receiving message queue.

[0070] Fifthly, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the message transmission method described in the first aspect or any corresponding embodiment thereof.

[0071] In a sixth aspect, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to perform the message transmission method described in the first aspect or any of its corresponding embodiments. Attached Figure Description

[0072] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0073] Figure 1 This is a flowchart illustrating a message transmission method applied to a message sender according to an embodiment of the present invention.

[0074] Figure 2 This is a schematic diagram of the message transmission process according to an embodiment of the present invention;

[0075] Figure 3 This is a flowchart illustrating a message transmission method applied to a message receiving end according to an embodiment of the present invention;

[0076] Figure 4 This is a structural block diagram of a message transmission device deployed at a message sending end according to an embodiment of the present invention;

[0077] Figure 5 This is a structural block diagram of a message transmission device deployed at a message receiving end according to an embodiment of the present invention;

[0078] Figure 6 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. Detailed Implementation

[0079] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0080] In-depth testing revealed the following performance bottlenecks in the current storage system's cluster communication: At the message sending end, dequeuing messages from the outbound message queue (Omq) involves sequential dequeueing and subsequent memory concatenation and message packaging operations, resulting in prolonged dequeueing time. At the message receiving end, when business modules retrieve received messages from the write level (WL), dequeueing messages from the inbound message queue (Imq) and subsequent message content extraction, validation, and logical processing by the business modules are performed sequentially, also leading to prolonged message dequeueing time at the sending end. This sequential dequeueing at both the sending and receiving ends of the current storage system's cluster communication can cause issues such as untimely worker thread scheduling.

[0081] This invention provides a message transmission method. At the message sending end, the serial execution of message dequeueing and subsequent memory concatenation and message packaging operations is eliminated. Instead, message dequeueing is separated from these operations and executed asynchronously, improving message dequeueing speed. At the message receiving end, the serial execution of message dequeueing and business module message content extraction, verification, and logical processing is eliminated. Message dequeueing and subsequent extraction processing are performed asynchronously, improving message processing efficiency. Furthermore, both asynchronous executions are handled concurrently by multiple threads, eliminating the need for dedicated CPU cores for message sending and message receiving. The above describes the speed-up optimization strategy proposed by this invention for high-end storage system cluster communication at the sending and receiving ends. This aims to fully utilize hardware resources, reduce node communication latency, increase IOPS (Input / Output Operations Per Second) and throughput, and ensure system stability and reliability.

[0082] According to an embodiment of the present invention, a message transmission method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a set of computer devices with data processing capabilities. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0083] This embodiment provides a message transmission method that can be used in the aforementioned computer device. Figure 1 This is a flowchart of a message transmission method according to an embodiment of the present invention. The method is applied to a message sending end, such as... Figure 1 As shown, the process includes the following steps:

[0084] Step S101: If the message to be sent is successfully matched with the current port resource, the current channel, and the message queue, determine the sequence number of the message to be sent, dequeue the message to be sent, and put the message to be sent into the current port resource.

[0085] Specifically, in combination Figure 2 This embodiment will be described. Figure 2 Node1 is the controller for sending messages. Node1 contains application module A, window layer (WL), and communication layer (CL). WL is similar to a session layer and can cache message data. CL is the communication / physical layer of the message sending protocol system. CL is the target of Node1, representing the message sending layer of cluster communication. The message sending queue Omq exists on WL.

[0086] In the message queue Omq, during Fb (fast fibre, worker thread) scheduling, a matching process is initiated for tportrsrc (port resource), channel (channel), and msg (message to be sent). tportrsrc represents the port resource, used by the message sender to store packaged messages. This invention creates a temporary buffer on CL based on tportrsrc. The channel corresponds one-to-one with protocol commands, representing a concurrent I / O (Input / Output). Fb, similar to an operating system thread, is a lightweight worker thread in this invention. If a match is found between the current port resource, the current channel, and the message to be sent in the message queue, the message to be sent is dequeued from the message queue Omq and placed into the temporary buffer created based on the current port resource. During the dequeueing process described above, it is necessary to determine the sequence number (seqn) of the message to be sent. The specific steps include: using the sending sequence number (omq->send_seqn) of the message queue Omq, assigning a value to the msg->sequence tag of the message to be sent (msg) as its sequence number. Each time the sequence number omq->send_seqn is used to assign a value to the message to be sent (msg), omq->send_seqn is incremented (omq->send_seqn++) to facilitate assigning values ​​to subsequent messages to be sent (msg). Here, "omq->send_seqn" is a unique sequence number in the message queue Omq. Assigning a value to each message to be sent (msg) during message dequeueing ensures that all messages are in order and is also a means of guaranteeing whether messages have been successfully received.

[0087] In addition, in this invention, the sending message queue Omq has a sending sequence number, and the receiving message queue Imq has a receiving sequence number, and the two must be synchronized and correspond.

[0088] Step S102: Based on the current port resource size and the size of the message to be sent, obtain the redundancy amount. Based on the redundancy amount, put the first number of messages to be sent from the message queue into the current port resource.

[0089] Specifically, the redundancy of the current port resources is calculated based on the current port resource size and the size of the messages to be sent. This redundancy determines whether the next message can be dequeued from the message queue Omq. Since the temporary buffer is created based on the current port resource tportrsrc, this redundancy determines the first number of messages that can still be placed in the temporary buffer. This first number is set according to the actual situation and is not specifically limited here. Then, these first number of messages to be sent are placed into the temporary buffer created based on the current port resources in the message queue Omq. At this point, the temporary buffer contains the first number plus one message to be sent.

[0090] Step S103: Based on the call status of the target function of the first target kernel, perform the first asynchronous parallel operation on the message to be sent in the current port resource to obtain the message packet. The first target kernel is a kernel other than the kernel bound to the message queue.

[0091] Specifically, if a match is found between the current port resources, the current channel, and the message queue to be sent, the `tportrsrc-channel-msg` combination will be obtained. This `tportrsrc-channel-msg` combination is then used as a whole parameter in the worker thread to invoke the task.

[0092] Combination Figure 2 This embodiment describes the asynchronous organization of data memory concatenation, message body packaging, and reuse in the tportrsrc-channel-msg combination. The reuse list temporarily stores the message msg to be sent, reclaiming its message resources after receiving feedback from the message receiver. Specifically, the kernels other than those bound to the Omq message queue are designated as the first target kernel, and the response functions within these kernels are designated as the target functions. When the target function of the first target kernel is called (i.e., when the response functions distributed across various CPU kernels are called), the first target kernel executes the target function to perform a first asynchronous parallel operation on the message to be sent in the current port resource, obtaining a message packet. This first asynchronous parallel operation includes memory concatenation and message packaging. The message packet is then stored in a temporary buffer created based on the current port resource tportrsrc.

[0093] The above steps can fully leverage the advantages of high concurrency and high performance of the underlying links. When the links are sufficiently redundant, the time consumed in the physical links is almost negligible.

[0094] Step S104: Based on the current channel, send the message packet to the message receiver.

[0095] Specifically, Figure 2Node2 is the controller for receiving messages. Node2 also contains application module A, window layer (WL), and communication layer (CL). WL is similar to the session layer and can cache message data. CL is the communication / physical layer of the protocol system for sending messages. In Node2, CL stands for Initiator, which represents the message receiving layer for cluster communication. There is a message receiving queue Imq on WL in Node2.

[0096] It should be noted that application module A is the same as the business module. In this invention, the storage system cluster communication transmits messages from application module A in Node1 to application module A in Node2. That is, the two nodes exchange data for the same program module. If there is cross-module communication, it is also within one node.

[0097] Based on the current channel in the tportrsrc-channel-msg combination, the message packet is sent to the message receiver. For example... Figure 2 As shown: Node1's CL sends a channel carrying a message to Node2's CL.

[0098] Step S105: Based on the current channel, obtain the response feedback from the message receiver, and determine whether to reclaim message resources based on the response feedback.

[0099] Specifically, based on the current channel in the tportrsrc-channel-msg combination, the response feedback is obtained from the message receiver, for example: Figure 2 As shown, Node2's CL assigns recv_seqn to the channel and sends it to Node1's CL, where recv_seqn is the latest response sequence number from the message receiver.

[0100] Through response feedback, the message sender can determine whether all sent message packets have been parsed successfully, whether the task scheduling is complete, and which messages to be sent within the message packet have been dequeued from the receive message queue (IMQ). If messages to be sent have been dequeued from the receive message queue (IMQ), the message resources they occupy at the message sender, including memory usage, can be reclaimed. Therefore, the response feedback can be used to determine whether the message resources occupied by the messages to be sent within the message packet can be reclaimed.

[0101] The message transmission method provided in this embodiment first matches the current port resource, the current channel, and the message to be sent. If the match is successful, the sequence number of the message to be sent is determined, the message to be sent is dequeued directly, and then placed into the current port resource. Next, the redundancy of the current port resource is calculated, and based on the redundancy, a first number of messages to be sent are placed into the current port resource. Based on the calling status of the target function of the first target kernel, a first asynchronous parallel operation is performed on the messages to be sent in the current port resource to obtain message packets, which are then sent to the message receiving end. Through the above process, this invention separates message dequeueing from message memory concatenation and message packaging operations, executing them asynchronously, thus improving the message dequeueing speed when sending messages. Furthermore, this embodiment determines whether to reclaim message resources based on response feedback, facilitating subsequent task scheduling. This solves the problem of long message dequeueing time in the message sending queue at the message sending end, leading to untimely worker thread scheduling.

[0102] In some optional implementations, a redundancy is obtained based on the current port resource size and the size of the messages to be sent. Based on this redundancy, a first number of messages to be sent from the message queue are placed into the current port resource, including:

[0103] The redundancy is obtained by subtracting the size of all messages to be sent in the current port resource from the current port resource size.

[0104] The redundancy is compared with the size of the messages to be dequeued in the message queue, where the number of messages to be dequeued is determined based on the messages to be sent in the current port resources;

[0105] If the redundancy is greater than the size of the message to be dequeued, the message to be dequeued is treated as a message to be sent. The message to be dequeued is placed into the current port resource. The redundancy is obtained by subtracting the size of all messages to be sent in the current port resource from the size of the current port resource. The subsequent steps are executed until the redundancy is less than the size of the message to be dequeued. Then the dequeuing of messages to be dequeued from the message sending queue is stopped.

[0106] When the redundancy is equal to the size of the message to be dequeued, the message to be dequeued is treated as a message to be sent, the message to be dequeued is placed in the current port resource, and the dequeueing of messages to be dequeued from the message sending queue is stopped.

[0107] If the redundancy is less than the size of the messages to be dequeued, stop dequeuing messages from the message queue.

[0108] Specifically, the redundancy of the current port resource is obtained by subtracting the total size of all messages to be sent in the current port resource from its size (tportrsrc). Since the temporary buffer is created based on the current port resource (tportrsrc), this redundancy allows us to determine how many more messages can be placed in the temporary buffer.

[0109] The most recently added message to the temporary buffer, along with the next message in the original Omq message queue, is added as the message to be dequeued. The redundancy is then compared to the size of the message to be dequeued.

[0110] If the redundancy is greater than the size of the message to be dequeued, it means the temporary buffer can still hold the message. Therefore, the message can be placed into the temporary buffer created based on the current port resource tportrsrc. At this point, the message becomes the latest message to be sent in the temporary buffer, and a new message to be dequeued can be determined based on it. However, the size of all messages to be sent in the temporary buffer increases, requiring a recalculation of the redundancy and re-execution of the above process until the recalculated redundancy is less than the size of the message to be dequeued. Then, dequeuing messages from the message sending queue stops.

[0111] If the redundancy is equal to the size of the message to be dequeued, it means that the temporary buffer can only store the message to be dequeued and cannot store other messages. Therefore, the message to be dequeued is simply treated as a message to be sent, placed into the current port resource, and the dequeueing of messages to be dequeued from the message sending queue is stopped.

[0112] If the redundancy is less than the size of the messages to be dequeued, it means that the temporary buffer can no longer store other messages, and the dequeueing of messages to be dequeued from the message queue will stop.

[0113] In this implementation, the redundancy is obtained by subtracting the total size of all messages to be sent from the current port resource size. This redundancy is then compared to the size of messages to be dequeued in the message queue to determine whether messages can be added to the current port resource. This process maximizes the number of messages to be sent in the current port resource, fully utilizing both port and hardware resources, reducing node communication latency, and improving IOPS and throughput.

[0114] In some optional implementations, depending on the invocation of the target function of the first target kernel, a first asynchronous parallel operation is performed on the messages to be sent in the current port resources to obtain message packets, including:

[0115] When the target function of the first target kernel is called, the first target kernel performs memory splicing and message packaging on all messages to be sent in the current port resources to obtain a message packet.

[0116] Store the message packet in the current port resource.

[0117] Specifically, this invention assigns the message dequeue operation in the message queue Omq to a specific CPU core, that is, binds the message queue Omq to a specific CPU core. Subsequent memory concatenation, message packaging, and other operations are executed asynchronously by other cores different from the CPU core to which Omq is bound. Through the above, asynchronous operations such as memory concatenation and message packaging are distributed across cores other than the core to which Omq is bound, in conjunction with the underlying multi-link, multi-queue concurrent processing.

[0118] Thus, the core where message dequeueing operations occur in the message queue Omq needs to increase scheduling frequency and asynchronously process packet operations concurrently across multiple cores. This can fully utilize CPU hardware resources and communication link resources, reduce message sending latency, and increase data transmission bandwidth.

[0119] When the target function of the first target kernel is called, the target function is executed by the first target kernel to perform memory splicing and message packaging processing on all messages to be sent in the current port resource to obtain message packets. Specifically, this includes: comparing the message size, data size and redundancy space of each message to be sent; within the allowable range, splicing all memory carrying the data of the message to be sent into a memory block; organizing the message bodies of all messages to be sent together to obtain message packets; and storing the message packets in a temporary buffer created based on the current port resource tportrsrc.

[0120] In this embodiment, the message queue binding kernel is used to perform message dequeueing operations, and other kernels besides the message queue binding kernel are used for memory splicing and message packaging. This can make full use of CPU hardware resources and communication link resources, reduce message sending latency, and improve data transmission bandwidth.

[0121] In some optional implementations, sending the message packet to the message receiver based on the current channel includes:

[0122] Based on the current channel and message packet, a protocol command carrying the message is obtained, wherein the protocol command corresponds to the current channel and the protocol command carrying the message contains the message packet;

[0123] Send the protocol command carrying the message to the message receiver.

[0124] Specifically, the message packet is written into the buffer of the protocol command corresponding to the current channel to obtain the protocol command carrying the message. The protocol command carrying the message is then sent to the message receiving end, which can then obtain the message packet.

[0125] In this embodiment, a message packet is carried by a protocol command corresponding to the current channel and sent to the message receiving end, thereby realizing the sending of the message to be sent to the message receiving end.

[0126] In some optional implementations, based on the current channel, response feedback is obtained from the message receiver, and a determination is made based on the response feedback as to whether to reclaim message resources, including:

[0127] Obtain the protocol command carrying the response feedback from the message receiver;

[0128] The protocol command carrying the response feedback is transmitted to the window layer of the message sender, and the window layer and the protocol command carrying the response feedback are used to determine whether a response operation or a retransmission operation is needed.

[0129] When a response is required, the window layer instructs the application module at the message sender to reclaim message resources.

[0130] Specifically, in combination Figure 2 This embodiment will be described below. Figure 2 In Node2, the CL assigns recv_seqn to the channel and sends it to Node1's CL. recv_seqn is the acknowledgment feedback, and the assigned channel is the protocol command carrying the acknowledgment feedback. recv_seqn is the latest acknowledgment feedback sequence number from the message receiver, which is the acknowledgment feedback sequence number corresponding to the last message to be sent that was dequeued from the receive message queue Imq.

[0131] When the communication layer (CL) of the message sender receives a protocol command carrying an acknowledgment, it notifies the window layer (WL) to transmit the protocol command carrying the acknowledgment to the window layer (WL). The window layer can determine, based on the acknowledgment, which messages to be sent have been dequeued from the message queue (Imq) of the message receiver. Therefore, based on the window layer (WL) and the protocol command carrying the acknowledgment, it determines whether an acknowledgment or retransmission operation is needed. If it is determined that a message to be sent has been dequeued from the message queue (Imq) of the message receiver, the successfully dequeued message is acknowledged, message resources are reclaimed, and the message resource pool of application module A is released. If it is determined that a message to be sent has not been dequeued from the message queue (Imq) of the message receiver, the undequeued message is retransmitted, i.e., retransmitted to the message receiver.

[0132] In this embodiment, the message sender obtains the response feedback from the message receiver by acquiring a protocol command carrying the response feedback, and determines whether a response operation or a retransmission operation is needed based on the response feedback. If a response operation is needed, the application module reclaims message resources to facilitate subsequent task scheduling.

[0133] In some optional implementations, before determining the sequence number of the message to be sent, dequeuing the message to be sent, and placing the message to be sent into the current port resource, if a match is found between the current port resource, the current channel, and the message queue, the method further includes:

[0134] Allocate messages to be sent from the message resource pool and add them to the message sending queue.

[0135] Specifically, in combination Figure 2 This embodiment will be described below. Figure 2 Node1 allocates a message msg (the message to be sent) based on the message resource pool of application module A; enqueuing msg into Omq means adding the message to be sent to the message queue Omq.

[0136] In this embodiment, messages to be sent are allocated from the message resource pool and added to the message sending queue, providing a basis for sending the messages to the message receiving end in the future.

[0137] This embodiment provides a message transmission method that can be used in the aforementioned computer device. Figure 3 This is a flowchart of a message transmission method according to an embodiment of the present invention. The method is applied to a message receiving end, such as... Figure 3 As shown, the process includes the following steps:

[0138] Step S301: Based on the current channel, obtain the message packet sent by the message sender and add the message packet to the received message queue.

[0139] Specifically, in combination Figure 2 This embodiment will be described. Figure 2 In this process, the Node2's communication layer (CL) obtains the channel carrying the message, transmits the channel carrying the message to the Node2's window layer (WL), and stores the channel carrying the message in the Node2's window layer (WL) message queue Imq. The channel carrying the message contains the message packets sent by the message sender.

[0140] Step S302: Parse the message packet to obtain the second number of messages to be sent.

[0141] Specifically, the message packets are parsed to sequentially extract the outermost messages to be sent. Since this invention will subsequently perform sequence number matching (seqn) on a fixed number of messages to be sent to determine if they meet the condition for dequeueing from the received message queue (Imq), the message packets are parsed here to first obtain the second number of messages to be sent, i.e., the fixed number of messages to be sent. This second number is set according to requirements and is not specifically limited here.

[0142] Step S303: If the sequence number of the message to be sent successfully matches the sequence number of the received message queue, the message to be sent is placed into the message content buffer pool.

[0143] Specifically, Node2's application module A needs to add a message content buffer pool, the size of which can be determined based on the scale of its own cluster communication, i.e., a differentiated setting.

[0144] For the second number of message packets to be dequeued, a sequence number (seqn) match is performed. The sequence number of the message to be sent is matched with the expected sequence number (imq->recv_seqn) of the receiving message queue Imq. If a match is successful, the message to be sent meets the dequeue condition, and is dequeued. The content of the message to be sent is then transferred to the message content buffer pool via memory copy, and imq->recv_seqn is incremented (imq->recv_seqn++). It should be noted that imq->recv_seqn is a unique sequence number in the receiving message queue Imq. imq->recv_seqn is used to verify whether the received message to be sent is the expected message. If it is, the message to be sent is placed in the message content buffer pool; if it is a duplicate message to be sent, it is discarded; if it is a message to be sent that arrived early, it is requeued to wait for the arrival of the currently expected message. For example: if the sequence number of the currently expected message, imq->recv_seqn, is 3, and the sequence number of the message to be sent is 3, then it is the expected message. The message to be sent is placed in the message content buffer pool, and imq->recv_seqn is increased to 4.

[0145] The above process is as follows Figure 2 As shown, the seqn value is compared. If successful, the message is dequeued, and imq->recv_seqn++.

[0146] Step S304: After all message packets have been parsed, a response is sent to the message sender based on the current channel and the sequence number of the received message queue.

[0147] Specifically, once the message to be sent is dequeued from the receiving message queue Imq and placed into the message content buffer pool, the dequeue gate operation for that message to be sent is completed. Then, other messages to be sent are processed in sequence until all message packets are parsed, and the task scheduling is completed.

[0148] Once all message packets have been parsed, the sequence number imq->recv_seqn of the receive message queue Imq corresponding to the last message to be sent is used as the acknowledgment feedback. Based on the current channel, this acknowledgment feedback is sent to the message sender.

[0149] The above process is as follows Figure 2As shown, the response is sent via imq->recv_seqn, recv_seqn is assigned to the channel, and then sent to the communication layer (CL) of Node1.

[0150] Step S305: Based on the thread scheduling of the second target kernel, perform a second asynchronous parallel operation on the messages to be sent in the message content buffer pool. The second target kernel is a kernel other than the kernel bound to the receiving message queue.

[0151] Specifically, after placing the message to be sent into the message content buffer pool, it waits for the thread scheduling of the second target kernel corresponding to the business module. When the second target kernel is called, the second asynchronous parallel operation is executed, including message content extraction, verification, business logic processing, etc.

[0152] The above process is as follows Figure 2 As shown, Node2's application module A asynchronously performs content parsing, validation, and business logic processing for the message content buffer pool.

[0153] The message transmission method provided in this embodiment obtains a message packet and adds it to a receiving message queue; parses the message packet to obtain a second number of messages to be sent; if the sequence number of the message to be sent matches the sequence number in the receiving message queue, the message to be sent is placed in a message content buffer pool; and according to the thread scheduling of the second target kernel, a second asynchronous parallel operation is performed on the messages to be sent in the message content buffer pool. Through the above process, at the message receiving end, the actions of message dequeueing and message content extraction, verification, and logical processing of business modules are no longer executed serially. Message dequeueing and subsequent extraction processing are changed to asynchronous execution, improving message processing efficiency. In addition, after all message packets are parsed, a response is sent back to the message sending end, facilitating subsequent task scheduling. This solves the problem that the message receiving end spends a long time retrieving received messages from the receiving message queue, leading to untimely scheduling of worker threads.

[0154] In some optional implementations, based on the current channel, the message packet sent by the message sender is acquired, and the message packet is added to the received message queue, including:

[0155] Retrieve the protocol command carrying the message sent by the message sender, wherein the protocol command carrying the message contains a message packet;

[0156] Add the protocol command carrying the message to the receive message queue.

[0157] Specifically, the message sender writes the message packet into the buffer of the protocol command corresponding one-to-one with the current channel, and sends the message packet to the message receiver using the protocol command carrying the message. The message receiver obtains the protocol command carrying the message, and then obtains the message packet contained in the protocol command carrying the message.

[0158] In this embodiment, the protocol command carrying the message corresponding to the current channel is obtained, and the message packet is obtained, thus realizing the reception of the message to be sent sent by the message sender.

[0159] In some optional implementations, before parsing the message packets to obtain a second number of messages to be sent, the method further includes:

[0160] Lock the message receiving queue.

[0161] Specifically, before parsing the message packet, Imq_lock is locked, that is, the receive message queue is locked, where Imq_lock is the receive message queue lock.

[0162] In this embodiment, the receiving message queue is locked before parsing the message packet to prevent parsing errors caused by changes in the receiving message queue during the parsing process.

[0163] In some optional implementations, based on the current channel, an acknowledgment is sent back to the message sender according to the sequence number of the received message queue, including:

[0164] Unlock the message receiving queue;

[0165] Assign the sequence number of the received message queue to the protocol command corresponding to the current channel to obtain the protocol command carrying the response feedback;

[0166] Send the protocol command carrying the response feedback to the message sender.

[0167] Specifically, once the message to be sent is dequeued from the receiving message queue Imq and placed into the message content buffer pool, the dequeue gate operation for that message to be sent is completed. Then, other messages to be sent are processed in sequence until all message packets are parsed, and the task scheduling is completed.

[0168] Since this invention eliminates the business module verification and logic processing operations found in existing technologies, the dequeueing action of the message to be sent—that is, dequeuing from the receive message queue Imq—is completed quickly. Afterwards, releasing Imq_lock unlocks the receive message queue. Once Imq_lock is released, the feedback acknowledgment operation can use the latest imq->recv_seqn to provide feedback. The latest imq->recv_seqn is assigned to the protocol command corresponding to the current channel, resulting in a protocol command carrying the feedback acknowledgment. This protocol command is then sent to the message sender. The latest imq->recv_seqn is the sequence number imq->recv_seqn of the last dequeued message to be sent in the receive message queue Imq.

[0169] For example, if a message packet contains five messages to be sent, namely messages 1-5, with message 1 dequeued from the receive message queue (Imq) first and message 5 dequeued last, then the value of `imq->recv_seqn` corresponding to the dequeue of message 5 is assigned as an acknowledgment to the protocol command corresponding to the current channel. The protocol command carrying this acknowledgment is then sent to the message sender. Based on this acknowledgment, the message sender can determine that messages 1-5 have all been successfully dequeued from the receive message queue (Imq).

[0170] In this embodiment, a response feedback is sent to the message sender via a protocol command carrying the response feedback. This allows the message sender to determine whether a response or retransmission operation is needed based on the response feedback. If a response operation is required, the application module reclaims message resources to facilitate subsequent task scheduling.

[0171] In some optional implementations, based on the thread scheduling of the second target kernel, a second asynchronous parallel operation is performed on the messages to be sent in the message content buffer pool, including:

[0172] When the second target kernel is scheduled, the message content extraction, verification, and business logic processing of the message to be sent are performed through the second target kernel.

[0173] Specifically, this invention binds the operations of performing seqn comparison and dequeuing the message to be sent from the receive message queue Imq to a designated CPU core. The subsequent execution of the second asynchronous parallel operation is distributed across other cores besides the core bound to the receive message queue Imq, i.e., the second target core. The specific core on which it is distributed is determined by the application module A of Node2, and can be coordinated with the commonly used cores of the application module A of Node2.

[0174] When the second target kernel is scheduled, the second asynchronous parallel operation is performed on the message to be sent through the second target kernel, including message content extraction and processing, verification processing, and business logic processing.

[0175] In this embodiment, the message dequeue operation of the message queue is performed by using the kernel bound to the message queue, and the second asynchronous parallel operation is performed by using other kernels outside the kernel bound to the message queue. This can make full use of CPU hardware resources and communication link resources, reduce message sending latency, and improve data transmission bandwidth.

[0176] This embodiment also provides a message transmission device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0177] This embodiment provides a message transmission device, such as... Figure 4 As shown, the device is deployed at the message sending end and includes:

[0178] The dequeue module 401 is used to determine the sequence number of the message to be sent, dequeue the message to be sent, and put the message to be sent into the current port resource when the message to be sent is successfully matched with the current port resource, the current channel, and the message to be sent queue.

[0179] The first insertion module 402 is used to obtain the redundancy based on the current port resource size and the size of the message to be sent, and to insert the first number of messages to be sent from the message queue into the current port resource based on the redundancy.

[0180] The module 403 is used to perform a first asynchronous parallel operation on the message to be sent in the current port resource according to the call status of the target function of the first target kernel, and obtain a message packet. The first target kernel is a kernel other than the kernel bound to the message queue.

[0181] The first sending module 404 is used to send message packets to the message receiving end based on the current channel;

[0182] The first acquisition module 405 is used to acquire response feedback from the message receiver based on the current channel, and determine whether to reclaim message resources based on the response feedback.

[0183] In some alternative implementations, the first insertion module 402 includes:

[0184] The first obtaining unit is used to subtract the size of all messages to be sent in the current port resource from the size of the current port resource to obtain the redundancy;

[0185] The comparison unit is used to compare the redundancy with the size of the messages to be dequeued in the message queue, wherein the messages to be dequeued are determined based on the messages to be sent in the current port resources;

[0186] The loop unit is used to treat the message to be dequeued as a message to be sent when the redundancy is greater than the size of the message to be dequeued. The message to be dequeued is placed into the current port resource, and the redundancy is obtained by subtracting the size of all messages to be sent in the current port resource from the size of the current port resource. The subsequent steps are executed until the redundancy is less than the size of the message to be dequeued, at which point the dequeuing of messages to be dequeued from the message sending queue is stopped.

[0187] The insertion unit is used to, when the redundancy is equal to the size of the message to be dequeued, treat the message to be dequeued as a message to be sent, insert the message to be dequeued into the current port resource, and stop dequeuing the message to be dequeued from the message sending queue.

[0188] The stop unit is used to stop dequeuing messages from the message queue when the redundancy is less than the size of the messages to be dequeued.

[0189] In some alternative implementations, module 403 includes:

[0190] The processing unit is used to perform memory splicing and message packaging processing on all messages to be sent in the current port resources using the first target kernel when the target function of the first target kernel is called, so as to obtain a message packet.

[0191] The storage unit is used to store message packets in the current port resources.

[0192] In some alternative implementations, the first transmitting module 404 includes:

[0193] The second obtaining unit is used to obtain a protocol command carrying a message based on the current channel and the message packet, wherein the protocol command corresponds to the current channel and the protocol command carrying the message contains the message packet;

[0194] The first sending unit is used to send protocol commands carrying messages to the message receiving end.

[0195] In some alternative implementations, the first acquisition module 405 includes:

[0196] The first acquisition unit is used to acquire protocol commands carrying response feedback from the message receiving end;

[0197] The judgment unit is used to transmit the protocol command carrying the response feedback to the window layer of the message sender, and to determine whether a response operation or a retransmission operation is needed based on the window layer and the protocol command carrying the response feedback.

[0198] The instruction unit is used to instruct the application module at the message sending end to reclaim message resources when a response operation is required.

[0199] In some alternative embodiments, the device further includes:

[0200] The allocation module is used to allocate messages to be sent from the message resource pool and add the messages to be sent to the message queue.

[0201] This embodiment provides a message transmission device, such as... Figure 5 As shown, the device is deployed at the message receiving end and includes:

[0202] The second acquisition module 501 is used to acquire message packets sent by the message sender based on the current channel and add the message packets to the received message queue;

[0203] Parsing module 502 is used to parse message packets to obtain a second number of messages to be sent;

[0204] The second insertion module 503 is used to insert the message to be sent into the message content buffer pool when the sequence number of the message to be sent matches the sequence number of the received message queue.

[0205] The second sending module 504 is used to send a response feedback to the message sending end based on the current channel and the sequence number of the received message queue after all message packets have been parsed.

[0206] Operation module 505 is used to perform a second asynchronous parallel operation on the messages to be sent in the message content buffer pool according to the thread scheduling of the second target kernel, wherein the second target kernel is a kernel other than the kernel bound to the receiving message queue.

[0207] In some optional implementations, the second acquisition module 501 includes:

[0208] The second acquisition unit is used to acquire the protocol command carrying the message sent by the message sender, wherein the protocol command carrying the message includes a message packet;

[0209] The add unit is used to add protocol commands carrying messages to the receive message queue.

[0210] In some alternative embodiments, the device further includes:

[0211] The locking module is used to lock the message receiving queue.

[0212] In some alternative implementations, the second transmitting module 504 includes:

[0213] The unlocking unit is used to unlock the message receiving queue;

[0214] The assignment unit is used to assign the sequence number of the received message queue to the protocol command corresponding to the current channel, so as to obtain the protocol command carrying the response feedback;

[0215] The second sending unit is used to send the protocol command carrying the response feedback to the message sending end.

[0216] In some alternative implementations, the operation module 505 includes:

[0217] The operation unit is used to perform message content extraction, verification, and business logic processing on the message to be sent through the second target kernel when the second target kernel is scheduled.

[0218] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0219] In this embodiment, the message transmission device is presented in the form of a functional unit. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0220] This invention also provides a computer device having the above-described features. Figure 4 and Figure 5 The message transmission device shown.

[0221] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of the present invention, such as... Figure 6As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 6 Take a processor 10 as an example.

[0222] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0223] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.

[0224] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0225] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0226] The computer device also includes a communication interface 30 for communicating with other devices or communication networks.

[0227] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code, which, when accessed and executed by the computer, processor, or hardware, implements the methods shown in the above embodiments.

[0228] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and all such modifications and variations fall within the scope defined by the appended claims.

Claims

1. A message transmission method, characterized in that, The method is applied to the message sending end, and the method includes: If a message to be sent is successfully matched in the current port resource, the current channel, and the message queue, the sequence number of the message to be sent is determined, the message to be sent is dequeued, and the message to be sent is placed into the current port resource. Based on the size of the current port resource and the size of the message to be sent, a redundancy is obtained. Based on the redundancy, a first number of the messages to be sent from the message sending queue are placed into the current port resource. Based on the invocation of the target function of the first target kernel, a first asynchronous parallel operation is performed on the message to be sent in the current port resource to obtain a message packet, wherein the first target kernel is a kernel other than the kernel bound to the message queue; The step of performing a first asynchronous parallel operation on the messages to be sent in the current port resource to obtain a message packet based on the call status of the target function of the first target kernel includes: when the target function of the first target kernel is called, using the first target kernel to perform memory splicing and message packaging processing on all the messages to be sent in the current port resource to obtain the message packet; and storing the message packet in the current port resource. Based on the current channel, the message packet is sent to the message receiving end; Based on the current channel, obtain the response feedback from the message receiver, and determine whether to reclaim message resources based on the response feedback.

2. The method according to claim 1, characterized in that, The step of obtaining a redundancy amount based on the size of the current port resource and the size of the message to be sent, and placing a first number of the message to be sent from the message queue into the current port resource based on the redundancy amount, includes: The redundancy is obtained by subtracting the size of all the messages to be sent in the current port resource from the current port resource size. The redundancy is compared with the size of the messages to be dequeued in the message sending queue, wherein the messages to be dequeued are determined based on the messages to be sent in the current port resources; If the redundancy is greater than the size of the message to be dequeued, the message to be dequeued is treated as the message to be sent, the message to be dequeued is placed in the current port resource, and the redundancy is obtained by subtracting the size of all the messages to be sent in the current port resource from the size of the current port resource. Then, the subsequent steps are executed until the redundancy is less than the size of the message to be dequeued, at which point the dequeuing of the message to be dequeued from the sending message queue is stopped. When the redundancy is equal to the size of the message to be dequeued, the message to be dequeued is treated as the message to be sent, the message to be dequeued is placed in the current port resource, and the dequeueing of the message to be dequeued from the sending message queue is stopped. If the redundancy is less than the size of the message to be dequeued, stop dequeuing the message to be dequeued from the message sending queue.

3. The method according to claim 1, characterized in that, The step of sending the message packet to the message receiver based on the current channel includes: Based on the current channel and the message packet, a protocol command carrying the message is obtained, wherein the protocol command corresponds to the current channel and the protocol command carrying the message includes the message packet; The protocol command carrying the message is sent to the message receiving end.

4. The method according to claim 1, characterized in that, The step of obtaining response feedback from the message receiver based on the current channel, and determining whether to reclaim message resources based on the response feedback, includes: Obtain the protocol command carrying the response feedback from the message receiving end; The protocol command carrying the response feedback is transmitted to the window layer of the message sending end, and it is determined whether a response operation or a retransmission operation is needed based on the window layer and the protocol command carrying the response feedback. When a response operation is required, the window layer instructs the application module of the message sender to reclaim message resources.

5. The method according to claim 1, characterized in that, Before determining the sequence number of the message to be sent, dequeuing the message to be sent, and placing the message to be sent into the current port resource, in the case that a match is successfully found in the current port resource, the current channel, and the message queue, the method further includes: The message to be sent is allocated from the message resource pool and added to the message sending queue.

6. A message transmission method, characterized in that, The method is applied to a message receiving end, and the method includes: Based on the current channel, obtain the message packet sent by the message sender and add the message packet to the received message queue; Parse the message packet to obtain a second number of messages to be sent; If the sequence number of the message to be sent matches the sequence number of the received message queue, the message to be sent is placed into the message content buffer pool. Once all message packets have been parsed, a response is sent back to the message sender based on the current channel and the sequence number of the received message queue. According to the thread scheduling of the second target kernel, a second asynchronous parallel operation is performed on the message to be sent in the message content buffer pool, wherein the second target kernel is a kernel other than the kernel bound to the receiving message queue; The step of performing a second asynchronous parallel operation on the message to be sent in the message content buffer pool according to the thread scheduling of the second target kernel includes: when the second target kernel is scheduled, performing message content extraction processing, verification processing, and business logic processing on the message to be sent through the second target kernel.

7. The method according to claim 6, characterized in that, The step of acquiring the message packet sent by the message sender based on the current channel and adding the message packet to the received message queue includes: Obtain a protocol command carrying a message sent by the message sender, wherein the protocol command carrying the message includes the message packet; The protocol command carrying the message is added to the received message queue.

8. The method according to claim 6, characterized in that, Before parsing the message packet to obtain the second number of messages to be sent, the method further includes: Lock the message receiving queue.

9. The method according to claim 8, characterized in that, The step of sending an acknowledgment feedback to the message sender based on the current channel and the sequence number of the received message queue includes: Unlock the message receiving queue; Assign the sequence number of the received message queue to the protocol command corresponding to the current channel to obtain the protocol command carrying the response feedback; The protocol command carrying the response feedback is sent to the message sending end.

10. A message transmission device, characterized in that, The device is deployed at the message sending end, and the device includes: The dequeue module is used to determine the sequence number of the message to be sent when the message to be sent is successfully matched with the current port resource, the current channel and the message queue, dequeue the message to be sent and put the message to be sent into the current port resource; The first insertion module is used to obtain the redundancy amount based on the size of the current port resource and the size of the message to be sent, and to insert a first number of the messages to be sent from the message sending queue into the current port resource based on the redundancy amount. The module is configured to perform a first asynchronous parallel operation on the message to be sent in the current port resource according to the call status of the target function of the first target kernel, and obtain a message packet, wherein the first target kernel is a kernel other than the kernel bound to the message queue; The obtaining module includes: a processing unit, configured to, when the target function of the first target kernel is called, use the first target kernel to perform memory splicing and message packaging processing on all the messages to be sent in the current port resource to obtain the message packet; and a storage unit, configured to store the message packet in the current port resource. The first sending module is used to send the message packet to the message receiving end based on the current channel; The first acquisition module is used to acquire response feedback from the message receiving end based on the current channel, and determine whether to reclaim message resources based on the response feedback.

11. A message transmission device, characterized in that, The device is deployed at the message receiving end, and the device includes: The second acquisition module is used to acquire message packets sent by the message sender based on the current channel, and add the message packets to the received message queue; The parsing module is used to parse the message packet to obtain a second number of messages to be sent; The second insertion module is used to insert the message to be sent into the message content buffer pool when the sequence number of the message to be sent matches the sequence number of the received message queue. The second sending module is used to send a response feedback to the message sending end based on the current channel and the sequence number of the received message queue, after all the message packets have been parsed; The operation module is used to perform a second asynchronous parallel operation on the message to be sent in the message content buffer pool according to the thread scheduling of the second target kernel, wherein the second target kernel is a kernel other than the kernel bound to the receiving message queue; The operation module includes an operation unit, used to perform message content extraction, verification, and business logic processing on the message to be sent through the second target kernel when the second target kernel is scheduled.

12. A computer device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the message transmission method of any one of claims 1 to 9 by executing the computer instructions.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the steps of the message transmission method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Controller cluster of storage system, message transmission method of controller cluster and readable storage medium

    CN112187655A

  • Message transmission method, system, equipment and medium

    CN114363269A