A message communication processing method, device and electronic equipment

By using virtual addresses to directly access the sending queue in the vehicle system and utilizing network card hardware to access the physical address of memory, the problem of transmission latency uncertainty in Linux terminal nodes is solved, achieving efficient and reliable message communication.

CN119544648BActive Publication Date: 2025-10-24CHINA AUTOMOTIVE INNOVATION CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411584681.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-10-24
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

When Linux-based terminal nodes distribute data in an in-vehicle system, there is uncertainty in transmission latency caused by multiple copies of data between user space and kernel space, context switching, and protocol stack processing, making it difficult to guarantee the determinism of end-to-end communication.

Method used

By using virtual addresses to directly access the send queue in preset memory and storing the physical addresses in the storage space, the context switching between kernel mode and user mode is reduced, and the physical addresses in memory are directly accessed by the network card hardware, thus optimizing the packet transmission path and efficiency.

Benefits of technology

It improves the real-time performance and accuracy of message transmission, reduces processing time, enhances the efficiency and determinism of message access, and ensures the integrity and reliability of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119544648B_ABST
    Figure CN119544648B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a message communication processing method and device and electronic equipment. The method comprises: in the case of receiving a first original message content corresponding to any to-be-sent message, acquiring a first physical address of the first original message content; in the process of accessing a first preset memory based on a first user mode driver, determining a first storage space from a preset sending queue of the first preset memory based on first preset configuration information, and storing the first physical address in the first storage space; in the process of accessing the first preset memory based on a first network card hardware, in the case of detecting that any idle storage space in the preset sending queue is occupied, taking out the first storage space from the preset sending queue based on second preset configuration information, analyzing the first storage space to obtain the first physical address; and sending the to-be-sent message based on the first physical address and the first network card hardware. The embodiments of the present disclosure can solve the problem of uncertain time delay in the process of transmitting messages.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of computer, and particularly relates to a message communication processing method and device and electronic equipment. BACKGROUND

[0002] The data distribution service based on Linux can realize efficient, reliable and real-time data communication in the vehicle system through the time-sensitive network. The data distribution and subscription mechanism of the data distribution service enables the vehicle components to share data in real time. Although the time-sensitive network can ensure the real-time and determinacy of data transmission, when the terminal node based on Linux uses the data distribution service for communication, the data needs to be copied between the user mode and the kernel mode multiple times, context switching, interrupt processing and complex processing of the transmission control protocol / internet protocol protocol stack, etc., resulting in uncertainty of transmission delay, which makes it difficult to guarantee the determinacy of end-to-end communication in the data distribution service. SUMMARY

[0003] The present disclosure provides a message communication processing method and device, electronic equipment and storage medium, to at least solve the technical problems in the related art that the determinacy transmission is difficult to strictly meet the requirements, the determinacy delay of data transmission has large jitter, etc. The technical solutions of the present disclosure are as follows:

[0004] In one aspect, the present disclosure provides a message communication processing method, comprising:

[0005] In the case of receiving any first original message content corresponding to a to-be-sent message, obtaining a first physical address of the first original message content;

[0006] In the process of accessing a first preset memory based on a first user mode driver, based on first preset configuration information, determining a first storage space from a preset sending queue of the first preset memory, and storing the first physical address in the first storage space, the first preset configuration information being a virtual address of the preset sending queue in the first preset memory, and the first storage space being any idle storage space in the preset sending queue;

[0007] In the process of accessing the first preset memory based on a first network card hardware, in the case of detecting that any idle storage space in the preset sending queue is occupied, based on second preset configuration information, taking out the first storage space from the preset sending queue, analyzing the first storage space to obtain the first physical address, the second preset configuration information being a physical address of the preset sending queue in the first preset memory;

[0008] Based on the first physical address and the first network card hardware, the to-be-sent message is sent.

[0009] In an optional embodiment, the to-be-sent message is a third encapsulated message, and the method further comprises:

[0010] performing encapsulation processing on the first original message content based on a real-time publication and subscription protocol at an application layer to obtain a first encapsulated message;

[0011] In the process of accessing the first preset memory based on the first preset original partition, based on third preset configuration information, a second storage space is determined from a first preset queue of the first preset memory, and the first encapsulated message is stored in the second storage space, the third preset configuration information is a virtual address of the first preset queue in the first preset memory, and the second storage space is any idle storage space in the first preset queue;

[0012] a first virtual address and a first memory address of the first encapsulated message in the second storage space are recorded;

[0013] performing encapsulation processing on the first encapsulated message in the second storage space based on a user datagram protocol at a transport layer to obtain a second encapsulated message;

[0014] performing encapsulation processing on the second encapsulated message in the second storage space based on an Internet Protocol at a network layer to obtain the third encapsulated message.

[0015] In an optional embodiment, the first physical address of the first original message content comprises:

[0016] the first virtual address is converted into the first physical address.

[0017] In an optional embodiment, the sending of the to-be-sent message based on the first physical address and the first network card hardware comprises:

[0018] In the process of accessing the first preset memory based on the first network card hardware, based on fourth preset configuration information and the first physical address, the first memory address is obtained, and the fourth preset configuration information is a physical address of the first preset queue in the first preset memory;

[0019] based on the first memory address and a first preset controller, the third encapsulated message is taken out from the second storage space;

[0020] the third encapsulated message is added to a preset dispatching and sending queue for sending processing of the to-be-sent message.

[0021] In an optional embodiment, the method further comprises:

[0022] acquire a first message length and a message priority of the third encapsulated message;

[0023] The first memory address is acquired based on fourth preset configuration information and the first physical address, and the acquiring the first memory address includes:

[0024] The first memory address is acquired based on the fourth preset configuration information, the first physical address, and the first message length.

[0025] The third encapsulated message is added to a preset dispatch sending queue based on the message priority, so as to perform the sending processing of the to-be-sent message.

[0026] The third encapsulated message is added to a preset dispatch sending queue based on the message priority, so as to perform the sending processing of the to-be-sent message.

[0027] In another aspect, the embodiments of the present disclosure provide a message communication processing method, including:

[0028] In a case where any to-be-received message is received, a second physical address of the to-be-received message is acquired.

[0029] In a process of accessing a second preset memory based on a second network card hardware, a third storage space is determined from a preset receiving queue of the second preset memory based on fifth preset configuration information, and the second physical address is stored in the third storage space, the fifth preset configuration information being a physical address of the preset receiving queue in the second preset memory, and the third storage space being any idle storage space in the preset receiving queue.

[0030] In a process of accessing the second preset memory based on a second user state drive, in a case where any idle storage space in the preset receiving queue is detected to be occupied, the third storage space is taken out from the preset receiving queue based on sixth preset configuration information, the third storage space is parsed to obtain the second physical address, and the sixth preset configuration information is a virtual address of the preset receiving queue in the second preset memory.

[0031] The second original message content corresponding to the to-be-received message is acquired based on the second physical address and a second preset original partition.

[0032] In an optional embodiment, the acquiring the second physical address of the to-be-received message includes:

[0033] In the process of accessing the second preset memory based on the second network card hardware, a fourth storage space is determined from a second preset queue of the second preset memory based on seventh preset configuration information and a second preset controller, and the to-be-received packet is stored in the fourth storage space, the seventh preset configuration information being a physical address of the second preset queue in the second preset memory, and the fourth storage space being any idle storage space in the second preset queue.

[0034] The second physical address of the to-be-received packet in the fourth storage space is recorded.

