Message processing method, device and system
By generating packet copying on the first motherboard network card of the communication device and sending it directly to the second motherboard processor, the problem of long message processing path in the communication device is solved, and the packet processing efficiency is improved.
Patent Information
- Application Number
- CN202311230274.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2025-03-25
AI Technical Summary
The message processing path in the communication device is long, resulting in low packet processing efficiency.
By generating a copy message on the network card of the first motherboard and sending it directly to the processor of the second motherboard, copying and transmission through the processor of the first motherboard is avoided.
The transmission path during message processing is shortened, processing time is reduced, and the message processing efficiency of communication equipment is improved.
Smart Images

Figure CN119697197A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a message processing method, device and message processing system. Background Art
[0002] The motherboard is an important hardware device in the communication equipment. The motherboard is responsible for receiving external data and processing the data. The motherboard is also used to control the data transmission between other hardware devices. When the communication equipment is working, the motherboard needs to run uninterruptedly for a long time. In order to ensure the normal operation of the communication equipment, a redundant design is usually adopted to back up the motherboard, that is, two motherboards with the same structure and function in the communication equipment, so that when the mainboard fails, the main and backup switches can be realized in time.
[0003] Assume that a first mainboard and a second mainboard are installed in a communication device, and both the first mainboard and the second mainboard may include a processor and a network card. When both mainboards are in working state, the network card of the first mainboard receives a first message from other communication devices, sends the first message to the processor of the first mainboard, the processor of the first mainboard copies the first message, obtains a copy of the first message, and sends the copy of the first message to the second mainboard through the network card of the first mainboard. The application running in the processor of the first mainboard processes the first message and generates a first response message. The network card of the second mainboard receives a copy of the first message sent by the first mainboard, sends the copy of the first message to the processor of the second mainboard, the application running in the processor of the second mainboard processes the copy of the first message, generates a second response message, returns the second response message to the network card of the first mainboard through the network card of the second mainboard, the network card of the first mainboard transmits the second response message to the processor of the first mainboard, and the processor of the first mainboard processes the first response message and the second response message.
[0004] The message processing process in the above communication device has a long path and low message processing efficiency. Summary of the invention
[0005] The present application provides a message processing method, device and message processing system, which can improve the message processing efficiency of communication equipment.
[0006] In a first aspect, a message processing method is provided, which can be applied to a communication device, the communication device can include a first mainboard and a second mainboard, and the method can be performed by a first network card set on the first mainboard. The message processing method can include the first network card sending a received first message to a first processor on the first mainboard; the first network card generating a copy of the first message, and sending the copy of the first message to a second processor on the second mainboard.
[0007] In the above-mentioned message processing method, the network card on the first mainboard generates a copy message of the first message. On the one hand, there is no need for the processor on the first mainboard to generate a copy message of the first message, which can reduce the resource consumption of the processor; on the other hand, after the network card on the first mainboard generates the copy message, the copy message can be directly sent to the second processor on the second mainboard without passing through the processor on the first mainboard, which can shorten the transmission path of the message during the message processing, reduce the time consumed due to the long message transmission path, and improve the message processing efficiency of the communication equipment.
[0008] In one possible implementation, the first message includes the port address of the first network card. When copying the first message, the port address of the first network card in the copied first message can be modified to the port address of the second network card on the second mainboard to obtain a copy of the first message.
[0009] In a possible implementation, if the first network card receives at least one response message for the first message, the at least one response message may be processed according to the reception time of the at least one response message, wherein the at least one response message may include a response message returned by the first processor or a response message returned by the second processor.
[0010] In the above implementation, the response message is processed by the network card on the first mainboard, and there is no need to transmit the response message to the processor on the first mainboard for processing, which can further shorten the message transmission path during the message processing process and improve the message processing efficiency of the communication device.
[0011] In a possible implementation, for the first response message, if the first network card does not receive a response message of the first message before the reception time of the first response message, the first response message is sent; if the first network card receives a response message of the first message before the reception time of the first response message, the first response message is discarded. The first response message may be any response message of the at least one response message.
[0012] In the above implementation, the first network card may process the response messages according to the sequence of the received response messages.
[0013] In one possible implementation, if the first network card receives a copy of the second message sent by the second network card on the second mainboard, the copy of the second message can be sent to the first processor, and a response message to the second message sent by the first processor can be received, and the response message to the second message can be sent to the second network card.
[0014] In a possible implementation, the first network card may also receive a heartbeat message sent by the second mainboard. If a time duration during which the heartbeat message is not received reaches a set time duration, it is determined that the second mainboard is faulty.
[0015] In a possible implementation, if the second main board is the active board, the first network card may send active / standby switch notification information to the second main board.
[0016] In the above implementation method, the first mainboard and the second mainboard can perform mutual fault detection through the network cards on the mainboards. Performing fault detection through the network cards on the mainboards can shorten the transmission path of the heartbeat message, improve fault detection efficiency, and shorten the time required for primary-slave switching when a fault occurs.
[0017] In a second aspect, a message processing device is provided, wherein the fault processing device includes various modules for executing the message processing method in the first aspect or any possible implementation manner of the first aspect.
[0018] In a third aspect, a network card is provided, which can be applied to a mainboard, comprising a memory and a network card processor, wherein the memory stores a computer program that can be run on the processor, and when the computer program is executed by the processor, the processor implements the operating steps of the method described in the first aspect or any possible implementation method of the first aspect.
[0019] In a fourth aspect, a chip is provided, comprising a network card processor and a power supply circuit; the power supply circuit is used to power the processor, and the network card processor is used to execute a computer program to implement the operating steps of the method described in the first aspect or any possible implementation method of the first aspect.
[0020] In a fifth aspect, a message processing system is provided, comprising a processor and a network card connected to the processor, wherein the network card is used to execute a computer program to implement the operating steps of the method described in the first aspect or any possible implementation method of the first aspect.
[0021] In one possible implementation, the message processing system may be a mainboard. In another possible implementation, the message processing system may be a communication device including a plurality of mainboards.
[0022] In a sixth aspect, a communication device is provided, comprising a first mainboard and a second mainboard, wherein a first network card is provided on the first mainboard, and wherein the first network card is used to execute a computer program to implement the operating steps of the method described in the first aspect or any possible implementation method of the first aspect.
[0023] In a seventh aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the operating steps of the method described in the first aspect or any possible implementation of the first aspect.
[0024] The technical effects that can be achieved in any of the second to seventh aspects mentioned above can refer to the description of the beneficial effects in the first aspect mentioned above, and will not be repeated here.
[0025] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A schematic diagram of the structure of a communication device provided for this application;
[0027] Figure 2 A schematic diagram of the structure of a communication system provided for this application;
[0028] Figure 3 An interactive schematic diagram of a message processing method provided by this application;
[0029] Figure 4 A schematic diagram of the internal structure of a mainboard provided for this application;
[0030] Figure 5 A schematic diagram of the internal structure of a motherboard in the related art;
[0031] Figure 6 A flowchart of a message processing method provided by this application;
[0032] Figure 7 A flowchart of another message processing method provided by this application;
[0033] Figure 8 A structural block diagram of a message processing device provided by the present application;
[0034] Fig. 9 A structural block diagram of another message processing device provided by the present application;
[0035] Fig.10 A schematic diagram of the structure of a network card provided for this application;
[0036] Fig.11 A schematic diagram of the structure of a chip provided in this application. DETAILED DESCRIPTION
[0037] In order to improve the processing efficiency of a communication device for a message, the present application provides a message processing method. The message processing method can be applied to a communication device, which may include a first mainboard and a second mainboard. Among them, the first mainboard may include a first network card and a first processor, the first network card may send the received first message to the first processor, and the first network card may also generate a copy message of the first message, and send the copy message of the first message to the second processor; wherein the second processor is arranged on the second mainboard. On the one hand, the copy message of the first message is generated by the network card on the first mainboard, and there is no need for the processor on the first mainboard to generate the copy message of the first message, which can reduce the resource consumption of the processor; on the other hand, after the network card on the first mainboard generates the copy message, the copy message is directly sent to the second processor on the second mainboard, without passing through the processor on the first mainboard, which can shorten the transmission path of the message during the message processing process, reduce the time consumed due to the long message transmission path, and improve the message processing efficiency.
[0038] The message processing method provided by the present application is described below with reference to the accompanying drawings.
[0039] The message processing method provided in this application can be applied to Figure 1 In the communication device shown. Figure 1 As shown, the communication device 100 may include a first mainboard 110 and a second mainboard 120, and the first mainboard 110 and the second mainboard 120 may be two mainboards with the same structure and function. During the operation of the communication device 100, one of the first mainboard 110 and the second mainboard 120 serves as a main board, and the other serves as a standby board. When the main board fails or is under maintenance, a main-standby switch is performed, so that the main board is converted to a standby board, and the standby board is converted to a main board. Figure 1 The communication device shown in the figure includes two main boards. In other embodiments, the communication device may include more main boards. When the communication device includes multiple main boards, one of the multiple main boards may be used as a main board, and the other main boards may be used as standby boards. The present application does not limit the number of main boards provided in the communication device.
[0040] exist Figure 1 In the communication device 100 shown, the first mainboard 110 may include a first processor 111 and a first network card 112 connected to the first processor 111, and the second mainboard 120 may include a second processor 121 and a second network card 122 connected to the second processor 121. The first network card 112 is connected to the second network card 122. In some embodiments, the first network card 112 and the second network card 122 are both provided with a communication port, and the first network card 112 and the second network card 122 can be connected through the communication port.
[0041] The first processor 111 and the second processor 121 may be a CPU, or a programmable logic device (PLD) chip, or an application-specific integrated circuit (ASIC) chip. The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0042] Both the first network card 112 and the second network card 122 can communicate with other communication devices in the network through the communication port. In the present application, the first network card 112 and the second network card 122 can be but not limited to a data processing unit (DPU), an infrastructure processor (IPU), a network processing unit (NPU), a system on chip (SoC), an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a complex programmable logical device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL), an iNIC or a smartNIC, etc. Among them, iNIC or smartNIC can be understood as an intelligent network card.
[0043] The communication device 100 may be a cloud server, a computing device or a server in a network management center in a cloud computing cluster, or a physical server or control device in an industrial control system, or a gateway or other network element device in a communication system.
[0044] For example, Figure 2 A schematic diagram of an application scenario of the present application is shown. The application scenario can be understood as a part of a communication network, and the application scenario includes at least two communication devices, such as Figure 2The first communication device 200 and the second communication device 300 shown in the figure can communicate with each other through the network. For example, the first communication device 200 can send a message to the second communication device 300, or the second communication device 300 can send a message to the first communication device 200; or, the first communication device 200 can send information to other communication devices in the communication network through the second communication device 300; or, the second communication device 300 can send information to other communication devices in the communication network through the first communication device 200. The first communication device 200 and the second communication device 300 can use Figure 1 The communication device shown has the active / standby switching function.
[0045] In order to shorten the message processing path in the communication device and improve the message processing efficiency. The present application provides a message processing method, which can be applied to a communication device with multiple mainboards. The communication device can be connected to other communication devices in the network through the network cards on the multiple mainboards, and the network card of each mainboard has the function of copying messages. The following is an example of a communication device including a first mainboard and a second mainboard. During the operation of the communication device, when the first mainboard is the main board and the second mainboard is the backup board, the interaction process between the first network card and the first processor set on the first mainboard, and the second network card and the second processor set on the second mainboard, such as Figure 3 As shown, the following steps may be included:
[0046] S101: A first network card sends a first message to a first processor.
[0047] In some embodiments, Figure 4 As shown, the first network card is provided with a communication port, and the communication device can be connected to other communication devices in the network through the communication port of the first network card to receive the first message sent by the other communication devices. The first message may refer to any message sent by any communication device in the network, and the first message carries a message identifier, which is used to distinguish different messages in the network. For example, the message identifier may be the number of the message, and the message identifier may also include the device number of the source device that sent the message, etc.
[0048] The first network card in the communication device can receive the first message sent by other communication devices through the communication port. After receiving the first message sent by other communication devices, the first network card can send the first message to the first processor so that the first processor processes the first message.
[0049] For example, Figure 4As shown, the first network card may include a physical layer (physics, PHY) and a data link layer. The data link layer may also be called a media access control layer (mdia access control, MAC). The communication port of the communication device may transmit the received first message to the physical layer and the data link layer in the first network card, and send the first message to the first processor via the data link layer in the first network card.
[0050] S102: The first network card sends a copy of the first message to the second network card.
[0051] After receiving the first message sent by the other communication device, the first network card can copy the first message to generate a copy of the first message. Figure 4 As shown, a message transceiver module is deployed in the data link layer in the first network card, and the message transceiver module can be used to copy the message received by the data link layer. After the data link layer receives the first message, the message transceiver module can copy the first message to obtain a copy of the first message, and the copy of the first message carries a message identifier of the first message. After obtaining the copy of the first message, the first network card can send the copy of the first message to the second network card set on the second mainboard. Exemplarily, the first network card can send the copy of the first message to the second network card through the communication port.
[0052] In some embodiments, the execution order of step S102 and step S101 can be swapped, or step S101 and step S102 can be executed simultaneously. The present application does not limit the execution order of step S101 and step S102.
[0053] S201: The second network card sends a copy of the first message to the second processor.
[0054] After receiving the duplicate message of the first message sent by the first network card, the second network card may send the duplicate message of the first message to the second processor, so that the first processor processes the duplicate message of the first message.
[0055] For example, Figure 4 As shown, the second network card may include a physical layer and a data link layer. The first network card may transmit a duplicate message of the first message to the physical layer and the data link layer in the second network card, and send the duplicate message of the first message to the second processor via the data link layer in the second network card.
[0056] S301: The first processor sends a response message A to the first network card.
[0057] like Figure 4As shown, an operating system (OS) and a message processing application (APP) running based on the operating system are running on the first processor. The message processing application running on the first processor can process the received first message and generate a response message A of the first message, and the response message A of the first message carries a message identifier of the first message. The first processor can send the response message A of the first message to the first network card.
[0058] S103: The first network card processes the response message A.
[0059] In some embodiments, the first network card may perform arbitration processing on the received response message according to the time when the response message is received.
[0060] The first network card receives the response message A sent by the first processor and can determine that the response message A is a response message of the first message according to the message identifier carried in the response message A. The first network card obtains the reception time of the response message A and determines whether a response message of the first message has been received before the reception time of the response message A.
[0061] If a response message of the first message has not been received before the reception time of the response message A, it is determined that the response message A is the first response message of the first message received, and the first network card can send the response message A. Exemplarily, when the destination address of the response message A is the address of the source device that sends the first message, the first network card can send the response message A to the source device of the first message through the communication port that receives the first message; when the destination address of the response message A is the address of the target device of the first message, that is, the communication device is used to forward the first message, the first network card can send the response message A to the target device of the first message through the communication port corresponding to the receiving port of the first message, wherein the receiving port of the first message refers to the communication port that receives the first message.
[0062] If a response message of the first message has been received before the reception time of the response message A, it is determined that the response message A is not the first received response message of the first message, and the first network card may discard the response message A.
[0063] S401: The second processor sends a response message B to the first message to the second network card.
[0064] S202: The second network card sends a response message B of the first message to the first network card.
[0065] like Figure 4As shown, an operating system and a message processing application based on the operating system are also running on the second processor. The message processing application running on the second processor can process the received copy of the first message to generate a response message B of the first message, and the response message B of the first message carries the message identifier of the first message. The second processor can send the response message B of the first message to the second network card, and the second network card can send the response message B to the first network card through the communication port.
[0066] S104: The first network card processes the response message B.
[0067] The first network card receives the response message B sent by the second network card, and processes the response message B. The processing process of the first network card on the response message B can refer to the processing process of the first network card on the response message A, which will not be repeated here.
[0068] In one embodiment, if the first network card first receives response message A sent by the first processor and then receives response message B sent by the second network card, the first network card may send response message A and discard response message B. In another embodiment, if the first network card first receives response message B sent by the second network card and then receives response message A sent by the first processor, the first network card may send response message B and discard response message A.
[0069] In some embodiments, the communication device may include multiple mainboards. When the first mainboard among the multiple mainboards is used as the main board, the other mainboards except the first mainboard may be used as standby boards. The first network card on the first mainboard may send a copy of the first message to the network card on each standby board. The steps performed by the network card on each standby board may refer to the steps performed by the second network card above, which will not be repeated here.
[0070] In the related art, the message processing process in the communication device is as follows: Figure 5As shown, the first network card on the first mainboard in the communication device receives a first message from other communication devices through a communication port, and there are two processing paths for the first message. Path one is: the first network card sends the first message to the first processor on the first mainboard, and the first processor runs an operating system and a message receiving and sending module and application based on the operating system. The operating system on the first processor parses the first message and transmits it to the message transceiver module in the first processor; the message transceiver module in the first processor sends the first message to the application running on the first processor; the application processes the first message, generates a response message A for the first message, and sends the response message A to the message transceiver module in the first processor; path two is: the first network card sends the first message to the message transceiver module in the first processor on the first mainboard; the message transceiver module in the first processor copies the first message to obtain a copy of the first message, and sends the copy of the first message to the first network card; the first network card sends the copy of the first message to the second network card on the second mainboard; the second network card sends the copy of the first message to the second processor on the second mainboard; the second processor runs an operating system and a message transceiver module and an application based on the operating system. After parsing the first message, the operating system on the second processor transmits it to the message transceiver module in the second processor; the message transceiver module in the second processor sends a copy of the first message to the application running on the second processor; the application processes the copy of the first message, generates a response message B of the first message, and sends the response message B to the message transceiver module in the second processor; the message transceiver module in the second processor sends the response message B to the second network card; the second network card sends the response message B to the first network card on the first mainboard; the first network card sends the response message B to the message transceiver module in the first processor on the first mainboard.
[0071] The message transceiver module in the first processor arbitrates the response message according to the order in which the response message A and the response message B are received, and sends the response message received first. For example, if the message transceiver module in the first processor receives the response message B first, the message transceiver module in the first processor can transmit the response message B to the first network card, and the first network card sends the response message B. In this process, the message processing path is as follows: first network card → message transceiver module in the first processor → first network card → second network card → operating system of the second processor → message transceiver module in the second processor → application in the second processor → message transceiver module in the second processor → operating system of the second processor → second network card → first network card → operating system of the first processor → message transceiver module in the first processor → operating system of the first processor → first network card. It can be seen that the message processing path is very long, so the time required for message processing will also be long, usually around 300ms.
[0072] Compared with the related art, in which a copy of the first message is generated by the processor on the mainboard and a response message of the first message is processed, in the present application, a copy of the first message is generated by the network card on the mainboard, and the response message of the first message is arbitrated, which can shorten the message transmission path during message processing and reduce the time consumed by the long message transmission path. For example, if the first network card on the first mainboard first receives the response message B from the second mainboard, the first network card sends the response message B. In this process, the message processing path is as follows: first network card → second network card → application in the second processor → second network card → first network card. It can be seen that the message processing path is significantly shortened, and the time required for message processing can be shortened to within 10ms, which can meet the low latency and high reliability business requirements of application scenarios such as autonomous driving, remote surgery, robot assistance, and industrial control in the 5G communication era.
[0073] exist Figure 3 or Figure 4 In the embodiment described above, when the first mainboard is a main board, the communication method executed by the first network card on the first mainboard is as follows: Figure 6 As shown, the following steps may be included:
[0074] S601: Send a received first message to a first processor.
[0075] The first message carries a message identifier. The first processor receives the first message sent by the first network card, processes the first message, and generates a response message to the first message, wherein the response message carries the message identifier of the first message.
[0076] S602: Copy the first message to obtain a copy of the first message.
[0077] S603: Send a copy of the first message to a second processor on a second mainboard.
[0078] In some embodiments, the first message includes the port address of the first network card, and the first network card receives the first message through the port corresponding to the port address. When copying the first message, the first network card can modify the port address of the first network card in the copied first message to the port address of the second network card, and obtain a copy of the first message. The first network card can send the copy of the first message to the second network card on the second mainboard, and the second network card can receive the copy of the first message through the port corresponding to the port address of the second network card, and send the copy of the first message to the second processor. The second processor receives the first message sent by the second network card, processes the first message, and generates a response message to the first message, and the response message also carries the message identifier of the first message.
[0079] S604: If at least one response message to the first message is received, process the at least one response message according to a time when the at least one response message is received.
[0080] The at least one response message includes a response message returned by the first processor or a response message returned by the second processor.
[0081] When the first network card receives a response message from the first processor or the second processor, it can determine whether the response message is a response message of the first message according to the message identifier carried in the response message.
[0082] For example, taking any response message in at least one response message as an example, assuming that the response message is the first response message, the first network card can determine whether a response message carrying the same message identifier has been received before the reception time of the first response message based on the message identifier carried by the first response message. If the message identifier carried by the first response message is the message identifier of the first message, if the first network card has not received a response message with the same message identifier before the reception time of the first response message, that is, the first network card has not received a response message of the first message, then the first response message is sent; if the first network card has received a response message with the same message identifier before the reception time of the first response message, that is, the first network card has received a response message of the first message, then the first response message is discarded.
[0083] In other embodiments, if the communication device includes a first mainboard and a second mainboard, the first mainboard can also be used as a standby board, and the second mainboard can be used as a main board. When the second mainboard is used as the main board, the steps performed by the second network card on the second mainboard can refer to Figure 3 When the first mainboard is used as a standby board, the steps performed by the first network card on the first mainboard can refer to Figure 3 The steps performed by the second network card shown in . Exemplarily, as Figure 7 As shown, when the first mainboard is used as a standby board, the communication method performed by the first network card on the first mainboard may include the following steps:
[0084] S701: Receive a copy of a second message sent by a second network card, and send the copy of the second message to a first processor.
[0085] The second mainboard is used as the main board. The second network card on the second mainboard can receive the second message from other communication devices through the communication port, copy the second message, obtain the copy of the second message, and send the copy of the second message to the first network card on the first mainboard. The first network card receives the copy of the second message sent by the second network card, and sends the copy of the second message to the first processor on the first mainboard.
[0086] S702: Receive a response message to the second message sent by the first processor, and send the response message to the second message to the second network card.
[0087] The response message for the second message is obtained by the first processor receiving a copy of the second message sent by the first network card and processing the copy of the second message. The first network card receives the response message for the second message sent by the first processor, and sends the response message for the second message to the second network card. The second network card can process the response message for the received second message in the order in which the messages are received, and send the response message for the second message received first.
[0088] In some embodiments, the first mainboard and the second mainboard provided in the communication device can perform fault detection on each other. For example, the second mainboard can periodically send a heartbeat message to the first mainboard. Exemplarily, the second processor on the second mainboard can periodically send a heartbeat message to the first mainboard through the second network card. The first network card on the first mainboard can receive the heartbeat message sent by the second mainboard. If the duration for which the first network card does not receive the heartbeat message reaches the set duration, the second mainboard is determined to be faulty. Among them, the period for the second mainboard to send the heartbeat message can be 1ms, and the set duration can be 3ms, that is, the first network card does not receive the heartbeat message sent by the second mainboard for 3 consecutive periods, and the second mainboard can be determined to be faulty. The above-mentioned heartbeat message period of 1ms and the set duration of 3ms are only examples. In different embodiments, the heartbeat message period and the set duration can be set to other values.
[0089] If the second mainboard is the active board and the first mainboard is the standby board, when the first network card determines that the second mainboard is faulty, it can send a notification message of active-standby switching to the second mainboard and upgrade it to the active board. After the second network card on the second mainboard receives the notification message of active-standby switching sent by the first network card, if it receives a message from other communication devices, it can transmit the received message to the first network card for copying and subsequent processing. For the response message that has not been sent in the second network card, the second network card can also transmit the response message to the first network card, and the first network card will send the response message to other communication devices.
[0090] Similarly, the first mainboard also periodically sends heartbeat messages to the second mainboard, and the second network card on the second mainboard can receive the heartbeat messages sent by the first mainboard. If the second network card does not receive the heartbeat message for a set period of time, it is determined that the first mainboard is faulty. If the first mainboard is the main board and the second mainboard is the standby board, when the second network card determines that the first mainboard is faulty, it can send a notification message of the main-standby switch to the first mainboard and upgrade to the main board, and the second network card on the second mainboard receives messages from other communication devices.
[0091] Fault detection by the network card on the mainboard can shorten the transmission path of the heartbeat message, improve fault detection efficiency, shorten the time taken for active-standby switching, and meet the low latency requirements of communication scenarios.
[0092] Based on the same technical concept as the above method embodiment, the present application also provides a message processing device. The message processing device can be understood as the message transceiver module recorded in the above embodiment. The message processing device can be set in the network card on the mainboard. For example, it can be set in the first network card on the above first mainboard. The first mainboard is installed on the communication device. Multiple mainboards can be installed on the communication device. The first mainboard can be any mainboard among the multiple mainboards. In some embodiments, Figure 8 As shown, the message processing device 800 may include a message transmission unit 801 and a message copying unit 802. The message processing device 800 may be used to implement the functions of the above method embodiment, and thus may achieve the beneficial effects of the above method embodiment.
[0093] The message transmission unit 801 can be used to send the received first message to the first processor on the first mainboard; the message copying unit 802 can be used to generate a copy of the first message and send the copy of the first message to the second processor on the second mainboard. The second mainboard and the first mainboard are arranged on the same communication device.
[0094] It should be understood that the message processing device 800 provided in the present application can be implemented by a CPU, or by an ASIC or a PLD, wherein the PLD can be a CPLD, an FPGA, a GAL or any combination thereof; or it can be implemented by software. Figure 6 When the message processing method is shown, the message processing device 800 and its various modules may also be software modules.
[0095] In some embodiments, Fig. 9 As shown, the message processing device 800 may further include a response message processing unit 803. The response message processing unit 803 may be configured to: when receiving at least one response message for the first message, process the at least one response message according to the receiving time of the at least one response message; wherein the at least one response message includes a response message returned by the first processor or a response message returned by the second processor.
[0096] In some embodiments, the response message processing unit 803 may be specifically configured to: for a first response message, if a response message of the first message is not received before the reception time of the first response message, send the first response message; if a response message of the first message is received before the reception time of the first response message, discard the first response message. The first response message is any response message of the at least one response message.
[0097] In some embodiments, the message transmission unit 801 can also be used for: if a copy message of the second message sent by the second network card on the second mainboard is received, the copy message of the second message is sent to the first processor; receiving a response message to the second message sent by the first processor, and sending the response message to the second message to the second network card.
[0098] In some embodiments, Fig. 9 As shown, the message processing device 800 may further include a fault detection unit 804. The fault detection unit 804 may be configured to: receive a heartbeat message sent by the second mainboard, and determine that the second mainboard is faulty if the duration of not receiving the heartbeat message reaches a set duration.
[0099] In some embodiments, the fault detection unit 804 may also be used to send a notification message of active / standby switching to the second mainboard if the second mainboard is the active board.
[0100] The message processing device 800 provided according to the present application can correspond to executing the method described in the present application, and the above and other operations and / or functions of each unit in the message processing device 800 are respectively for implementing the corresponding processes of the above message processing method, which will not be repeated here for the sake of brevity.
[0101] Based on the same technical concept as the above method embodiment, the present application also provides a network card, which can be applied to a motherboard. For example, the network card can be Figure 1 The first network card 112 or the second network card 122 shown in FIG. The network card can be used to implement the functions of the above method embodiment, so the beneficial effects of the above method embodiment can be achieved.
[0102] In some embodiments, the structure of the network card 1000 can be as follows: Fig.10 As shown, it includes a network card processor 1001 and a memory 1002 connected to the network card processor 1001. The network card processor 1001 and the memory 1002 can be connected to each other through a bus. The network card processor 1001 can be a general-purpose processor, such as a microprocessor, or other conventional processors. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0103] Among them, the memory 1002 can be used to store software programs and modules. The network card processor 1001 executes various functional applications and data processing of the network card 1000 by running the software programs and modules stored in the memory 1002, such as the message processing method provided in this application.
[0104] The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application program, etc.; the data storage area may be used for received messages and data obtained after message processing, etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0105] The network card processor 1001 in the network card 1000 is used to run the computer instructions or programs stored in the memory 1002 to perform the functions in the above method embodiment. When the network card 1000 is used to implement the above method, the network card processor 1001 is used to: send the received first message to the first processor on the first mainboard; generate a copy of the first message, and send the copy of the first message to the second processor on the second mainboard.
[0106] In some embodiments, the network card processor 1001 may include one or more processing units, and different processing units may be independent devices or integrated into one or more processors. The network card processor 1001 may also include a controller, which may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0107] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the network card. In other embodiments of the present application, the network card may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0108] Based on the same technical concept as the above method embodiment, the present application also provides a message processing system. In some embodiments, the message processing system can be Figure 1 The first mainboard 110 or the second mainboard 120 in the embodiment may include a processor and a network card connected to the processor. The structure of the network card may be as follows: Fig.10 As shown, the network card can be used to execute a computer program to implement the functions of the above method embodiment. In other embodiments, the message processing system can be a communication device, and the communication device can include multiple mainboards, each of which is provided with a network card, and the structure of the network card on each mainboard can be as follows: Fig.10As shown, the network card can be used to execute a computer program to implement the functions of the above method embodiment.
[0109] In some embodiments, the structure of the communication device can be as follows Figure 1 As shown, it includes a first mainboard 110 and a second mainboard 120. The first mainboard 110 and the second mainboard 120 are connected to each other. A first network card 112 is provided on the first mainboard 110, and a second network card 120 is provided on the second mainboard 120. The first network card 110 or the second network card 120 can be used to execute a computer program to implement the functions of the above method embodiment.
[0110] Based on the same technical concept as the above method embodiment, the present application also provides a chip, which may be a computing chip. The chip may be applied to a network card to implement the functions of the above method embodiment, thereby achieving the beneficial effects of the above method embodiment.
[0111] In some embodiments, the structure of the chip 1100 can be as follows: Fig.11 As shown, it includes a network card processor 1101 and a power supply circuit 1102 connected to the network card processor 1101. The network card processor 1101 and the power supply circuit 1102 can be connected to each other through a bus. The network card processor 1101 can be a general processor, such as a microprocessor, or other conventional processors. The bus can be a peripheral component interconnection standard PCI bus or an extended industrial standard structure EISA bus. The bus can be divided into an address bus, a data bus, a control bus, etc. The power supply circuit 1102 is used to supply power to the network card processor 1101 through the bus.
[0112] The network card processor 1101 can be connected to a memory set outside the chip, or to a memory set inside the chip, to run software programs and modules stored in the memory, thereby executing various functional applications and data processing of the chip 1100, such as the fault handling method provided in this application.
[0113] In some embodiments, the network card processor 1101 may include one or more processing units, and different processing units may be independent devices or integrated into one or more processors. The network card processor 1101 may also include a controller, which may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0114] The method steps in the embodiments of the present application may be implemented by hardware, or by a processor executing a computer program or instruction. The computer program or instruction may constitute a computer program product.
[0115] The present application also provides a computer program product, which includes computer executable instructions. In one embodiment, the computer executable instructions are used to enable a computer to execute the functions of the above method embodiment.
[0116] The computer executable instructions may be stored in a computer readable storage medium. The present application also provides a computer readable storage medium, wherein the computer readable storage medium stores the executable instructions. In one embodiment, the computer executable instructions are used to enable a computer to execute the functions in the above method embodiment.
[0117] The computer-readable storage medium provided in the present application may be a random access memory (RAM), a flash memory, a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a register, a hard disk, a mobile hard disk, a CD-ROM, or any other form of computer-readable storage medium known in the art.
[0118] Computer executable instructions may be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium. For example, the computer program or instructions may be transferred from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disc (DVD); it may also be a semiconductor medium, such as a solid state drive.
[0119] One or more of the above modules or units can be implemented by software, hardware or a combination of the two. When any of the above modules or units is implemented in software, the software exists in the form of computer program instructions and is stored in a memory, and the processor can be used to execute the program instructions and implement the above method flow. The processor may include but is not limited to at least one of the following: a CPU, a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor and other types of computing devices that run software, each of which may include one or more cores for executing software instructions for calculation or processing. The processor may be built into a SoC (system on chip), a DPU or an ASIC, or it may be an independent semiconductor chip. In addition to the core used to execute software instructions for calculation or processing in the processor, it may further include necessary hardware accelerators, such as FPGA, PLD or logic circuits for implementing dedicated logic operations.
[0120] When the above modules or units are implemented in hardware, the hardware can be any one or any combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator or a non-integrated discrete device, which can run the necessary software or not rely on the software to execute the above method flow.
[0121] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A message processing method, characterized in that: Applied to a first network card provided on a first mainboard, the method comprises: Sending the received first message to a first processor; the first processor is set on the first mainboard; Copying the first message to obtain a copy of the first message; A duplicate message of the first message is sent to a second processor; the second processor is arranged on a second mainboard, and the second mainboard and the first mainboard are arranged on the same communication device.
2. The method according to claim 1, characterized in that The first message includes the port address of the first network card; and the copying of the first message to obtain a copy of the first message includes: The first message is copied, and the port address of the first network card in the copied message is modified to the port address of the second network card to obtain a copy message of the first message; the second network card is set on the second mainboard.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: If at least one response message is received for the first message, the at least one response message is processed according to the reception time of the at least one response message; the at least one response message includes the response message returned by the first processor or the response message returned by the second processor.
4. The method according to claim 3, characterized in that: The response message of the first message carries the message identifier of the first message; and the processing of the at least one response message according to the reception time of the at least one response message includes: For the first response message, if the first response message carries the message identifier of the first message, and before the reception time of the first response message, no response message of the first message is received, then the first response message is sent; If the first response message carries the message identifier of the first message, and a response message to the first message is received before the reception time of the first response message, the first response message is discarded; the first response message is any response message among the at least one response message.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: If a duplicate message of a second message sent by a second network card is received, the duplicate message of the second message is sent to the first processor; the second network card is set on the second mainboard; A response message to the second message sent by the first processor is received, and the response message to the second message is sent to the second network card.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: Receive a heartbeat message sent by the second mainboard; If the time duration for which the heartbeat message is not received reaches a set time duration, it is determined that the second mainboard is faulty.
7. The method according to claim 6, characterized in that The method further comprises: If the second main board is the active board, notification information of active / standby switching is sent to the second main board.
8. A message processing device, characterized in that: Applicable to a first network card arranged on a first mainboard, the device comprises: A message transmission unit, configured to send a received first message to a first processor; the first processor is arranged on the first mainboard; A message copying unit is used to copy the first message to obtain a copy of the first message; send the copy of the first message to a second processor; the second processor is set on a second mainboard, and the second mainboard and the first mainboard are set on the same communication device.
9. The device according to claim 8, characterized in that The device also includes: A response message processing unit is used to process the at least one response message according to the reception time of the at least one response message when receiving at least one response message for the first message; the at least one response message includes the response message returned by the first processor or the response message returned by the second processor.
10. The device according to claim 8 or 9, characterized in that The message transmission unit is further used for: If a duplicate message of a second message sent by a second network card is received, the duplicate message of the second message is sent to the first processor; the second network card is set on the second mainboard; A response message to the second message sent by the first processor is received, and the response message to the second message is sent to the second network card.
11. The device according to any one of claims 8 to 10, characterized in that The device also includes: A fault detection unit is used to receive the heartbeat message sent by the second mainboard; if the time duration for which the heartbeat message is not received reaches a set time duration, it is determined that the second mainboard is faulty.
12. A message processing system, characterized in that: The invention comprises a processor and a network card connected to the processor, wherein the network card is used to execute a computer program to implement the method according to any one of claims 1 to 7.
13. The message processing system according to claim 12, characterized in that: The message processing system is a main board or a communication device including a plurality of main boards.
Citation Information
Patent Citations
Method and system for packet synchronization delimitation
CN101310468A
Backup system and backup method
CN105760260A
Data message processing method based on FPGA, intelligent network card and CDN server
CN109936513A
Transmission data processing method and device
CN114301996A
DPU (Data Processing Unit) device for realizing network message copying and network message copying system
CN116708264A