Network message processing method and device

By setting a small number of second queues and queue mapping tables in the DPU, combined with the multi-thread mode of the message distribution module, the problem of excessive DPU resource consumption is solved, network message processing performance is improved, and the control plane design is simplified.

CN117640796BActive Publication Date: 2024-10-25BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410013005.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-03
Publication Date
2024-10-25
Estimated Expiration
2044-01-03

AI Technical Summary

Technical Problem

During the network packet forwarding process, the DPU needs to set up the same number of queues as the server, resulting in excessive resource consumption and affecting processing performance.

Method used

By setting up a smaller number of second queues in the DPU, using the queue mapping table to record the queue mapping relationship between the first server and the data processor, calling the message distribution module to read network messages from the destination second queue for transmission. , reducing the number of queues and simplifying the control plane design.

Benefits of technology

It reduces DPU hardware and software resource consumption, improves network packet processing performance, simplifies control plane design, and decouples the one-to-one mapping relationship between the first server and the second queue.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117640796B_ABST
    Figure CN117640796B_ABST
Patent Text Reader

Abstract

The present disclosure provides a network message processing method and device, the method comprising: reading a first network message from a first queue maintained in a first server; querying a queue mapping table maintained in a data processor to determine a destination second queue to which the first network message should be transmitted, and storing the first network message in the destination second queue; wherein the queue mapping table is used to record the mapping relationship between each first queue maintained in the first server and each second queue maintained in the data processor, wherein the number of first queues is greater than the number of second queues; calling a message distribution module in the data processor, and reading the first network message from the destination second queue through the message distribution module and transmitting it to the destination second server through the network. The present disclosure reduces the number of queues in the data processor by decoupling the one-to-one mapping relationship between the queues in the first server and the queues in the data processor, thereby reducing resource consumption in the data processor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of message forwarding, and in particular to a network message processing method and device. Background Art

[0002] DPU (Data Processing Unit) is a special processor. DPU is connected to the server, processes the server's network messages, and sends the server's network messages to the second server to provide network for the server.

[0003] Currently, the DPU needs to set up the same number of queues as the server, and then establish a one-to-one mapping relationship between the queues in the DPU and the queues in the server to achieve network message forwarding, but this method consumes a large amount of DPU resources. Summary of the invention

[0004] The embodiments of the present disclosure provide a network message processing method and device to reduce the resource consumption of a DPU.

[0005] In a first aspect, an embodiment of the present disclosure provides a network message processing method, comprising: reading a first network message from a first queue maintained in a first server; querying a queue mapping table maintained in a data processor to determine a destination second queue to which the first network message should be transmitted, and storing the first network message in the destination second queue; wherein the queue mapping table is used to record the mapping relationship between each first queue maintained in the first server and each second queue maintained in the data processor, wherein the number of first queues is greater than the number of second queues; calling a message distribution module in the data processor, and reading the first network message from the destination second queue through the message distribution module and transmitting it to the destination second server through the network.

[0006] In a second aspect, an embodiment of the present disclosure provides a network message processing device, including:

[0007] A reading unit, configured to read a first network message from a first queue maintained in a first server;

[0008] A query unit, used to query a queue mapping table maintained in the data processor to determine the destination second queue to which the first network message should be transmitted, and store the first network message in the destination second queue; wherein the queue mapping table is used to record the mapping relationship between each first queue maintained in the first server and each second queue maintained in the data processor, wherein the number of the first queues is greater than the number of the second queues;

[0009] The calling unit is used to call the message distribution module in the data processor, and read the first network message from the destination second queue through the message distribution module and transmit it to the destination second server through the network.

[0010] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;

[0011] Memory stores computer-executable instructions;

[0012] At least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the network message processing method provided in the first aspect above.

[0013] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the network message processing method provided in the first aspect above is implemented.

[0014] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided. The computer program product includes computer execution instructions. When a processor executes the computer execution instructions, the network message processing method provided in the first aspect above is implemented.