[0035] In an optional embodiment, the method further comprises:

[0036] The second physical address is converted into a second virtual address.

[0037] A second memory address of the to-be-received packet in the fourth storage space is recorded.

[0038] The second physical address and the second preset original partition are used to obtain the second original packet content corresponding to the to-be-received packet, and the obtaining comprises:

[0039] In the process of accessing the second preset memory based on the second preset original partition, the second memory address is obtained based on eighth preset configuration information and the second virtual address, the eighth preset configuration information being a virtual address of the second preset queue in the second preset memory.

[0040] The to-be-received packet is taken out from the fourth storage space based on the second memory address, and the to-be-received packet is processed to obtain the second original packet content.

[0041] In an optional embodiment, the method further comprises:

[0042] A second packet length of the to-be-received packet is obtained.

[0043] The second memory address is obtained based on the eighth preset configuration information and the second virtual address, and the obtaining comprises:

[0044] The second memory address is obtained based on the eighth preset configuration information, the second virtual address, and the second packet length.

[0045] In an optional embodiment, the second original packet content is a third unencrypted packet, and the processing of the to-be-received packet to obtain the second original packet content comprises:

[0046] The to-be-received packet is processed at a network layer to obtain a first unencrypted packet.

[0047] The first unpacked packet is processed at a transport layer to obtain a second unpacked packet;

[0048] The second unpacked packet is processed at an application layer to obtain the third unpacked packet.

[0049] In another aspect, the disclosure provides a packet communication processing device, characterized in that comprising:

[0050] A first physical address obtaining module is configured to, in a case where a first original packet content corresponding to any to-be-sent packet is received, obtain a first physical address of the first original packet content;

[0051] A first storage space determining module is configured to, in a process of accessing a first preset memory based on a first user mode driver, determine a first storage space from a preset sending queue of the first preset memory based on first preset configuration information, and store the first physical address in the first storage space, wherein the first preset configuration information is a virtual address of the preset sending queue in the first preset memory, and the first storage space is any idle storage space in the preset sending queue;

[0052] A first storage space analyzing module is configured to, in a process of accessing the first preset memory based on a first network card hardware, in a case where any idle storage space in the preset sending queue is detected to be occupied, take out the first storage space from the preset sending queue based on second preset configuration information, analyze the first storage space to obtain the first physical address, wherein the second preset configuration information is a physical address of the preset sending queue in the first preset memory;

[0053] A to-be-sent packet sending module is configured to send the to-be-sent packet based on the first physical address and the first network card hardware.

[0054] In an optional embodiment, the to-be-sent packet is a third encapsulated packet, and the device further comprises:

[0055] A first encapsulated packet obtaining module is configured to, at an application layer, encapsulate the first original packet content based on a real-time publish / subscribe protocol to obtain a first encapsulated packet;

[0056] a second storage space determining module, configured to determine a second storage space from a first preset queue in the first preset memory based on third preset configuration information in a process of accessing the first preset memory based on the first preset original partition, and store the first encapsulation packet into the second storage space, the third preset configuration information being a virtual address of the first preset queue in the first preset memory, and the second storage space being any idle storage space in the first preset queue;

[0057] a first information obtaining module, configured to record a first virtual address and a first memory address of the first encapsulation packet in the second storage space;

[0058] a second encapsulation packet obtaining module, configured to obtain a second encapsulation packet by performing encapsulation processing on the first encapsulation packet in the second storage space based on a user datagram protocol (UDP) at a transport layer;

[0059] a third encapsulation packet obtaining module, configured to obtain the third encapsulation packet by performing encapsulation processing on the second encapsulation packet in the second storage space based on an internet protocol (IP) at a network layer.

[0060] In an optional embodiment, the first physical address obtaining module comprises:

[0061] a first physical address obtaining unit, configured to convert the first virtual address into the first physical address.

[0062] In an optional embodiment, the to-be-sent packet sending module comprises:

[0063] a first memory address obtaining unit, configured to obtain the first memory address based on fourth preset configuration information and the first physical address in a process of accessing the first preset memory based on the first network card hardware, the fourth preset configuration information being a physical address of the first preset queue in the first preset memory;

[0064] a third encapsulation packet obtaining unit, configured to obtain the third encapsulation packet from the second storage space based on the first memory address and a first preset controller;

[0065] a to-be-sent packet sending unit, configured to add the third encapsulation packet into a preset dispatching sending queue to perform sending processing on the to-be-sent packet.

[0066] In an optional embodiment, the apparatus further comprises:

[0067] a second information obtaining module, configured to obtain a first packet length and a packet priority of the third encapsulation packet;

[0068] The first memory address obtaining unit comprises:

[0069] The first memory address obtaining sub-unit is configured to obtain the first memory address based on the fourth preset configuration information, the first physical address and the first packet length.

[0070] The to-be-sent packet sending unit comprises:

[0071] The to-be-sent packet sending sub-unit is configured to add the third encapsulated packet into the preset dispatching sending queue based on the packet priority, so as to perform the sending processing of the to-be-sent packet.

[0072] In another aspect, the embodiments of the present disclosure provide a packet communication processing device, characterized in that comprising:

[0073] The second physical address obtaining module is configured to obtain a second physical address of any to-be-received packet when the to-be-received packet is received.

[0074] The third storage space determining module is configured to determine a third storage space from a preset receiving queue of a second preset memory based on fifth preset configuration information in a process of accessing the second preset memory based on a second network card hardware, and store the second physical address into the third storage space, wherein the fifth preset configuration information is a physical address of the preset receiving queue in the second preset memory, and the third storage space is any idle storage space in the preset receiving queue.

[0075] The third storage space analyzing module is configured to take out the third storage space from the preset receiving queue based on sixth preset configuration information, analyze the third storage space, and obtain the second physical address when detecting that any idle storage space in the preset receiving queue is occupied in a process of accessing the second preset memory based on a second user state driving, wherein the sixth preset configuration information is a virtual address of the preset receiving queue in the second preset memory.

[0076] The second original packet content obtaining module is configured to obtain second original packet content corresponding to the to-be-received packet based on the second physical address and a second preset original partition.

[0077] In an optional embodiment, the second physical address obtaining module comprises:

[0078] a fourth storage space determining unit, configured to determine a fourth storage space from a second preset queue of the second preset memory based on seventh preset configuration information and a second preset controller in a process of accessing the second preset memory based on the second network card, and store the to-be-received packet into the fourth storage space, the seventh preset configuration information being a physical address of the second preset queue in the second preset memory, and the fourth storage space being any idle storage space in the second preset queue;

[0079] a second physical address obtaining unit, configured to record the second physical address of the to-be-received packet in the fourth storage space.

[0080] In an optional embodiment, the apparatus further includes:

[0081] a second virtual address obtaining module, configured to convert the second physical address into a second virtual address;

[0082] a second memory address obtaining module, configured to record a second memory address of the to-be-received packet in the fourth storage space;

[0083] The second original packet content obtaining module includes:

[0084] a second memory address obtaining unit, configured to obtain the second memory address based on eighth preset configuration information and the second virtual address in a process of accessing the second preset memory based on the second preset original partition, the eighth preset configuration information being a virtual address of the second preset queue in the second preset memory;

[0085] a second original packet content obtaining unit, configured to take out the to-be-received packet from the fourth storage space based on the second memory address, and perform decapsulation processing on the to-be-received packet to obtain the second original packet content.

[0086] In an optional embodiment, the apparatus further includes:

[0087] a second packet length obtaining module, configured to obtain a second packet length of the to-be-received packet;

[0088] The second memory address obtaining unit includes:

[0089] a second memory address obtaining sub-unit, configured to obtain the second memory address based on the eighth preset configuration information, the second virtual address, and the second packet length.

[0090] In an optional embodiment, the second original packet content obtaining unit includes:

[0091] The first unsealing packet obtaining unit is configured to perform unsealing processing on the to-be-received packet at a network layer to obtain a first unsealing packet.

[0092] The second unsealing packet obtaining unit is configured to perform unsealing processing on the first unsealing packet at a transport layer to obtain a second unsealing packet.

[0093] The third unsealing packet obtaining unit is configured to perform unsealing processing on the second unsealing packet at an application layer to obtain the third unsealing packet.

[0094] In another aspect, the embodiments of the present disclosure provide an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the method of any one of the above first aspect.

[0095] In another aspect, the embodiments of the present disclosure provide a computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute any one of the packet communication processing methods of the embodiments of the present disclosure.

[0096] In another aspect, the embodiments of the present disclosure provide a computer program product containing instructions, when the computer program product is run on a computer, the computer executes the method of any one of the above first aspect.

[0097] The embodiments of the present disclosure provide the technical solutions at least with the following beneficial effects:

[0098] The first user mode driver directly accesses the first preset memory based on the virtual address of the preset send queue SQ (send queue) in the first preset memory, and stores the first physical address of the to-be-sent packet in the first storage space SQE (send queue element) of the preset send queue in the first preset memory, which facilitates subsequent first network card hardware access, reduces the context switching between the kernel mode and the user mode, and improves the packet transmission efficiency. Then, the first network card hardware directly accesses the first preset memory based on the physical address of the preset send queue in the first preset memory, and when detecting that the idle storage space of the preset send queue is occupied, parses the occupied first storage space to obtain the stored first physical address, thereby reducing the processing time and improving the real-time performance of packet transmission, and improving the accuracy and efficiency of packet access. The to-be-sent packet is directly sent from the first preset memory by the first network card hardware, which optimizes the path and efficiency of packet transmission.

[0099] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0100] The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate implementations of the present disclosure and, together with the description, explain the principles of the present disclosure, but do not limit the present disclosure.

[0101] Figure 1 is a flowchart of a packet communication processing method according to an exemplary embodiment;

[0102] Figure 2 is a flowchart of a packet communication processing method according to an exemplary embodiment;

[0103] Figure 3 is a flowchart of a packet communication processing method according to an exemplary embodiment;

[0104] Figure 4 is a flowchart of a packet communication processing method according to an exemplary embodiment;

[0105] Figure 5 is a flowchart of a packet communication processing method according to an exemplary embodiment;

[0106] Figure 6 is a flowchart of a packet communication processing method according to an exemplary embodiment;

[0107] Figure 7 is a block diagram of a packet communication processing device according to an exemplary embodiment;

[0108] Figure 8 is a block diagram of a packet communication processing device according to an exemplary embodiment;

[0109] Figure 9 is a block diagram of an electronic device for packet communication processing according to an exemplary embodiment. DETAILED DESCRIPTION

[0110] In order to make the ordinary person skilled in the art better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings.

[0111] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.

[0112] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0113] See also Figure 1 , Figure 1 This is a flowchart of a message communication processing method according to an exemplary embodiment. Specifically, the method can be applied to a sending end, and the method may include the following steps:

[0114] Step S101: upon receiving a first original message content corresponding to any message to be sent, obtaining a first physical address of the first original message content.

[0115] In actual applications, the above-mentioned sending end can be a sending terminal of the message, such as a vehicle-mounted terminal, etc. The vehicle-mounted terminal may include a vehicle-mounted domain controller. Accordingly, the message communication processing method provided in the embodiment of the present application can be executed based on the vehicle-mounted domain controller.

[0116] In a specific embodiment, the first original message content corresponding to the message to be sent may be the first original message content corresponding to the message that the vehicle-mounted domain controller needs to send. In a specific embodiment, the first original message content may be control data. Exemplarily, the control data may be unmanned driving environment perception data streams such as power control data, brake control data, and steering control data. Specifically, the power control data may be engine speed and accelerator pedal position. The brake control data may be brake pedal position and brake pressure. The steering control data may be steering wheel data and steering torque. In a specific embodiment, the first original message content may be perception data. Exemplarily, the perception data may be millimeter wave radar data and lidar data.

[0117] In a specific embodiment, the message to be sent is a third encapsulated message, such as Figure 2 As shown, the above method also includes:

[0118] Step S201, encapsulating the first original message content based on a real-time publishing and subscribing protocol at an application layer to obtain a first encapsulated message.

[0119] In one specific embodiment, the first encapsulated message includes a message header of the real-time publishing and subscribing protocol and the first original message content. The message header of the real-time publishing and subscribing protocol contains basic information such as a protocol version, a message type, and a sequence number, and is used to identify and process the message.

[0120] Step S203, determining a second storage space from the first preset queue of the first preset memory based on third preset configuration information in a process of accessing the first preset memory based on the first preset original partition, and storing the first encapsulated message in the second storage space.

[0121] In one specific embodiment, the first preset original partition is used to allocate the first preset memory to the first preset queue rawpktQ (raw packet queue) and a preset sending queue. For example, the first preset original partition can be a RAW (raw device) on the sending end side. In one specific embodiment, the first preset memory includes the first preset queue and the preset sending queue, and the first preset memory is mapped based on mmap (Memory Mapping) so that the first preset original partition, the first user mode driver, and the first network card hardware can all access. In one specific embodiment, the third preset configuration information is a virtual address of the first preset queue in the first preset memory. In one specific embodiment, the first preset queue is used to store messages to be sent. In one specific embodiment, the second storage space is any idle storage space rawpktqe (raw packet queue element) in the first preset queue.

[0122] In one specific embodiment, the process of determining the second storage space from the first preset queue of the first preset memory based on the third preset configuration information in the process of accessing the first preset memory based on the first preset original partition, and storing the first encapsulated message in the second storage space can be that, based on the virtual address of the first preset queue in the first preset memory, the first preset original partition can access the first preset queue in the first preset memory, find the idle second storage space in the first preset queue, and store the first encapsulated message in the second storage space.

[0123] Step S205, recording a first virtual address and a first memory address of the first encapsulated message in the second storage space.

[0124] In a specific embodiment, the first virtual information may be an address assigned by the operating system to the current message communication process. The first virtual information includes a page directory index, a page table index, and an offset within the page. In a specific embodiment, the page directory index is used to find an entry in the page directory, the page table index is used to find an entry in the page table, and the offset within the page is used to locate data within the page.

[0125] Step S207: Based on the User Datagram Protocol at the transport layer, the first encapsulated message is encapsulated in the second storage space to obtain a second encapsulated message.

[0126] In one specific embodiment, the second encapsulated message includes User Datagram Protocol (UDP) port information, a Real-Time Publish Subscribe (RTPS) header, and the first original message content. In one specific embodiment, the UDP port information is used to identify a specific application or service in the network, and each UDP port information is associated with a specific application or service. The UDP port information can be used to determine to which application or service the first encapsulated message should be delivered.

[0127] Step S209 : Based on the Internet protocol at the network layer, the second encapsulated message is encapsulated in the second storage space to obtain a third encapsulated message.

