CN-122027708-A - Service processing method and device
Abstract
A business processing method and device are applied to a first node, a first thread Cheng Weihu in the first node is used for corresponding relation between a first thread and a second thread, the second thread runs on the second node, the second thread is used for processing a message from the first node, the method comprises the steps that the first node obtains the second thread according to the corresponding relation and sends a first message to the second node, the first message comprises an address of the second node and an identifier of the second thread, and the first message is generated by the first thread. Because the corresponding relation between the first thread and the second thread is maintained by the first thread, the network card of the second node is not required to maintain, and the second node can directly distribute the first message to the second thread according to the identification of the second thread, so that the first message is processed. On the basis of realizing the first message processing, the pressure of data maintenance on the network card side is reduced, the network delay is reduced, and the data transmission efficiency and the throughput rate are improved.
Inventors
- WANG ZEKE
- ZHU XUEYING
- CHEN XUZHENG
- ZHOU PENGPENG
Assignees
- 华为技术有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20241110
Claims (19)
- 1. A service processing method, wherein the method is applied to a first node, a first thread in the first node maintains a correspondence between the first thread and a second thread, the second thread runs on a second node, and the second thread is used for processing a message from the first node, the method includes: Acquiring a second thread corresponding to the first thread according to the corresponding relation; and sending a first message to the second node, wherein the first message comprises the address of the second node and the identifier of the second thread, and the first message is generated by the first thread.
- 2. The method of claim 1, wherein the first packet further includes a first PSN corresponding to a first connection, the first connection being a connection between a first network interface card in the first node and a network interface card in the second node.
- 3. The method of claim 2, wherein the first node sending a first message to the second node comprises: Updating the PSN corresponding to the first connection to obtain the first PSN; and sending a first message to the second node through the first network interface card, wherein the first message comprises the first PSN.
- 4. A method according to claim 2 or 3, wherein the method further comprises: Receiving first feedback information from the second node, wherein the first feedback information comprises a second PSN corresponding to the first connection, and the second PSN is used for indicating the PSN or PSN range of a message successfully received by the second node in the message sent by the first node; And determining whether the first message is successfully received according to the second PSN and the first PSN included in the first message.
- 5. The method according to any of claims 1-4, wherein sending the first message to the second node comprises: And sending a first message to the second node through the first network interface card, wherein the first message also comprises first position information, and the first position information is used for indicating the position of the first message in a sliding window corresponding to the first network interface card in the first node.
- 6. The method of claim 5, wherein the method further comprises: receiving first feedback information from the second node, wherein the first feedback information comprises second position information, and the second position information is used for indicating the position of a message successfully received by the second node in a sliding window corresponding to the first network interface card in the message sent by the first node; And determining whether the first message is successfully received according to the second position information and the first position information included in the first message.
- 7. The method of any one of claims 1-6, wherein the method further comprises: Sending a second message to the second node, where the second message includes an address of the second node, an identifier of the second thread, a third PSN and third location information, the second message is generated by the first thread, the third PSN is a PSN corresponding to a first connection, the third location information is used to indicate a location of the second message in a sliding window corresponding to a first network interface card in the first node, and the first connection is a connection between the first network interface card and a network interface card in the second node; receiving second feedback information from the second node, wherein the second feedback information comprises the third PSN and the third position information; And if the first PSN corresponding to the first connection in the first message is smaller than the third PSN and the resource state of the first message in the sliding window is occupied, releasing the resources occupied by the first message in the sliding window.
- 8. The method of any of claims 1-7, wherein the first node and the second node are two different nodes in a distributed shared memory system, the first thread to process a first QP in the first node, and the second thread to process a second QP in the second node.
- 9. A method of traffic handling, the method being applied to a second node, the method comprising: Receiving a first message from a first node, wherein the first message comprises an identifier of the second thread, the first message is generated by a first thread, the first thread runs on the first node, and the first thread maintains a corresponding relation between the first thread and the second thread; and running the second thread to process the first message.
- 10. The method of claim 9, wherein the first packet further includes a first PSN corresponding to a first connection between a first network interface card in the first node and a network interface card in the second node.
- 11. The method of claim 9 or 10, wherein after the second node receives the first message from the first node, the method further comprises: And sending first feedback information to the first node, wherein the first feedback information comprises a second PSN corresponding to the first connection, and the second PSN is used for indicating the PSN or PSN range of a message successfully received by the second node in the message sent by the first node.
- 12. The method according to any one of claims 9-11, wherein the first message further includes first location information, where the first location information is used to indicate a location of the first message in a sliding window corresponding to a first network interface card in the first node.
- 13. The method of claim 12, wherein the method further comprises: and sending first feedback information to the first node, wherein the first feedback information comprises second position information, and the second position information is used for indicating the position of a message successfully received by the second node in a sliding window corresponding to the first network interface card in the message sent by the first node.
- 14. The method of any of claims 9-13, wherein the first node and the second node are two different nodes in a distributed shared memory system, the first thread to process a first QP in the first node, and the second thread to process a second QP in the second node.
- 15. The device is characterized by being a first node, wherein the first node comprises a first processing module and a first receiving and transmitting module, a first thread in the first node maintains a corresponding relation between the first thread and a second thread, the second thread runs on the second node, and the second thread is used for processing a message from the first node; The first processing module is used for acquiring a second thread corresponding to the first thread according to the corresponding relation; The first transceiver module is configured to send a first packet to the second node, where the first packet includes an address of the second node and an identifier of the second thread, and the first packet is generated by the first thread.
- 16. An apparatus, wherein the apparatus is a second node, the second node comprising a second transceiver module and a second processing module; The second transceiver module is configured to receive a first packet from a first node, where the first packet includes an identifier of the second thread, the first packet is generated by a first thread, the first thread runs on the first node, and the first thread maintains a correspondence between the first thread and the second thread; And the second processing module is used for running the second thread and processing the first message.
- 17. A communication device comprising at least one processor and a memory, the at least one processor being configured to read and execute program instructions stored in the memory, to cause the communication device to perform the operational steps of the method of any one of claims 1 to 8, or to cause the communication device to perform the operational steps of the method of any one of claims 9 to 14.
- 18. A non-transitory computer readable storage medium, characterized in that the non-transitory computer readable storage medium comprises a program which, when run on an apparatus, causes the apparatus to perform the operational steps of the method of any one of claims 1 to 8 or causes the apparatus to perform the operational steps of the method of any one of claims 9 to 14.
- 19. A computer program product, characterized in that the computer program product, when run on an apparatus, causes the apparatus to perform the operational steps of the method of any one of claims 1 to 8 or causes the apparatus to perform the operational steps of the method of any one of claims 9 to 14.
Description
Service processing method and device Technical Field The present application relates to the field of information technology (Information Technology, IT), and in particular, to a service processing method and apparatus. Background Data transmission refers to the transmission of data from a sender to a receiver over one or more data links, which serves to transfer and exchange information from point to point. The data transmission may include a connection process and a subsequent transceiving process, wherein the connection process refers to a process of establishing a connection between one node and another node, and the transceiving process refers to a process of exchanging data between two nodes on the basis of establishing a connection between one node and another node. In an application scenario, establishing a connection between one node and another node means that an application thread of one node establishes a connection with a system thread of another node, so that an application deployed at the node can access data of another node. It can be seen that in this scenario, a connection with thread granularity is established between two nodes, and the thread that established the connection is used to transfer data between the two nodes. For example, one node sends a first message to another node based on an application thread, and the other node responds to the first message based on a system thread that establishes a connection with (or otherwise corresponds to) the application thread. In general, state information of threads for establishing connection is maintained in a network interface card (may be simply referred to as a network card) of a node, which may increase information required to be maintained by the network card, thereby increasing data processing pressure on the network card side, and causing problems of high network delay, slow data transmission and low throughput rate. Disclosure of Invention The application provides a service processing method and a service processing device, which are used for reducing the data volume maintained by a network card side, thereby reducing network delay and improving data transmission efficiency and throughput rate. In a first aspect, the present application provides a service processing method, where the method is applied to a communication apparatus, where the communication apparatus may be a network device (such as a server), or a chip, a unit, or a module in the network device, and the communication apparatus may also be a terminal device, or a chip, a unit, or a module in the terminal device. The communication device may be a node, such as a first node, in a service processing system. The first thread Cheng Weihu in the first node is a correspondence between a first thread and a second thread running on the second node, the second thread being configured to process a message from the first node. Based on this, the method comprises: And then, sending a first message to the second node, wherein the first message comprises the address of the second node and the identification of the second thread, and the first message is generated by the first thread. In the above method, the first thread runs on the processor of the first node, and similarly, the second thread runs on the processor of the second node. The first thread of the first node establishes a connection with the second thread of the second node, or the first thread and the second thread are a pair of threads correspondingly establishing a connection. Because the corresponding relation between the first thread and the second thread (or the state information corresponding to the first thread) is maintained by the first thread (or maintained by the processor of the first node), and the second thread is determined by the first node, no network card of the second node is needed to maintain the state information corresponding to the first thread, i.e. after the second node receives the first message, the second node can directly distribute the first message to the second thread connected with the first thread according to the identifier of the second thread, and then the second thread is operated to process the first message. The second node does not need to determine state information corresponding to the first thread according to the identification of the first thread (the state information can indicate the thread connected with the first thread) to obtain a second thread connected with the first thread, so that the pressure of data maintenance on the network card side can be reduced, the network delay is reduced, and the data transmission efficiency and the throughput rate are improved. It can be understood that the network card side needs to maintain connection between the first node and the second node, for example, connection between the network card of the first node and the network card of the second node, so as to ensure accuracy of data transmission. A possible implementation manner, the fi