[0015] The network message processing method and device provided in this embodiment include: reading a first network message from a first queue maintained in a first server; querying a queue mapping table maintained in a data processor to determine a destination second queue to which the first network message should be transmitted, and storing the first network message in the destination second queue; wherein the queue mapping table is used to record the mapping relationship between each first queue maintained in the first server and each second queue maintained in the data processor, wherein the number of first queues is greater than the number of second queues; calling a message distribution module in the data processor, and reading the first network message from the destination second queue through the message distribution module and transmitting it to the destination second server through the network. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0017] Figure 1 A schematic diagram of a network message processing method provided for related technologies;

[0018] Figure 2 A flowchart of a method for processing network messages provided by an embodiment of the present disclosure;

[0019] Figure 3A schematic diagram of a network message processing method provided by an embodiment of the present disclosure;

[0020] Figure 4 A flowchart of another method for processing network messages provided by an embodiment of the present disclosure;

[0021] Figure 5 A flowchart of another method for processing network messages provided by the embodiment of the present disclosure;

[0022] Figure 6 A structural block diagram of a network message processing device provided in an embodiment of the present disclosure;

[0023] Figure 7 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0025] In the related art, the Figure 1 The data processor shown in the figure realizes the forwarding of the message. Figure 1 In the example, the first server includes queues a1 to an, and n is a positive integer greater than 1. The DPU includes queues b1 to bn, wherein the first server and the queues in the DPU correspond one to one, and the DPU is used to forward the network message in the first server to the second server, wherein, Figure 1 In the example, the second server c1 to the second server cm are included, and m is a positive integer. It can be seen that in the related art, the DPU needs to implement a large number of queues, which are used to temporarily store the network messages to be processed. The implementation of these queues consumes a large amount of hardware and soft resources.

[0026] exist Figure 1In the example, when there are n queues on the first server, n queues must also be implemented on the DPU, where n is generally greater than or equal to 1024. The queues of the first server correspond one-to-one to the queues on the DPU. The queues on the DPU are responsible for forwarding the network messages of the first server to the external network (the second server) and forwarding the network messages of the external network to the first server. The process is as follows: first, the first server places the first network message in a queue of the first server, such as queue a1; then the DPU takes out the network message of queue a1 and places it in queue b1; then the DPU takes out the network message in queue b1 and sends it to the external network. It can be seen that this process requires the DPU to implement a large number of queues and consume a large number of hardware resources. In addition, due to the large number of queues in the DPU, a large number of software resources need to be consumed for processing, which will lead to the deterioration of the network message processing performance of the DPU. Furthermore, the queues in the first server correspond one-to-one to the queues in the DPU, and some status information needs to be synchronized between the one-to-one corresponding queues, such as queue opening, queue closing, etc., which will lead to the complexity of the design of the control plane used to synchronize these states.

[0027] Based on the above problems, the network message processing method provided by the present disclosure is applied to the DPU. The present disclosure can reduce the consumption of hardware and software resources in the DPU by setting a smaller number of second queues in the DPU. In addition, fewer second queues occupy fewer resources in the DPU, thereby improving the network message processing performance of the DPU. Furthermore, the one-to-one mapping relationship between the first queue and the second queue of the first server is decoupled, which can reduce the design of the synchronization state on the control plane and simplify the design of the control plane.

[0028] Above Figure 1 This is an application scenario of the present disclosure and is only one of the scenario examples. The embodiment of the present disclosure can be applied to the network message processing method in any scenario.

[0029] refer to Figure 2 , is a flow chart of a network message processing method provided by an embodiment of the present disclosure. Figure 2 As shown, the network message processing method is applied to a data processor. In the disclosed embodiment, the data processor implements the function of simulating a hardware network card device for the first server, forwarding the network message of the first server to the external network, and forwarding the network message of the external network to the first server. Specifically, the network message processing method specifically includes the following steps:

[0030] S201. Read a first network message from a first queue maintained in a first server.

[0031] Reference Figure 3 ,contrast Figure 1 , the present disclosure does not make any improvements to the first server and the second server, but only improves the DPU.

[0032] The first server includes multiple first queues, such as Figure 3 The destination first queue is one of the multiple first queues, and the destination first queue stores the first network message.

[0033] Exemplarily, the first server places the first network message in one of the first queues, such as queue a1 of the first server, and the quantity processor obtains the first network message from the first queue (such as queue a1).

[0034] S202: query a queue mapping table maintained in a data processor to determine a destination second queue to which the first network message should be transmitted, and store the first network message in the destination second queue.