[0128] In one specific embodiment, the third encapsulated message includes an Internet Protocol (IP) address, User Datagram Protocol (UDP) port information, a Real-Time Publish Subscribe (RTPS) message header, and the first original message content. In one specific embodiment, the IP address is used to uniquely identify and locate each device on the Internet or a local area network (LAN). Using the IP address, the second encapsulated message can be correctly routed to the target device.

[0129] In the above embodiment, the flexibility and efficiency of message transmission are improved through the layered encapsulation process. Application layer encapsulation ensures that the message format complies with the protocol requirements, and further encapsulation at the transport layer and network layer ensures that the message is transmitted safely and reliably in the network. Based on the virtual address of the first preset queue in the first preset memory, the first preset original partition can directly access the first preset queue and determine the second storage space, which helps to efficiently store the messages to be sent, thereby improving the utilization rate of the first preset memory and the flexibility of processing the messages to be sent, ensuring the reasonable allocation and efficient access of the first preset memory resources, and improving the integrity and performance of the transmission of the messages to be sent.

[0130] In a specific embodiment, obtaining the first physical address of the first original message content includes:

[0131] The first virtual address is converted into a first physical address.

[0132] In a specific embodiment, the conversion of the first virtual address into the first physical address may include first obtaining a base address of a page table from a page directory using a page directory index of the first virtual address. Next, obtaining a base address of a page frame from a page table using the page table index of the first virtual address. Finally, combining the page frame base address with the page offset of the first virtual address to calculate the final first physical address.

[0133] In the above embodiment, by converting the first virtual address into the first physical address, it is ensured that the actual first preset memory can be correctly accessed and operated. This conversion enables the first network card hardware to read the message to be sent from the first preset memory so as to correctly send the message to be sent, ensure that the content of the message to be sent is consistent with the actual message in the memory, and improve the accuracy and reliability of message transmission.

[0134] Step S103 , in the process of accessing the first preset memory based on the first user mode driver, based on the first preset configuration information, a first storage space is determined from the preset sending queue of the first preset memory, and the first physical address is stored in the first storage space.

[0135] In one specific embodiment, the first preset configuration information is a virtual address of a preset send queue in a first preset memory. In one specific embodiment, the preset send queue is a memory area that stores and manages basic information of received messages to be sent. In one specific embodiment, the first storage space is any free storage space in the preset send queue.

[0136] In a specific embodiment, in the above process of accessing the first preset memory based on the first user state driver, based on the first preset configuration information, the first storage space is determined from the preset sending queue of the first preset memory, and the first physical address is stored in the first storage space, which can be a virtual address based on the preset sending queue in the first preset memory. The first user state driver can access the preset sending queue in the first preset memory, search for the free first storage space in the preset sending queue, and place the first physical address in the first storage space, thereby changing the first storage space from an idle state to an occupied state.

[0137] Step S105, in the process of accessing the first preset memory based on the first network card hardware, when it is detected that any idle storage space in the preset sending queue is occupied, based on the second preset configuration information, the first storage space is taken out from the preset sending queue, the first storage space is parsed, and the first physical address is obtained.

[0138] In a specific embodiment, the second preset configuration information is the physical address of the preset sending queue in the first preset memory.

[0139] In a specific embodiment, in the above-mentioned process of accessing the first preset memory based on the first network card hardware, when it is detected that any free storage space in the preset sending queue is occupied, based on the second preset configuration information, the first storage space is taken out from the preset sending queue, and the first storage space is parsed to obtain the first physical address, which can be the physical address of the preset sending queue in the first preset memory. The first network card hardware can access the preset sending queue in the first preset memory. When it is detected that any free storage space in the preset sending queue is occupied, the occupied first storage space is taken out from the preset sending queue and parsed to obtain the first physical address.

[0140] Step S107: Send the message to be sent based on the first physical address and the first network card hardware.

[0141] In a specific embodiment, Figure 3 As shown, the sending of the message to be sent based on the first physical address and the first network card hardware includes:

[0142] Step S301 : in a process of accessing a first preset memory based on first network card hardware, obtaining a first memory address based on fourth preset configuration information and a first physical address.

[0143] In a specific embodiment, the fourth preset configuration information is the physical address of the first preset queue in the first preset memory.

[0144] In a specific embodiment, in the above process of accessing the first preset memory based on the first network card hardware, based on the fourth preset configuration information and the first physical address, obtaining the first memory address can be based on the physical address of the first preset queue in the first preset memory. The first network card hardware can access the first preset queue in the first preset memory, and based on the first physical address of the second storage space of the message to be sent in the first preset queue, obtain the first memory address of the second storage space of the first preset queue in the first preset queue.

[0145] Step S303: based on the first memory address and the first preset controller, retrieve the third encapsulated message from the second storage space.

[0146] In a specific embodiment, the first preset controller is used to directly transfer data between the memory and the peripheral device in the computer system. Exemplarily, the first preset controller can be a DMA (Direct Memory Access) controller on the transmitting end side.

[0147] In one specific embodiment, the obtaining the third encapsulated packet from the second storage space based on the first memory address and the first preset controller can include finding the second storage space where the to-be-sent packet is located based on the first memory address, and obtaining the third encapsulated packet from the second storage space based on the first preset controller.

[0148] In step S305, the third encapsulated packet is added to the preset dispatch sending queue for sending processing of the to-be-sent packet.

[0149] In one specific embodiment, the preset dispatch sending queue is used for optimizing transmission and dispatch of the packet to achieve time-sensitive network service quality.

[0150] In the above embodiments, the first network card hardware can directly obtain the to-be-sent packet from the first preset memory through the physical address of the first preset queue in the first preset memory, which reduces the overhead of intermediate conversion, improves the efficiency of packet transmission, and optimizes the access efficiency of the packet. The third encapsulated packet is extracted from the second storage space by the first preset controller, which reduces the burden of the central processing unit and ensures the integrity of the to-be-sent packet. The to-be-sent packet is added to the preset dispatch sending queue to achieve efficient and in-order sending processing. Thus, the reliability of the to-be-sent packet processing is improved.

[0151] In one specific embodiment, the method includes:

[0152] obtaining a first packet length and a packet priority of the third encapsulated packet;

[0153] The obtaining the first memory address based on the fourth preset configuration information and the first physical address includes:

[0154] obtaining the first memory address based on the fourth preset configuration information, the first physical address, and the first packet length;

[0155] The adding the third encapsulated packet to the preset dispatch sending queue for sending processing of the to-be-sent packet includes:

[0156] The adding the third encapsulated packet to the preset dispatch sending queue for sending processing of the to-be-sent packet based on the packet priority.

[0157] In one specific embodiment, the first packet length is the total number of bytes from the beginning of the packet header to the end of the data part. The packet priority is the importance level of the packet transmitted in the network, which is used to determine the processing order and resource allocation of different packets.

[0158] In a specific embodiment, the obtaining the first memory address based on the fourth preset configuration information, the first physical address and the first message length can be based on a physical address of a first preset queue in a first preset memory, the first preset queue in the first preset memory can be accessed by the first network card hardware, and the first memory address of the to-be-sent message in the first preset memory can be obtained based on the first physical address and the first message length of the to-be-sent message.

[0159] In the above embodiment, the first message length and the message priority of the to-be-sent message are obtained to correctly process and schedule the to-be-sent message, and based on the first physical address and the first message length of the to-be-sent message, the position of the to-be-sent message in the first preset memory can be accurately located to ensure that the to-be-sent message is correctly read in case of incomplete acquisition of the first physical address. The to-be-sent message is added to a scheduling queue according to the message priority, efficient processing of the to-be-sent message according to the priority is realized, and the utilization of resources is optimized.

[0160] Figure 4 Another message communication processing method provided by the embodiment of the present application is shown in FIG. 4, which can be applied to a receiving end and includes the following steps: Figure 4

[0161] In step S401, a second physical address of a to-be-received message is obtained when any to-be-received message is received.

[0162] In actual application, the receiving end can be a receiving terminal of a message, such as a vehicle terminal, and the vehicle terminal can include a vehicle domain controller. Accordingly, the another message communication processing method provided by the embodiment of the present application can be executed based on the vehicle domain controller.

[0163] In a specific embodiment, the to-be-received message can be a message that needs to be received by the vehicle domain controller. In a specific embodiment, the to-be-received message can be control type data. For example, the control type data can be power control data, brake control data and steering control data, and the like unmanned driving environment perception data flow. Specifically, the power control data can be engine speed and throttle pedal position. The brake control data can be brake pedal position and brake pressure. The steering control data can be steering wheel data and steering torque. In a specific embodiment, the to-be-received message can be perception type data. For example, the perception type data can be millimeter wave radar data and laser radar data.

[0164] In a specific embodiment, the obtaining the second physical address of the to-be-received message includes:

[0165] ​In the process of accessing the second preset memory based on the second network card hardware, based on the seventh preset configuration information and the second preset controller, a fourth storage space is determined from the second preset queue of the second preset memory, and the to-be-received packet is stored in the fourth storage space.

[0166] The second physical address of the to-be-received packet in the fourth storage space is recorded.

[0167] In one specific embodiment, the second preset memory includes a second preset queue rawpktQ (raw packet queue) and a preset receive queue RQ (receive queue), and the second preset memory is mapped based on mmap (Memory Mapping) so that the second preset partition, the second user mode driver, and the second network card hardware can all access. In one specific embodiment, the seventh preset configuration information is the physical address of the second preset queue in the second preset memory. In one specific embodiment, the second preset controller is used to directly transmit data between memory and peripherals in a computer system. For example, the second preset controller can be a receive-side DMA (Direct Memory Access) controller.

[0168] In one specific embodiment, the second preset queue is used to store the to-be-received packet. In one specific embodiment, the fourth storage space is any idle storage space rawpktqe (raw packet queue element) in the second preset queue.

[0169] In one specific embodiment, in the process of accessing the second preset memory based on the second network card hardware, based on the seventh preset configuration information and the second preset controller, a fourth storage space is determined from the second preset queue of the second preset memory, and the to-be-received packet is stored in the fourth storage space. For example, based on the physical address of the second preset queue in the second preset memory, the second network card hardware can access the second preset queue in the second preset memory, find an idle fourth storage space in the second preset queue, and store the to-be-received packet in the fourth storage space.

[0170] In the above embodiment, the second NIC hardware can directly access the second preset memory through the physical address of the second preset queue in the second preset memory, determine the fourth storage space in the second preset queue, and ensure that the to-be-received packet is correctly stored in the appropriate storage location. Moreover, the packet is stored in the idle storage space in the second preset queue, which optimizes the use of the second preset memory. Selecting the idle storage space avoids the conflict and coverage of the to-be-received packet, and improves the efficiency of the second preset memory management. Recording the second physical address of the to-be-received packet in the fourth storage space provides necessary information for subsequent processing of the packet, can quickly locate the position of the to-be-received packet in the subsequent processing stage, reduces the search time, and improves the system processing efficiency.

[0171] In step S403, based on the fifth preset configuration information, a third storage space is determined from the preset receiving queue of the second preset memory, and the second physical address is stored in the third storage space in the process of accessing the second preset memory based on the second NIC hardware.

[0172] In one specific embodiment, the fifth preset configuration information is the physical address of the preset receiving queue in the second preset memory. In one specific embodiment, the preset receiving queue is a memory area for storing and managing the basic information of the received to-be-received packet. In one specific embodiment, the third storage space is any idle storage space RQE (receive queue element) in the preset receiving queue.

[0173] In one specific embodiment, in the process of accessing the second preset memory based on the second NIC hardware, the third storage space is determined from the preset receiving queue of the second preset memory based on the fifth preset configuration information, and the second physical address is stored in the third storage space. Based on the physical address of the preset receiving queue in the second preset memory, the second NIC hardware can access the preset receiving queue in the second preset memory, find the idle third storage space in the preset receiving queue, and place the second physical address in the third storage space, so that the third storage space is changed from the idle state to the occupied state.

[0174] In step S405, based on the sixth preset configuration information, the third storage space is taken out from the preset receiving queue, the third storage space is parsed to obtain the second physical address in the process of accessing the second preset memory based on the second user-mode driver in the case that any idle storage space in the preset receiving queue is detected to be occupied.

[0175] In one specific embodiment, the sixth preset configuration information is the virtual address of the preset receiving queue in the second preset memory.

[0176] In a specific embodiment, in the process of accessing the second preset memory based on the second user mode driver, when it is detected that any idle storage space in the preset receiving queue is occupied, the third storage space is taken out from the preset receiving queue based on the sixth preset configuration information, the third storage space is parsed, and the second physical address is obtained based on the virtual address of the preset receiving queue in the second preset memory. The second user mode driver can access the preset receiving queue in the second preset memory, and when it is detected that any idle storage space in the preset receiving queue is occupied, the third storage space occupied is taken out from the preset receiving queue and parsed to obtain the second physical address.

[0177] In step S407, the second original message content corresponding to the to-be-received message is obtained based on the second physical address and the second preset original partition.

[0178] In a specific embodiment, the method further includes:

[0179] The second physical address is converted into a second virtual address.

[0180] The second memory address of the to-be-received message in the fourth storage space is recorded.

[0181] The second original message content corresponding to the to-be-received message is obtained based on the second physical address and the second preset original partition.

[0182] In the process of accessing the second preset memory based on the second preset original partition, the second memory address is obtained based on the eighth preset configuration information and the second virtual address.

[0183] The to-be-received message is taken out from the fourth storage space based on the second memory address, and the to-be-received message is processed to obtain the second original message content.

[0184] In a specific embodiment, the conversion of the second physical address into the second virtual address can be as follows: first, the page table of the current process is obtained, and the page table records the mapping relationship between the virtual address and the physical address. Then, the physical address is used to find the page table item, and the page table item stores the mapping relationship between the virtual address and the physical address. The physical address usually needs to be converted into the corresponding page table index to find the corresponding page table item from the page table. Secondly, the virtual address is calculated according to the mapping information in the page table item. The mapping usually includes the address mapping of the page directory and the page table, and the final virtual address is obtained by combining the offset in the page table item.

[0185] In one specific embodiment, the second preset raw partition is used to allocate the second preset memory to the second preset queue and the preset receiving queue. For example, the second preset raw partition can be a raw device (RAW) on the receiving side. In one specific embodiment, the eighth preset configuration information is a virtual address of the second preset queue in the second preset memory.

[0186] In one specific embodiment, in the process of accessing the second preset memory based on the second preset raw partition, the second memory address is obtained based on the eighth preset configuration information and the second virtual address. The second preset raw partition can access the second preset queue in the second preset memory based on the virtual address of the second preset queue in the second preset memory. The second memory address of the third storage space of the second preset queue is obtained based on the second virtual address of the to-be-received message in the third storage space of the second preset queue.