[0035] The queue mapping table maintains mapping relationships between multiple first queues and multiple second queues, wherein one first queue is mapped to only one second queue, but one second queue supports mapping of multiple first queues.

[0036] Specifically, the destination second queue is one of multiple second queues in the data processor, wherein the queue mapping table is used to record the mapping relationship between each first queue maintained in the first server and each second queue maintained in the data processor, wherein the number of first queues is greater than the number of second queues.

[0037] In the embodiment of the present disclosure, the number of the second queues is less than the number of the first queues. Optionally, the present disclosure may set a single-digit number of second queues, such as 2 or 4. The number of the first queues is greater than or equal to 1024.

[0038] In addition, the queue mapping table stores a mapping relationship between the first queue and the second queue, wherein one first queue corresponds to one second queue, and one second queue may correspond to multiple first queues. Further, the initial mapping relationship in the queue mapping table may be pre-configured, such as Figure 3 In the example, queue a1 maps queue d1, queue a2 maps queue d1, queue a3 to the first queue in queue a(n-1), some can be mapped to queue d1 and some can be mapped to queue d2, and queue an maps to queue d2.

[0039] For example, refer to Figure 3 If the first queue where the first network message is located is queue a1, then according to the mapping relationship in the queue mapping table, it can be determined that the destination second queue is queue d1.

[0040] S203: calling a message distribution module in the data processor, reading a first network message from the destination second queue through the message distribution module, and transmitting the message to the destination second server through the network.

[0041] In the present disclosure, the first network message is stored in the destination second queue to be forwarded to the corresponding second server.

[0042] Furthermore, when the DPU obtains the first network message, it can determine the destination first queue from which the first network message comes, and then add the queue identifier of the destination first queue to the first network message, and then store it in the destination second queue. Then, the first network message stored in the destination second queue includes the queue identifier of the destination first queue.

[0043] Before sending the first network message to the corresponding destination second server, the method includes: extracting destination address information in the first network message; determining multiple second servers corresponding to the destination first queue; and determining the destination second server from the multiple second servers according to the destination address information.

[0044] In the embodiment of the present disclosure, each first queue may correspond to multiple second servers. Figure 3 , queues a1 to a32 all correspond to the second servers c1 to c50, and queues a33 to a64 all correspond to the external network services c71 to c100.

[0045] Furthermore, the first network message includes destination address information, and the destination address information may be an IP address of a destination second server.

[0046] It can be understood that the present disclosure can first determine multiple second servers by the queue identifier of the destination first queue. For example, if the queue identifier of the destination first queue is queue a1, the multiple second servers determined are second servers c1 to second servers c50. Then, the second server corresponding to the destination address information is determined as the destination second server (such as second server c18) among the multiple second servers. It can be seen that the present disclosure first determines some second servers by queue identifiers, which can narrow the scope of the second servers and thus improve the efficiency of finding the destination second server.

[0047] In the disclosed embodiment, firstly, the number of second queues in the DPU is reduced, so that only a small number of second queues (such as a single-digit second queue) are set in the DPU, which saves a lot of hardware resources and software resources, and improves the network message processing capability of the DPU. Secondly, the first queue and the second queue are decoupled, so that there is no longer a one-to-one mapping relationship between the first queue in the first server and the second queue in the DPU, so that the network messages in the first queue can be sent to any second queue according to the configuration of the queue mapping table. In addition, the first queue and the second queue do not need to be in a synchronized state, which simplifies the design of the control plane. Finally, a new message distribution module is added to the DPU. When there are multiple network messages of the first queue in a second queue, the message distribution module can identify the network messages of different first queues and correctly distribute the first network messages to the second server. In addition, the network messages of the second server can also be correctly forwarded to the first queue.

[0048] refer to Figure 4 , is a flow chart of another network message processing method provided by an embodiment of the present disclosure. Figure 4 As shown, the network message processing method specifically includes the following steps:

[0049] S401. Read a first network message from a first queue maintained in a first server.

[0050] The specific implementation process of this step refers to S201 and will not be repeated here.

[0051] S402: query a queue mapping table maintained in a data processor to determine a destination second queue to which the first network message should be transmitted, and store the first network message in the destination second queue.

[0052] The specific implementation process of this step refers to S202 and will not be repeated here.

[0053] S403, calling the message distribution module in the data processor, controlling the message distribution module to adopt a multi-threaded mode, allocating a second queue in the data processor to each thread, and different threads corresponding to different second queues.

[0054] S404: Call the first target thread corresponding to the destination second queue, and read the first network message through the first target thread and transmit it to the destination second server through the network.

[0055] Among them, the first network message is read from the destination second queue by the message distribution module and transmitted to the destination second server through the network, including: reading the first network message from the destination second queue by the message distribution module, identifying the destination second server to which the first network message should be transmitted, and transmitting to the destination second server through the network.

[0056] Furthermore, the first network message is read by the first target thread and transmitted to the destination second server through the network, including: determining the destination first queue from which the first network message comes, and determining the second target thread having a mapping relationship with the target first queue, wherein a corresponding thread is set for each first queue of the server; if the second target thread is not the same thread as the first target thread, the first network message is read by the first target thread and forwarded to the second target thread; and the first network message is transmitted to the destination second server through the network by the second target thread.

[0057] Furthermore, the method further includes: determining a target second queue corresponding to the second target thread; and updating a mapping relationship between the target first queue and the target second queue in the queue mapping table to a mapping relationship between the target first queue and the target second queue.

[0058] The message distribution module adopts a multi-threaded mode, and the threads correspond to the second queues one by one.

[0059] In the present disclosure, the message distribution module uses a multi-thread queue self-allocation mechanism to establish a mapping relationship between the second queue and the thread, that is, each second queue automatically allocates a thread, and the thread forwards the first network message in the corresponding second queue.

[0060] In the embodiment of the present disclosure, after the mapping relationship between the second queue and the thread is established by the multi-thread queue self-allocation mechanism, the first target thread corresponding to the destination second queue is determined according to the mapping relationship. Figure 3 , if the destination second queue is queue d1, the corresponding first target thread is thread e1.

[0061] Furthermore, the first target thread is used to obtain the first network message from the destination second queue. If the first target thread corresponds to the destination first queue, the first network message can be forwarded to the corresponding second server. If the first target thread does not correspond to the destination first queue, the second target thread corresponding to the destination first queue is determined among multiple threads.

[0062] It can be understood that the message distribution module has a self-coordination mechanism, that is, each first queue has a corresponding thread, and one thread can correspond to multiple first queues, so that the first network messages can be ensured to be sent to the second server in an orderly manner.

[0063] For example, refer to Figure 3 , if the destination second queue (queue d1) corresponds to the first target thread (thread e1), but the destination first queue (queue a1) does not correspond to the first target thread (thread e1), then determine the second target thread (thread e2) corresponding to the destination first queue (queue a1).

[0064] In the disclosed embodiment, the first target thread forwards the acquired first network message to the second target thread, and the second target thread sends the first network message to the corresponding destination second server.

[0065] The second target thread sends the first network message to the corresponding destination second server, including: extracting the destination address information in the first network message; determining multiple second servers corresponding to the destination first queue; and determining the destination second server from the multiple second servers according to the destination address information.

[0066] In the embodiment of the present disclosure, the target second queue corresponding to the second target thread is determined based on the mapping relationship established in step S404.

[0067] Exemplarily, a target second queue (such as queue d2) corresponding to a second target thread (such as thread e2) is determined.

[0068] In the queue mapping table, the first destination queue has a mapping relationship with the second destination queue. After the update, the first destination queue has a specific mapping relationship with the second destination queue. In the subsequent forwarding process of network messages, the network messages of the first destination queue can be sent to the second destination queue for storage, and the network messages stored in the second destination queue can be forwarded to the second server by the second target thread, which also corresponds to the first destination queue. Then, the network messages taken out by the second target thread can be sent to the external network by the second target thread, avoiding the problem of network message loss and improving the processing performance of network messages.

[0069] In an optional embodiment, referring to Figure 5 , is a flow chart of another network message processing method, the flow chart is a process of DPU forwarding network messages from an external network to a first server, the network message processing method is based on Figure 3 The DPU shown, the network message processing method specifically includes the following steps:

[0070] S501, calling a message distribution module in a data processor to obtain a second network message, wherein the second network message carries a target first queue to which the message should be transmitted.