[0187] In the above embodiment, by converting the second physical address into the second virtual address, the to-be-received message can be located in the second preset memory space, and the second memory address of the to-be-received message is recorded in the fourth storage space, so that the subsequent processing steps can accurately find and operate the to-be-received message. Moreover, based on the virtual address of the second preset queue in the second preset memory, the second preset raw partition can directly access the second preset memory, thereby obtaining the to-be-received message in the second preset memory, reducing the overhead of intermediate conversion, and improving the efficiency of message transmission.

[0188] In one specific embodiment, the method further comprises:

[0189] obtaining a second message length of the to-be-received message;

[0190] The above obtaining the second memory address based on the eighth preset configuration information and the second virtual address comprises:

[0191] obtaining the second memory address based on the eighth preset configuration information, the second virtual address, and the second message length.

[0192] In one specific embodiment, the second message length is the total number of bytes from the beginning of the message header to the end of the data part.

[0193] In one specific embodiment, the above obtaining the second memory address based on the eighth preset configuration information, the second virtual address, and the second message length can be based on the virtual address of the second preset queue in the second preset memory. The second preset raw partition can access the second preset queue in the second preset memory. The second memory address of the third storage space of the second preset queue is obtained based on the second physical address of the to-be-received message and the second message length.

[0194] In the above embodiment, based on the second virtual address and the second message length of the to-be-received message, double protection is provided to accurately locate the second memory address of the to-be-received message in the second preset memory in case of incomplete acquisition of the second virtual address, and ensure correct reading of the to-be-received message.

[0195] In a specific embodiment, the second original message content is a third unpacked message, and the second original message content is obtained by performing unpacking processing on the to-be-received message, including:

[0196] performing unpacking processing on the to-be-received message at the network layer to obtain a first unpacked message;

[0197] performing unpacking processing on the first unpacked message at the transport layer to obtain a second unpacked message;

[0198] performing unpacking processing on the second unpacked message at the application layer to obtain a third unpacked message.

[0199] In a specific embodiment, the first unpacked message is a to-be-received message from which an Internet Protocol address is removed.

[0200] In a specific embodiment, the second unpacked message is a to-be-received message from which an Internet Protocol address and User Datagram Protocol port information are removed.

[0201] In a specific embodiment, the third unpacked message is a to-be-received message from which an Internet Protocol address, User Datagram Protocol port information, and a message header of a real-time publish / subscribe protocol are removed.

[0202] In the above embodiment, by performing layer-by-layer unpacking processing, the header information of each layer of protocol can be gradually stripped off from the network layer, the transport layer, to the application layer, and the message closest to the user demand can be accurately extracted. The unpacking steps of each layer ensure that the message is correctly decoded according to the protocol specification, thereby reducing the risk of message damage or parsing error.

[0203] Figure 5 Another message communication processing method provided by the present application is as follows: Figure 5 The method includes the following steps:

[0204] Step S501, in a case where a first original message content corresponding to any to-be-sent message is received, performing encapsulation processing on the first original message content at the application layer based on a real-time publish / subscribe protocol to obtain a first encapsulated message;

[0205] Step S503, in a process of accessing a first preset memory based on a first preset original partition, determining a second storage space from a first preset queue of the first preset memory based on third preset configuration information, and storing the first encapsulated message in the second storage space.

[0206] Step S505, record the first virtual address and the first memory address of the first encapsulation packet in the second storage space;

[0207] Step S507, encapsulate the first encapsulation packet in the second storage space based on the user datagram protocol in the transport layer to obtain a second encapsulation packet;

[0208] Step S509, encapsulate the second encapsulation packet in the second storage space based on the Internet Protocol in the network layer to obtain a third encapsulation packet;

[0209] Step S511, obtain the first packet length and the packet priority of the third encapsulation packet;

[0210] Step S513, convert the first virtual address into a first physical address;

[0211] Step S515, in the process of accessing the first preset memory based on the first user mode driver, determine the first storage space from the preset sending queue of the first preset memory based on the first preset configuration information, and store the first physical address in the first storage space;

[0212] Step S517, in the process of accessing the first preset memory based on the first network card hardware, when detecting that any idle storage space in the preset sending queue is occupied, obtain the first storage space from the preset sending queue based on the second preset configuration information, analyze the first storage space to obtain the first physical address;

[0213] Step S519, in the process of accessing the first preset memory based on the first network card hardware, obtain the first memory address based on the fourth preset configuration information, the first physical address and the first packet length;

[0214] Step S521, take out the third encapsulation packet from the second storage space based on the first memory address and the first preset controller;

[0215] Step S523, add the third encapsulation packet to the preset dispatching sending queue based on the packet priority to perform sending processing on the to-be-sent packet.

[0216] Figure 6 is another packet communication processing method provided by the present application, as described above, comprising the following steps: Figure 6

[0217] ​Step S601, in the case of receiving any to-be-received packet, in the process of accessing the second preset memory based on the second network card hardware, based on the seventh preset configuration information and the second preset controller, determining a fourth storage space from the second preset queue of the second preset memory, and storing the to-be-received packet into the fourth storage space;

[0218] Step S603, recording the second physical address, the second memory address and the second packet length of the to-be-received packet in the fourth storage space;

[0219] Step S605, in the process of accessing the second preset memory based on the second network card hardware, based on the fifth preset configuration information, determining a third storage space from the preset receiving queue of the second preset memory, and storing the second physical address into the third storage space;

[0220] Step S607, in the process of accessing the second preset memory based on the second user mode driver, in the case of detecting that any idle storage space in the preset receiving queue is occupied, based on the sixth preset configuration information, taking out the third storage space from the preset receiving queue, analyzing the third storage space to obtain the second physical address;

[0221] Step S609, converting the second physical address into a second virtual address;

[0222] Step S611, in the process of accessing the second preset memory based on the second preset original partition, based on the eighth preset configuration information, the second virtual address and the second packet length, obtaining the second memory address;

[0223] Step S613, based on the second memory address, taking out the to-be-received packet from the fourth storage space;

[0224] Step S615, performing decapsulation processing on the to-be-received packet at the network layer to obtain a first decapsulated packet;

[0225] Step S617, performing decapsulation processing on the first decapsulated packet at the transport layer to obtain a second decapsulated packet;

[0226] Step S619, performing decapsulation processing on the second decapsulated packet at the application layer to obtain a third decapsulated packet.

[0227] Figure 7 is a block diagram of a packet communication processing device according to an exemplary embodiment. Referring to Figure 7 , the device comprises:

[0228] The first physical address obtaining module 710 is configured to obtain a first physical address of a first original packet corresponding to any to-be-sent packet in the case of receiving the first original packet.

[0229] The first storage space determination module 720 is configured to, in the process of accessing the first preset memory based on the first user-mode driver, determine a first storage space from a preset sending queue of the first preset memory based on first preset configuration information, and store a first physical address in the first storage space.

[0230] The first storage space analysis module 730 is configured to, in the process of accessing the first preset memory based on the first network card hardware, in a case where any idle storage space in the preset sending queue is detected to be occupied, take out the first storage space from the preset sending queue based on second preset configuration information, analyze the first storage space, and obtain a first physical address.

[0231] The to-be-sent packet sending module 740 is configured to send the to-be-sent packet based on the first physical address and the first network card hardware.

[0232] In an optional embodiment, the to-be-sent packet is a third encapsulated packet, and the apparatus further includes:

[0233] The first encapsulated packet obtaining module is configured to, in the application layer, encapsulate and process a first original packet content based on a real-time publish / subscribe protocol to obtain a first encapsulated packet.

[0234] The second storage space determination module is configured to, in the process of accessing the first preset memory based on the first preset original partition, determine a second storage space from a first preset queue of the first preset memory based on third preset configuration information, and store the first encapsulated packet in the second storage space.

[0235] The first information obtaining module is configured to record a first virtual address and a first memory address of the first encapsulated packet in the second storage space.

[0236] The second encapsulated packet obtaining module is configured to, in the transport layer, encapsulate and process the first encapsulated packet in the second storage space based on a user datagram protocol to obtain a second encapsulated packet.

[0237] The third encapsulated packet obtaining module is configured to, in the network layer, encapsulate and process the second encapsulated packet in the second storage space based on an internet protocol to obtain a third encapsulated packet.

[0238] In an optional embodiment, the first physical address obtaining module 710 includes:

[0239] The first physical address obtaining unit is configured to convert the first virtual address into the first physical address.

[0240] In an optional embodiment, the to-be-sent packet sending module 740 includes:

[0241] The first memory address obtaining unit is configured to obtain the first memory address based on the fourth preset configuration information and the first physical address in the process of accessing the first preset memory based on the first network card hardware.

[0242] The third encapsulation packet obtaining unit is configured to obtain the third encapsulation packet from the second storage space based on the first memory address and the first preset controller.

[0243] The to-be-sent packet sending unit is configured to add the third encapsulation packet to the preset dispatching sending queue to perform sending processing on the to-be-sent packet.

[0244] In an optional embodiment, the apparatus further includes:

[0245] The second information obtaining module is configured to obtain the first packet length and the packet priority of the third encapsulation packet.

[0246] The first memory address obtaining unit includes:

[0247] The first memory address obtaining sub-unit is configured to obtain the first memory address based on the fourth preset configuration information, the first physical address and the first packet length.

[0248] The to-be-sent packet sending unit includes:

[0249] The to-be-sent packet sending sub-unit is configured to add the third encapsulation packet to the preset dispatching sending queue based on the packet priority to perform sending processing on the to-be-sent packet.

[0250] Figure 8 is another apparatus block diagram for packet communication processing according to an example embodiment. Referring to Figure 8 The apparatus includes:

[0251] The second physical address obtaining module 810 is configured to obtain the second physical address of any to-be-received packet when the to-be-received packet is received.

[0252] The third storage space determining module 820 is configured to determine the third storage space from a preset receiving queue of the second preset memory based on the fifth preset configuration information in the process of accessing the second preset memory based on the second network card hardware, and store the second physical address in the third storage space.

[0253] The third storage space analyzing module 830 is configured to obtain the third storage space from the preset receiving queue based on the sixth preset configuration information, analyze the third storage space to obtain the second physical address when any idle storage space in the preset receiving queue is detected to be occupied in the process of accessing the second preset memory based on the second user mode driver.

[0254] The second original message content obtaining module 840 is configured to obtain second original message content corresponding to the to-be-received message based on the second physical address and the second preset original partition.

[0255] In an optional embodiment, the second physical address obtaining module 810 includes:

[0256] The fourth storage space determining unit is configured to determine a fourth storage space from a second preset queue of the second preset memory based on the seventh preset configuration information and the second preset controller in a process of accessing the second preset memory based on the second network card hardware, and store the to-be-received message in the fourth storage space.

[0257] The second physical address obtaining unit is configured to record the second physical address of the to-be-received message in the fourth storage space.

[0258] In an optional embodiment, the device further includes:

[0259] The second virtual address obtaining module is configured to convert the second physical address into a second virtual address.

[0260] The second memory address obtaining module is configured to record a second memory address of the to-be-received message in the fourth storage space.

[0261] The second original message content obtaining module 840 includes:

[0262] The second memory address obtaining unit is configured to obtain a second memory address based on the eighth preset configuration information and the second virtual address in a process of accessing the second preset memory based on the second preset original partition.

[0263] The second original message content obtaining unit is configured to obtain the second original message content by taking out the to-be-received message from the fourth storage space based on the second memory address, and performing decapsulation processing on the to-be-received message.

[0264] In an optional embodiment, the device further includes:

[0265] The second message length obtaining module is configured to obtain a second message length of the to-be-received message.

[0266] The second memory address obtaining unit includes:

[0267] The second memory address obtaining sub-unit is configured to obtain the second memory address based on the eighth preset configuration information, the second virtual address, and the second message length.

[0268] In an optional embodiment, the second original message content is a third decapsulated message, and the second original message content obtaining unit includes:

[0269] The first unsealed packet acquisition unit is configured to perform unsealing processing on the to-be-received packet at a network layer to obtain a first unsealed packet.

[0270] The second unsealed packet acquisition unit is configured to perform unsealing processing on the first unsealed packet at a transport layer to obtain a second unsealed packet.

[0271] The third unsealed packet acquisition unit is configured to perform unsealing processing on the second unsealed packet at an application layer to obtain the third unsealed packet.

[0272] As to the apparatus in the above embodiments, the specific manners in which various modules perform operations have been described in detail in the embodiments of the method, and thus will not be described here in detail.

[0273] Figure 9 is a block diagram of an electronic device for packet communication processing according to an example embodiment. The electronic device can be a terminal, and its internal structure can be as shown in Figure 9 The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. The processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The network interface of the electronic device is configured to communicate with external terminals through network connections. The computer program is executed by the processor to implement a packet communication processing method. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device can be a touch layer overlaid on the display screen, or a key, trackball, or touchpad provided on the housing of the electronic device. The input device can also be an external keyboard, touchpad, or mouse, etc.

[0274] Those skilled in the art can understand that Figure 9 The structure shown in the figure is only a block diagram of part of the structure related to the present disclosure, and does not constitute a limitation on the electronic device to which the present disclosure is applied. A specific electronic device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0275] In an example embodiment, an electronic device is also provided, including a processor, a memory for storing instructions executable by the processor, and wherein the processor is configured to execute the instructions to implement a packet communication processing method as in the embodiments of the present disclosure.

[0276] In an example embodiment, a computer readable storage medium is also provided, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the packet communication processing method in the embodiments of the present disclosure.

[0277] In an example embodiment, a computer program product containing instructions, which, when run on a computer, enables the computer to perform the packet communication processing method in the embodiments of the present disclosure, is also provided.

[0278] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments of each method. Any reference to memory, storage, databases, or other media in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0279] Other embodiments of the present disclosure will be apparent to those skilled in the art with the consideration of the specification and practice of the disclosed application. The present application is intended to cover any variations, uses, or adaptations of the present disclosure following the general principles thereof and including modifications and equivalents that are obvious to those skilled in the art. The specification and examples are to be regarded as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0280] It should be understood that the present disclosure is not limited to the precise structures as herein described and illustrated in the drawings, and that various modifications and changes in form and detail can be made without departing from its scope. The scope of the present disclosure is limited only by the claims appended hereto.

Claims