[0071] In the embodiment of the present disclosure, the second network message sent by any second server is received by any thread in the message distribution module.

[0072] S502: Store the second network message into any second queue in the data processor.

[0073] In the embodiment of the present disclosure, the distribution module may store the second network message in any second queue.

[0074] S503, reading a second network message from any second queue, identifying a target first queue to which the second network message should be transmitted, and transmitting the second network message to the target first queue.

[0075] The second network message carries a queue identifier of the target first queue, and the target first queue can be determined according to the queue identifier.

[0076] After the target first queue is determined, the second network message in any second queue is stored in the target first queue, completing the storage of the network message from the second server to the queue of the first server.

[0077] Corresponding to the network message processing method of the above embodiment, Figure 6 FIG. 6 is a structural block diagram of a network message processing device 60 provided in an embodiment of the present disclosure. For ease of explanation, only the parts related to the embodiment of the present disclosure are shown. Figure 6 As shown, the network message processing device 60 specifically includes: a reading unit 61, a query unit 62, and a calling unit 63, wherein:

[0078] The reading unit 61 is used to read the first network message from the first queue maintained in the first server;

[0079] A query unit 62 is used to query the queue mapping table maintained in the data processor to determine the destination second queue to which the first network message should be transmitted, and store the first network message in the destination second queue; wherein the queue mapping table is used to record the mapping relationship between each first queue maintained in the first server and each second queue maintained in the data processor, wherein the number of the first queues is greater than the number of the second queues;

[0080] The calling unit 63 is used to call the message distribution module in the data processor, and read the first network message from the destination second queue through the message distribution module and transmit it to the destination second server through the network.

[0081] In some embodiments, the calling unit 63 is specifically used to call the message distribution module in the data processor, control the message distribution module to adopt a multi-threaded mode, allocate a second queue in the data processor to each thread, and different threads correspond to different second queues; call the first target thread corresponding to the destination second queue, read the first network message through the first target thread, and transmit it to the destination second server through the network.

[0082] In some embodiments, the calling unit 63, when reading the first network message through the first target thread and transmitting it to the destination second server through the network, is specifically used to: determine the destination first queue from which the first network message comes, and determine the second target thread having a mapping relationship with the target first queue, wherein a corresponding thread is set for each first queue of the server; if the second target thread is not the same thread as the first target thread, then the first network message is read by the first target thread and forwarded to the second target thread; and the first network message is transmitted to the destination second server through the network through the second target thread.

[0083] In some embodiments, the calling unit 63 is further used to: determine the target second queue corresponding to the second target thread; and update the mapping relationship between the target first queue and the target second queue in the queue mapping table to a mapping relationship between the target first queue and the target second queue.

[0084] In some embodiments, it also includes: a forwarding unit (not shown), which is used to call the message distribution module in the data processor to obtain a second network message, wherein the second network message carries a target first queue to which it should be transmitted; the second network message is stored in any second queue in the data processor; the second network message is read from any second queue, and the target first queue to which the second network message should be transmitted is identified, and the second network message is transmitted to the target first queue.

[0085] In some embodiments, the queue mapping table maintains a mapping relationship between a plurality of first queues and a plurality of second queues, wherein one first queue is mapped to only one second queue, but one second queue supports mapping of a plurality of first queues.

[0086] In some embodiments, the calling unit 63 is specifically used to: read the first network message from the destination second queue through the message distribution module, identify the destination second server to which the first network message should be transmitted, and transmit it to the destination second server through the network.

[0087] The network message processing device provided in this embodiment can be used to execute the technical solution of the embodiment of the above-mentioned network message processing method. Its implementation principle and technical effect are similar, and this embodiment will not be repeated here.

[0088] refer to Figure 7, which shows a schematic diagram of the structure of an electronic device 70 suitable for implementing the embodiment of the present disclosure, and the electronic device 70 may be a terminal device or a server. The terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0089] like Figure 7 As shown, the electronic device 70 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 71, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 72 or a program loaded from a storage device 78 to a random access memory (RAM) 73. Various programs and data required for the operation of the electronic device 70 are also stored in the RAM 73. The processing device 71, the ROM 72, and the RAM 73 bus 74 are connected to each other. An input / output (I / O) interface 75 is also connected to the bus 74.

[0090] Typically, the following devices may be connected to the I / O interface 75: input devices 56 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 77 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 78 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 79. The communication device 79 may allow the electronic device 70 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 70 is shown with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.

[0091] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network by the communication device 79, or installed from the storage device 78, or installed from the ROM 92. When the computer program is executed by the processing device 71, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0092] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0093] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0094] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0095] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect to the Internet).

[0096] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a unit, a program segment or a part of a code, and the unit, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0097] The units involved in the embodiments described in the present disclosure may be implemented in software or hardware. The name of a unit does not limit the unit itself in some cases. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".

[0098] The functions described above in this article may be at least partially performed by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Parts (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD), etc.

[0099] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM, Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM, Compact Disc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0100] In a first aspect, according to one or more embodiments of the present disclosure, a network message processing method is provided, comprising: reading a first network message from a first queue maintained in a first server; querying a queue mapping table maintained in a data processor to determine a destination second queue to which the first network message should be transmitted, and storing the first network message in the destination second queue; wherein the queue mapping table is used to record the mapping relationship between each first queue maintained in the first server and each second queue maintained in the data processor, wherein the number of first queues is greater than the number of second queues; calling a message distribution module in the data processor, and reading the first network message from the destination second queue through the message distribution module and transmitting it to the destination second server through the network.

[0101] According to one or more embodiments of the present disclosure, calling a message distribution module in a data processor, reading a first network message from a destination second queue through the message distribution module and transmitting the message to a destination second server through a network includes:

[0102] Calling a message distribution module in a data processor, controlling the message distribution module to adopt a multi-threaded mode, allocating a second queue in the data processor to each thread, and different threads corresponding to different second queues;

[0103] The first target thread corresponding to the destination second queue is called, and the first network message is read by the first target thread and transmitted to the destination second server through the network.

[0104] According to one or more embodiments of the present disclosure, reading a first network message through a first target thread and transmitting the message to a destination second server through a network includes:

[0105] Determine a destination first queue from which the first network message comes, and determine a second target thread having a mapping relationship with the target first queue, wherein a corresponding thread is set for each first queue of the server;

[0106] If the second target thread is not the same thread as the first target thread, the first network message is read by the first target thread and forwarded to the second target thread;

[0107] The first network message is transmitted to the destination second server through the network through the second target thread.

[0108] According to one or more embodiments of the present disclosure, the present invention further includes:

[0109] Determine a target second queue corresponding to the second target thread;

[0110] The mapping relationship between the destination first queue and the destination second queue in the queue mapping table is updated to a mapping relationship between the destination first queue and the target second queue.

[0111] According to one or more embodiments of the present disclosure, the present invention further includes:

[0112] Calling a message distribution module in a data processor to obtain a second network message, wherein the second network message carries a target first queue to which the message should be transmitted;

[0113] storing the second network message in any second queue in the data processor;

[0114] The second network message is read from any second queue, and the target first queue to which the second network message should be transmitted is identified, and the second network message is transmitted to the target first queue.

[0115] According to one or more embodiments of the present disclosure, a queue mapping table maintains mapping relationships between multiple first queues and multiple second queues, wherein one first queue is mapped to only one second queue, but one second queue supports mapping of multiple first queues.

[0116] According to one or more embodiments of the present disclosure, a message distribution module reads a first network message from a destination second queue and transmits the message to a destination second server through a network, including:

[0117] The first network message is read from the destination second queue through the message distribution module, the destination second server to which the first network message should be transmitted is identified, and the message is transmitted to the destination second server through the network.

[0118] In a second aspect, according to one or more embodiments of the present disclosure, a network message processing device is provided, including:

[0119] A reading unit, configured to read a first network message from a first queue maintained in a first server;

[0120] A query unit, used to query a queue mapping table maintained in the data processor to determine the destination second queue to which the first network message should be transmitted, and store the first network message in the destination second queue; wherein the queue mapping table is used to record the mapping relationship between each first queue maintained in the first server and each second queue maintained in the data processor, wherein the number of the first queues is greater than the number of the second queues;

[0121] The calling unit is used to call the message distribution module in the data processor, and read the first network message from the destination second queue through the message distribution module and transmit it to the destination second server through the network.

[0122] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;