1. A message communication processing method characterized by comprising: The method comprises the following steps: In the case of receiving a first original message content corresponding to any to-be-sent message, a first physical address of the first original message content is obtained; In the process of accessing a first preset memory based on a first user mode driver, a first storage space is determined from a preset sending queue of the first preset memory based on first preset configuration information, and the first physical address is stored in the first storage space, wherein the first preset configuration information is a virtual address of the preset sending queue in the first preset memory, and the first storage space is any idle storage space in the preset sending queue; In the process of accessing the first preset memory based on a first network card hardware, in the case of detecting that any idle storage space in the preset sending queue is occupied, the first storage space is taken out from the preset sending queue based on second preset configuration information, the first storage space is parsed to obtain the first physical address, and the second preset configuration information is a physical address of the preset sending queue in the first preset memory; The to-be-sent message is sent based on the first physical address and the first network card hardware.

2. The method of claim 1, wherein, The to-be-sent message is a third encapsulated message, and the method further comprises the following steps: The first original message content is encapsulated to obtain a first encapsulated message based on a real-time publishing and subscribing protocol in an application layer; In the process of accessing the first preset memory based on a first preset original partition, a second storage space is determined from a first preset queue of the first preset memory based on third preset configuration information, and the first encapsulated message is stored in the second storage space, wherein the third preset configuration information is a virtual address of the first preset queue in the first preset memory, and the second storage space is any idle storage space in the first preset queue; A first virtual address and a first memory address of the first encapsulated message in the second storage space are recorded; The first encapsulated message is encapsulated to obtain a second encapsulated message in the second storage space based on a user datagram protocol in a transport layer; The second encapsulated message is encapsulated to obtain the third encapsulated message in the second storage space based on an internet protocol in a network layer.

3. The method of claim 2, wherein, The first physical address of the first original message content is obtained by: The first virtual address is converted into the first physical address.

4. The method of claim 2, wherein, The to-be-sent message is sent based on the first physical address and the first network card hardware, which comprises the following steps: In the process of accessing the first preset memory based on the first network card hardware, the first memory address is obtained based on fourth preset configuration information and the first physical address, wherein the fourth preset configuration information is a physical address of the first preset queue in the first preset memory; The third encapsulated message is taken out from the second storage space based on the first memory address and a first preset controller; The third encapsulated message is added to a preset dispatching sending queue for sending processing of the to-be-sent message.

5. The method of claim 4, wherein, The method further comprises the following steps: A first message length and a message priority of the third encapsulated message are obtained. The first memory address is obtained based on the fourth preset configuration information and the first physical address. The first memory address is obtained based on the fourth preset configuration information, the first physical address and the first message length. The third encapsulated message is added to the preset dispatch sending queue for sending processing of the to-be-sent message. The third encapsulated message is added to the preset dispatch sending queue for sending processing of the to-be-sent message based on the message priority.

6. A message communication processing method characterized by comprising: The method further comprises: A second physical address of the to-be-received message is obtained upon receiving any to-be-received message. In the process of accessing the second preset memory based on the second network card hardware, a third storage space is determined from a preset receiving queue of the second preset memory based on fifth preset configuration information, and the second physical address is stored in the third storage space, the fifth preset configuration information being a physical address of the preset receiving queue in the second preset memory, and the third storage space being any idle storage space in the preset receiving queue. In the process of accessing the second preset memory based on the second user state drive, upon detecting that any idle storage space in the preset receiving queue is occupied, the third storage space is taken out from the preset receiving queue based on sixth preset configuration information, and the second physical address is obtained by analyzing the third storage space, the sixth preset configuration information being a virtual address of the preset receiving queue in the second preset memory. Second original message content corresponding to the to-be-received message is obtained based on the second physical address and a second preset original partition.

7. The method of claim 6, wherein, The second physical address of the to-be-received message is obtained. In the process of accessing the second preset memory based on the second network card hardware, a fourth storage space is determined from a second preset queue of the second preset memory based on seventh preset configuration information and a second preset controller, and the to-be-received message is stored in the fourth storage space, the seventh preset configuration information being a physical address of the second preset queue in the second preset memory, and the fourth storage space being any idle storage space in the second preset queue. The second physical address of the to-be-received message in the fourth storage space is recorded.

8. The method of claim 7, wherein, The method further comprises: The second physical address is converted into a second virtual address. A second memory address of the to-be-received message in the fourth storage space is recorded. The second original message content corresponding to the to-be-received message is obtained based on the second physical address and a second preset original partition. In the process of accessing the second preset memory based on the second preset original partition, the second memory address is obtained based on eighth preset configuration information and the second virtual address, the eighth preset configuration information being a virtual address of the second preset queue in the second preset memory. The to-be-received message is taken out from the fourth storage space based on the second memory address, and the to-be-received message is unpacked to obtain the second original message content.

9. The method of claim 8, wherein, The method further comprises: obtaining a second message length of the to-be-received message; the second memory address is obtained based on the eighth preset configuration information and the second virtual address, and the second memory address includes: the second memory address is obtained based on the eighth preset configuration information, the second virtual address and the second message length.

10. The method of claim 8, wherein, the second original message content is a third unencrypted message, and the unencrypted processing of the to-be-received message to obtain the second original message content includes: unencrypted processing of the to-be-received message at the network layer to obtain a first unencrypted message; unencrypted processing of the first unencrypted message at the transport layer to obtain a second unencrypted message; unencrypted processing of the second unencrypted message at the application layer to obtain the third unencrypted message.

11. A packet communication processing apparatus characterized by comprising: comprising: a first physical address obtaining module configured to, in a case where a first original message content corresponding to any to-be-sent message is received, obtain a first physical address of the first original message content; a first storage space determining module configured to, in a process of accessing a first preset memory based on a first user mode driver, determine a first storage space from a preset sending queue of the first preset memory based on first preset configuration information, and store the first physical address in the first storage space, the first preset configuration information being a virtual address of the preset sending queue in the first preset memory, and the first storage space being any idle storage space in the preset sending queue; a first storage space analyzing module configured to, in a process of accessing the first preset memory based on a first network card hardware, in a case where any idle storage space in the preset sending queue is detected to be occupied, take out the first storage space from the preset sending queue based on second preset configuration information, analyze the first storage space to obtain the first physical address, the second preset configuration information being a physical address of the preset sending queue in the first preset memory; a to-be-sent message sending module configured to send the to-be-sent message based on the first physical address and the first network card hardware.

12. A packet communication processing apparatus characterized by comprising: comprising: a second physical address obtaining module configured to, in a case where any to-be-received message is received, obtain a second physical address of the to-be-received message; a third storage space determining module configured to, in a process of accessing a second preset memory based on a second network card hardware, determine a third storage space from a preset receiving queue of the second preset memory based on fifth preset configuration information, and store the second physical address in the third storage space, the fifth preset configuration information being a physical address of the preset receiving queue in the second preset memory, and the third storage space being any idle storage space in the preset receiving queue; a third storage space analysis module, configured to, in a process of accessing the second preset memory based on the second user mode driver, and in a case where any idle storage space in the preset receiving queue is detected to be occupied, based on sixth preset configuration information, taking the third storage space from the preset receiving queue, analyzing the third storage space, and obtaining the second physical address, the sixth preset configuration information being a virtual address of the preset receiving queue in the second preset memory; a second original packet content acquisition module, configured to, based on the second physical address and a second preset original partition, acquiring second original packet content corresponding to the to-be-received packet.

13. An electronic device, comprising: comprise: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a packet communication processing method as claimed in any one of claims 1 to 10.

Citation Information

Patent Citations

  • In-vehicle message processing method and device, vehicle-mounted terminal and storage medium

    CN114584582A

  • Queue page table management method and device based on remote direct memory access

    CN117873921A