[0123] Memory stores computer-executable instructions;

[0124] At least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the network message processing method provided in the first aspect above.

[0125] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the network message processing method provided in the first aspect above is implemented.

[0126] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided. The computer program product includes computer execution instructions. When a processor executes the computer execution instructions, the network message processing method provided in the first aspect above is implemented.

[0127] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0128] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0129] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A network message processing method, characterized in that: include: Reading a first network message from a first queue maintained in a first server; Querying a queue mapping table maintained in a data processor to determine a destination second queue to which the first network message should be transmitted, adding a queue identifier of the destination first queue of the first network message to the first network message and storing it in the destination second queue; wherein the queue mapping table is used to record a mapping relationship between each first queue maintained in the first server and each second queue maintained in the data processor, wherein the number of first queues is greater than the number of second queues; wherein one first queue is mapped to one second queue, and one second queue supports mapping of multiple first queues; Calling a message distribution module in the data processor, reading the first network message from the destination second queue through the message distribution module and transmitting the first network message to the destination second server through the network; wherein the destination second server is determined by the destination address information in the first network message; The calling of the message distribution module in the data processor, reading the first network message from the destination second queue through the message distribution module and transmitting the first network message to the destination second server through the network, comprises: Calling a message distribution module in the data processor, controlling the message distribution module to adopt a multi-threaded mode, allocating a second queue in the data processor to each thread, and different threads correspond to different second queues; A first target thread corresponding to the destination second queue is called, and the first network message is read by the first target thread and transmitted to the destination second server through the network.

2. The network message processing method according to claim 1, characterized in that: The step of reading the first network message through the first target thread and transmitting the message to the destination second server through the network includes: Determine a first queue from which the first network message comes, and determine a second target thread having a mapping relationship with the first queue, wherein a corresponding thread is set for each first queue of the server; If the second target thread is not the same thread as the first target thread, reading the first network message through the first target thread and forwarding it to the second target thread; The first network message is transmitted to the destination second server through the network through the second target thread.

3. The network message processing method according to claim 2, characterized in that: Also includes: Determine a target second queue corresponding to the second target thread; The mapping relationship between the destination first queue and the destination second queue in the queue mapping table is updated to a mapping relationship between the destination first queue and the target second queue.

4. The network message processing method according to claim 1, characterized in that: Also includes: Calling a message distribution module in the data processor to obtain a second network message, wherein the second network message carries a target first queue to which the message should be transmitted; storing the second network message in any second queue in the data processor; The second network message is read from any one of the second queues, and a target first queue to which the second network message should be transmitted is identified, and the second network message is transmitted to the target first queue.

5. A network message processing device, characterized in that: include: A reading unit, configured to read a first network message from a first queue maintained in a first server; A query unit, used for querying a queue mapping table maintained in a data processor to determine a destination second queue to which the first network message should be transmitted, and adding a queue identifier of the destination first queue of the first network message to the first network message and then storing it in the destination second queue; wherein the queue mapping table is used to record a mapping relationship between each first queue maintained in the first server and each second queue maintained in the data processor, wherein the number of first queues is greater than the number of second queues; wherein one first queue is mapped to one second queue, and one second queue supports mapping of multiple first queues; A calling unit, configured to call a message distribution module in the data processor, and read the first network message from the destination second queue through the message distribution module and transmit the first network message to the destination second server through the network; wherein the destination second server is determined by the destination address information in the first network message; The calling unit is specifically used to call the message distribution module in the data processor, control the message distribution module to adopt a multi-threaded mode, allocate a second queue in the data processor to each thread, and different threads correspond to different second queues; A first target thread corresponding to the destination second queue is called, and the first network message is read by the first target thread and transmitted to the destination second server through the network.

6. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the network message processing method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the network message processing method according to any one of claims 1 to 4 is implemented.

8. A computer program product, comprising a computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the network message processing method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Method and device for saving DMA channel resources in high-speed intelligent network card / DPU

    CN114885045A

  • Message transmission method and device

    CN115242728A

  • Message processing method and device, electronic equipment and storage medium

    CN115499387A

  • File transmission method and device, electronic equipment and computer readable storage medium

    CN115987972A

  • Fabric control protocol for large-scale multi-stage data center networks

    US20210320820A1