A data processing method, an electronic device, a program product, and a storage medium
By introducing a high-speed interconnect protocol between the processor and the network interface card (NIC), allowing them to directly access the NIC's memory, the problem of frequent memory data transfer between the processor and the NIC is solved, thus improving work efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INSPUR (BEIJING) ELECTRONICS INFORMATION IND CO LTD
- Filing Date
- 2025-05-27
- Publication Date
- 2026-06-12
AI Technical Summary
Frequent memory data transfers between the processor and the smart network interface card (NIC) reduce work efficiency.
By introducing a high-speed interconnect protocol, both the processor and the network interface card (NIC) can access the NIC's memory. The processor sets network service data and programs in the NIC's memory and processes the data based on the high-speed interconnect protocol. The NIC directly processes the data in the NIC's memory, ensuring cache consistency.
This avoids frequent memory data transfer between the processor and the network card, improving the working efficiency between the processor and the network card.
Smart Images

Figure CN120216208B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network technology, and in particular to a data processing method, electronic device, program product, and storage medium. Background Technology
[0002] To meet the demands of high-speed computing and transmission, smart network interface cards (NICs) were developed. These NICs can offload some network computing functions from the processor to the network card, thereby reducing the processor's load. However, the processor and the smart NIC cannot access each other's memory, which necessitates frequent memory data transfers between them, reducing the efficiency of both the processor and the smart NIC. Summary of the Invention
[0003] This application provides a data processing method, electronic device, program product, and storage medium to solve the problem of frequent memory data transfer between the processor and network card device in related technologies.
[0004] This application provides a data processing method applied to an electronic device, the electronic device including a processor and a network interface card (NIC) device, the NIC device having NIC memory, and both the processor and the NIC device accessing the NIC memory based on a high-speed interconnect protocol, the method including:
[0005] The processor stores both network service data and network service programs in the network card's memory;
[0006] The processor accesses network service data and network service programs in the network card's memory, and performs service processing on the network service data based on the network service programs;
[0007] The network interface card (NIC) device accesses the network service data in the NIC's memory and performs NIC service processing and network transmission processing on the network service data.
[0008] This application also provides an electronic device, which includes a processor and a network interface card (NIC) device, wherein the NIC device has NIC memory, and both the processor and the NIC device access the NIC memory based on a high-speed interconnect protocol.
[0009] The processor and network interface card (NIC) are used to execute the above data processing methods.
[0010] This application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the above-described data processing method.
[0011] This application also provides a non-volatile computer-readable storage medium storing computer-executable instructions, which, when loaded and executed by a processor, implement the above-described data processing method.
[0012] In this application, the electronic device may include a processor and a network interface card (NIC) device. The NIC device has NIC memory, and both the processor and the NIC device access the NIC memory based on a high-speed interconnect protocol, meaning the processor can directly access the NIC device's NIC memory. Subsequently, the processor can store network service data and network service programs in the NIC memory, and can access the network service data and network service programs in the NIC memory, as well as perform service processing on the network service data based on the network service programs. Meanwhile, the NIC device accesses the same batch of network service data in the NIC memory and performs NIC service processing and network transmission processing on the network service data. Therefore, since both the processor and the NIC device can process the same batch of network service data in the NIC memory, frequent memory data transfer between the processor and the NIC device can be avoided, thereby effectively improving the working efficiency between the processor and the NIC device.
[0013] This application also provides an electronic device, a computer program product, and a non-volatile computer-readable storage medium, which have the above-mentioned beneficial effects. Attached Figure Description
[0014] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0015] Figure 1 This is a structural block diagram of an electronic device provided in an embodiment of this application;
[0016] Figure 2 A flowchart illustrating a data processing method provided in an embodiment of this application;
[0017] Figure 3 A schematic diagram illustrating the partitioning of operating system memory space as provided in an embodiment of this application;
[0018] Figure 4 A schematic diagram illustrating a memory interaction method provided in an embodiment of this application;
[0019] Figure 5 A schematic diagram of a hardware and software architecture provided for an embodiment of this application;
[0020] Figure 6 A schematic diagram of memory distribution provided in an embodiment of this application;
[0021] Figure 7 This is a schematic diagram of a downlink transmission process provided in an embodiment of this application;
[0022] Figure 8This is a schematic diagram of an uplink transmission process provided in an embodiment of this application;
[0023] Figure 9 This is a schematic diagram of an operating system initialization process provided in an embodiment of this application. Detailed Implementation
[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0025] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0026] In related technologies, to meet the demands of high-speed computing and high-speed transmission, smart network interface cards (NICs) have emerged. These NICs can offload some network computing functions from the processor to the network interface card, thereby reducing the processor's load. However, the processor and the smart NIC cannot access each other's memory, which necessitates frequent memory data transfers between them, reducing the efficiency of both the processor and the smart NIC.
[0027] In view of this, this application provides a data processing method to address the technical problem of frequent memory data transfer between the processor and the network interface card (NIC). This method ensures that both the processor and the NIC can process the same batch of network service data in the NIC's memory, thus avoiding frequent memory data transfer between the processor and the NIC and effectively improving the working efficiency between them.
[0028] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0029] First, the electronic device structure to which this application applies will be described. Please refer to... Figure 1 , Figure 1This is a structural block diagram of an electronic device provided in an embodiment of this application. In this embodiment, the electronic device may include a processor and a network interface card (NIC) device, the NIC device including NIC memory. The processor and the NIC device are connected, for example, via a bus (such as PCIe bus, Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard). Unlike related technologies, in this embodiment, both the processor and the NIC device can access the NIC memory via a high-speed interconnect protocol. This high-speed interconnect protocol is a protocol that supports memory sharing, cache coherency processing, and improves communication between the processor and accelerators or memory expansion devices. Examples include CXL (Compute Express Link), CCIX (Cache Coherent Interconnect for Accelerators), and UCIe (Universal Chiplet Interconnect Express). Under this protocol, the processor can access the NIC memory in the same way as accessing host memory, without needing to move memory data from host memory to NIC memory. At this point, as long as the processor sets the running data in the network card memory via a high-speed interconnect protocol and processes the running data in the network card memory, the memory data transfer between the processor and the network card device can be effectively avoided, thereby improving the working efficiency between the processor and the network card device.
[0030] Furthermore, the network interface card (NIC) processor in the processor and NIC device (NIC) Figure 1 (Not shown in the image) can all have corresponding caches ( Figure 1(Not shown), meaning the processor has a processor cache, and the network interface card (NIC) processor has a NIC processor cache. In related technologies, the frequent memory data transfer between the processor and the NIC device is due not only to the processor's inability to directly access the NIC device's NIC memory and the NIC device's inability to directly access the processor's host memory, but also to the inability to guarantee cache consistency between the processor and the NIC device; that is, it cannot be guaranteed that the same data will remain consistent in both the processor cache and the NIC processor cache. However, this application, by introducing a high-speed interconnect protocol, can ensure cache consistency between the processor and the NIC device based on the high-speed interconnect protocol. For example, after the processor loads data from the NIC memory into the processor cache and processes it, it can update the same data in the NIC processor cache (such as updating values or status) based on the high-speed interconnect protocol. Similarly, after the NIC processor loads data from the NIC memory into the NIC processor cache and processes it, it can update the same data in the processor cache based on the high-speed interconnect protocol. This maintains data consistency between the processor cache and the NIC processor cache, thereby ensuring the reliability of data processing. In addition, since the processor and network card processor can directly retrieve the correct running data from the cache, the read and write performance of the processor and network card processor can also be effectively guaranteed.
[0031] It should be noted that this application does not limit the number of processors; there can be one or more, depending on the actual application requirements. Furthermore, this application does not limit other structures in the electronic device; for example, the electronic device may also have a memory, host memory, bus, or other similar structures.
[0032] Based on the above description of the electronic device structure, the data processing method provided in this application will be described in detail below. For ease of understanding, please refer to... Figure 2 , Figure 2 A flowchart illustrating a data processing method provided in an embodiment of this application. The method may include:
[0033] S101, The processor stores both network service data and network service programs in the network card memory.
[0034] In this step, the processor needs to allocate runtime data to the network interface card (NIC) memory, including network service data and network service programs. Network service data refers to the data to be processed for network services, which can be characters, images, video, audio, network data packets, etc. As network service processing progresses, the form of the network service data can change, such as converting from characters, images, video, and audio to network data packets, or vice versa. The network service program is the program that executes the network service processing, and may include applications, network protocol stacks, and NIC drivers. Applications are computer programs launched by the user that can interact with the user. Network protocol stacks are computer programs that encapsulate / decapsulate network service data based on network protocols. NIC drivers are drivers that control the operation of the NIC device. Therefore, since the application program, network protocol stack, and NIC driver are all located in the NIC memory, the processor can directly run the application program, network protocol stack, and NIC driver based on the NIC memory, and can directly process network service data based on the NIC memory. At this time, the host memory on the host side is not responsible for storing network service data and network service programs. The host side can retain only the processor's computing functions.
[0035] It should be noted that different network service programs can be configured in the network card memory at different stages of electronic device operation. For example, the network protocol stack and network card driver can be configured in the network card memory during the operating system initialization phase; while applications can be configured in the network card memory after the operating system starts.
[0036] Furthermore, to achieve memory isolation between the application program, network protocol stack, and network card driver within the network card memory, thereby ensuring the normal operation of the operating system, this embodiment can further partition and plan the network card memory. Specifically, the network card memory can be divided into a user-mode memory area and a kernel-mode memory area by the operating system. The application program is located in the user-mode memory area, while the network protocol stack and network card driver are located in the kernel-mode memory area. The user-mode memory area and the kernel-mode memory area are isolated from each other. For a clearer understanding of how the operating system partitions memory space when the processor can directly access the network card memory, please refer to [reference needed]. Figure 3 , Figure 3 This is a schematic diagram illustrating the memory space partitioning of an operating system according to an embodiment of this application. Wherein, Figure 3 The left side illustrates how operating systems partition memory space in related technologies, where host memory and network interface card (NIC) memory are two independent and isolated memory regions. In these technologies, the processor can only access host memory, therefore it can only set up user-mode and kernel-mode memory spaces within host memory. NIC memory can only be accessed by the NIC processor, not by the main processor; therefore, user-mode and kernel-mode memory spaces cannot be set up within NIC memory, making it entirely NIC memory space. Figure 3 The right side shows the memory space allocation in this application by the operating system. Since the processor in this embodiment can directly access the network card memory based on a high-speed interconnect protocol, user-mode memory space and kernel-mode memory space can be set up in the network card memory. In this case, the network card memory is shared by the processor and the network card device, and the operating system can manage the network card memory space in a conventional manner.
[0037] Furthermore, because the processor's memory access method and the operating system's memory space have changed, the interaction between applications in user-mode memory space and the network protocol stack in kernel-mode memory space has also changed. For a clearer understanding of these changes, please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram illustrating a memory interaction method provided in an embodiment of this application. Figure 4 The left side illustrates the interaction between the application and the network card memory in related technologies. The application software accesses the operating system protocol stack software (such as the network protocol stack) in the kernel mode of the host memory through system calls. The operating system protocol stack software realizes the interaction between the kernel mode host memory and the network card memory through DMA / MMIO (Direct Memory Access, Memory-Mapped I / O). Figure 4 The right side shows the interaction method between the network card memory and the user in this application. The application software can directly interact with the operating system protocol stack software (such as the network protocol stack) in the network card memory through system calls based on high-speed interconnection protocols.
[0038] Based on this, the method may also include:
[0039] Step 11: When the processor is running the application, it calls the network protocol stack in the kernel-mode memory area through the operating system interface based on the high-speed interconnect protocol.
[0040] Step 12: When the processor is running the network protocol stack, it responds to applications in the user-mode memory area through the operating system interface based on the high-speed interconnect protocol.
[0041] S102, The processor accesses the network service data and network service program in the network card memory, and performs service processing on the network service data based on the network service program.
[0042] In this step, after the processor sets the network service data and network service program in the network card memory, it can access the network service data in the network card memory to perform service processing based on the network service program.
[0043] It should be noted that this embodiment does not limit the specific business processing, and relevant technologies of application programs, network protocol stacks, and network card drivers can be referenced.
[0044] Furthermore, the processor can configure a processor cache, and the network interface card (NIC) processor can configure a NIC processor cache, thereby enabling cache consistency processing between the processor cache and the NIC processor cache based on a high-speed interconnect protocol. Specifically, the processor loads network service data and network service programs from the NIC memory into the processor cache based on the high-speed interconnect protocol, and performs service processing within the processor cache. Subsequently, after the network service data is updated, the processor can update the NIC processor cache of the NIC device based on the high-speed interconnect protocol.
[0045] Based on this, the processor accesses network service data and network service programs in the network card's memory using a high-speed interconnect protocol, and performs service processing on the network service data based on the network service programs, which may include:
[0046] Step 21: The processor loads network service data and network service programs from the network card memory into the processor cache based on the high-speed interconnect protocol.
[0047] Step 22: The processor processes the network service data in the processor cache based on the network service program in the processor cache, and updates the network card processor cache of the network card device based on the high-speed interconnection protocol after the network service data is updated.
[0048] It should be noted that this embodiment does not limit how the network interface card (NIC) processor cache is updated. For example, when cached data has a data state, the network service data in the NIC processor cache can be marked as expired, so that the NIC processor can retrieve it from the NIC memory the next time it processes the network service data. Of course, the value of the network service data in the processor cache can also be updated directly based on the value of the network service data in the processor cache, which can be set according to the actual application requirements.
[0049] S103. The network card device accesses the network service data in the network card memory and performs network card service processing and network transmission processing on the network service data.
[0050] In this step, the network interface card (NIC) device can also directly access the same batch of network service data in the NIC's memory and perform NIC service processing and network transmission processing on the network service data. NIC service processing refers to the processing operations offloaded to the NIC device, which can include application processing and communication computation processing. Application processing refers to processing operations related to application programs, such as storage protocol processing in the distributed storage field, aggregate communication processing in the machine learning field, and video encoding / decoding processing in the video field. Communication computation refers to processing operations related to network communication, such as TCP giant frame functionality and IP / UDP checksum calculation. Since the processor and the NIC device share the NIC memory, and all network service-related data is stored in the NIC memory, the NIC device can directly obtain the network service data already processed by the processor from the NIC memory and process it directly, or the NIC device can directly transfer its processed network service data to the processor without requiring data transfer between the host memory and the NIC memory.
[0051] Furthermore, cache coherency processing can be performed on the network interface card (NIC) processor cache and the processor cache based on the high-speed interconnect protocol. Specifically, the NIC processor loads network service data and network service programs from the NIC memory into the NIC processor cache based on the high-speed interconnect protocol, and performs NIC service processing in the NIC processor cache. Subsequently, after the network service data is updated, the NIC processor can update the processor cache based on the high-speed interconnect protocol.
[0052] Based on this, the network interface card (NIC) device accesses network service data in the NIC's memory using a high-speed interconnect protocol and performs NIC service processing on the network service data, which may include:
[0053] Step 31: The network card device loads network service data from the network card memory into the network card processor cache based on the high-speed interconnect protocol.
[0054] Step 32: The processor performs network service processing on the network service data in the network card processor cache, and updates the processor cache based on the high-speed interconnect protocol after the network service data is updated.
[0055] It should be noted that this embodiment does not limit how the processor cache is updated. For example, when cached data has a data state, network service data in the processor cache can be marked as expired, so that the processor can retrieve it from the network card memory the next time it processes the network service data. Of course, the value of the network service data in the processor cache can also be updated directly according to the value of the network service data in the network card processor cache, which can be set according to the actual application requirements.
[0056] It should also be noted that although this application describes steps S102 and S103 in sequence, this does not mean that these two steps must be executed in a specific order. S102 can be executed first and then S103, or S103 can be executed first and then S102, or S102 and S103 can be executed in parallel.
[0057] Furthermore, for easier understanding, please refer to... Figure 5 and Figure 6 , Figure 5 This is a schematic diagram of a hardware and software architecture provided in an embodiment of this application. Figure 6 This is a schematic diagram of memory distribution provided for an embodiment of this application. This application can reconstruct existing network computing acceleration systems based on high-speed interconnect technology. Figure 5 In the diagram, the host memory is represented by a dashed box, meaning that application software, network protocol stacks, network card drivers, and other data no longer reside in host memory but are moved to the network card memory via high-speed interconnect protocols. However, these host-side computations are still performed by the processor, just no longer in host memory. The computational functions to the right of the host dashed line remain unchanged, but only the computational functionality is retained. The right side of the network card dashed line adds application software storage, protocol stack storage, and network card driver storage. Correspondingly, network computation offloading functions are also performed directly in the network card memory, accelerating the collaborative efficiency between the processor and network card computations. This reduces the copying between host memory and network card memory, as all data resides in the network card memory. Simultaneously, by introducing high-speed interconnect protocols, cache coherency is achieved, significantly improving performance for frequently accessed hot data. When most accesses hit the cache, the performance of reading the cache is the same regardless of whether it's cached in host or network card memory; that is, the processor's performance in accessing network card memory is approximately equal to its performance in accessing host memory.
[0058] exist Figure 6 In this application, the hardware boundary between the host and the network card is eliminated. All operational data that was originally stored in the host memory is now stored in the network card memory, and each processor's cache can cache data from the network card memory. Since all application software and protocol stacks run on the network card memory, extensive copying is unnecessary. Furthermore, because all data resides on the network card, steps that were previously separate on the network card and the host can be merged and optimized. This allows for the merging of application software uninstallation and operating system protocol stack uninstallation, achieving more efficient hardware and software collaboration.
[0059] Based on the above embodiments, in this application, the electronic device may include a processor and a network interface card (NIC) device. The NIC device has NIC memory, and both the processor and the NIC device access the NIC memory based on a high-speed interconnect protocol, meaning the processor can directly access the NIC device's NIC memory. Subsequently, the processor can store network service data and network service programs in the NIC memory, and can access the network service data and network service programs in the NIC memory, as well as perform service processing on the network service data based on the network service programs. Meanwhile, the NIC device accesses the same batch of network service data in the NIC memory and performs NIC service processing and network transmission processing on the network service data. Therefore, since both the processor and the NIC device can process the same batch of network service data in the NIC memory, frequent memory data transfer between the processor and the NIC device can be avoided, thereby effectively improving the working efficiency between the processor and the NIC device.
[0060] Based on the above embodiments, the following describes a scenario where functions such as application software and application software uninstallation, and operating system protocol stack and protocol stack uninstallation are combined. In one embodiment, processing network service data based on a network service program may include:
[0061] S201. The processor obtains the first application data from the network card memory, and processes the first application based on the application to obtain the second application data.
[0062] S202, The processor obtains the first data to be transmitted from the network card memory, and processes the first data to be transmitted based on the network protocol stack to obtain the second data to be transmitted.
[0063] Network interface card (NIC) processing and network transmission processing of network service data can include:
[0064] S301. The network card device obtains the second application data from the network card memory, performs application processing on the second application data, and obtains the first data to be transmitted.
[0065] S302. The network card device obtains the second data to be transmitted from the network card memory, performs communication calculations on the second data to be transmitted, and obtains a network data packet.
[0066] S303, the network interface card (NIC) device processes network data packets for network transmission.
[0067] It should be noted that the first application data needs to be processed by the processor's application stack, and the second application data needs to be processed by the network interface card (NIC) device's application stack; the second application data is an intermediate processing result of the first application data. Similarly, the first data to be transmitted needs to be processed by the processor's network protocol stack, and the second data to be transmitted needs to be processed by the NIC device's communication computing stack; the second data to be transmitted is an intermediate processing result of the first data to be transmitted.
[0068] In this embodiment, since both the processor and the network interface card (NIC) can process data in the NIC's memory, the efficiency of their data exchange can be significantly improved. For example, when the processor processes the first application data to obtain the second application data, the NIC can directly obtain the second application data and continue application processing without needing to migrate memory data. Similarly, after the NIC obtains the first data to be transmitted, the processor can directly retrieve the first data to be transmitted from the NIC's memory and process it based on the network protocol stack to obtain the second data to be transmitted. The NIC can then directly retrieve the second data to be transmitted from the NIC's memory, perform communication calculations on it to obtain network data packets, and then perform network transmission processing on these data packets. Therefore, the processor and NIC can perform efficient data processing in a relay manner, effectively improving the working efficiency between them.
[0069] Based on the above embodiments, the downlink process of sending data packets from the processor to an external device via the network interface card (NIC) is described below. Therefore, this method may further include:
[0070] S401: The processor accesses the raw service data and network service program in the network card memory based on the high-speed interconnection protocol, and performs service processing on the raw service data based on the network service program to obtain the data to be sent.
[0071] In this embodiment, the process of the processor accessing network service data and network service programs in the network card memory, and performing service processing on the network service data based on the network service programs, may include step S401.
[0072] In addition, the raw business data needs to be processed by the application program and the network protocol stack in sequence before the data to be sent can be obtained.
[0073] It should be noted that raw service data can be stored in the network interface card (NIC) memory or migrated from the host memory to the NIC memory. Considering that some applications on the host side may be configured in the host memory, and consequently, the raw service data generated by these applications may also be stored in the host memory, the processor can migrate this data from the host memory to the NIC memory to facilitate network service processing.
[0074] Based on this, before the processor accesses the raw service data and network service program in the network card memory based on the high-speed interconnect protocol, and performs service processing on the raw service data based on the network service program to obtain the data to be sent, the following steps are also included:
[0075] Step 41: The processor migrates the original service data in the host memory to the network card memory based on the high-speed interconnect protocol.
[0076] Of course, the processor can also migrate raw business data from the host memory to the network card memory based on the Direct Memory Access Protocol (DMT).
[0077] S402. The network card device accesses the data to be sent in the network card memory based on the high-speed interconnection protocol, and performs network card service processing on the data to be sent to obtain the first data packet.
[0078] S403, the network card device sends the first data packet to the external device through the network.
[0079] In this embodiment, the process by which the network interface card (NIC) device accesses network service data in the NIC memory and performs NIC service processing and network transmission processing on the network service data may include steps S402 and S403. It is evident that since both the processor and the NIC device can directly access the NIC memory, the processor and the NIC device can take turns performing efficient data processing, thereby effectively improving the efficiency of downlink transmission.
[0080] Furthermore, for a better understanding of the downlink transmission process, please refer to... Figure 7 , Figure 7 This is a schematic diagram of a downlink transmission process provided in an embodiment of this application.
[0081] Based on the above embodiments, the uplink process for sending data from an external device to the processor via a network interface card (NIC) is described below. Therefore, this method may further include:
[0082] S501, The network interface card (NIC) device receives the second data packet sent by the external device.
[0083] S502, the network card device performs network card service processing on the second data packet to obtain the data to be received, and writes the data to be received into the network card memory based on the high-speed interconnection protocol.
[0084] In this embodiment, the steps of the network card device accessing network service data in the network card memory and performing network card service processing and network transmission processing on the network service data may include steps S501 and S502.
[0085] The S503 processor accesses the data to be received and network service programs in the network card memory based on the high-speed interconnect protocol, and performs service processing on the data to be received based on the network service programs.
[0086] In this embodiment, the process by which the processor accesses network service data and network service programs in the network card's memory, and performs service processing on the network service data based on the network service programs, may include S503. It is evident that since both the processor and the network card can directly access the network card's memory, the processor and the network card can take turns performing efficient data processing, thereby effectively improving the efficiency of uplink transmission.
[0087] Furthermore, considering that some applications on the host side may be located in the host memory, and these applications need to continue processing the business processing results of the received data, the processor can migrate them from the network card memory to the host memory.
[0088] Based on this, after the processor accesses the data to be received and the network service program in the network card memory based on the high-speed interconnect protocol, and performs service processing on the data to be received based on the network service program, it may further include:
[0089] Step 51: The processor migrates the service processing results corresponding to the data to be received in the network card memory to the host memory based on the high-speed interconnect protocol, so that the application in the host memory can process the service processing results.
[0090] Furthermore, for a better understanding of the downlink transmission process, please refer to... Figure 8 , Figure 8 This is a schematic diagram of an uplink transmission process provided in an embodiment of this application.
[0091] Based on the above embodiments, the method of setting network service programs in the network card memory is described below. The processor sets both network service data and network service programs in the network card memory, which may include:
[0092] S601. When the processor performs operating system initialization, it registers the physical address of the host memory and performs device scanning to initialize the network card device, and registers the physical address of the network card memory, so that both the host memory and the network card memory are incorporated into the operating system memory.
[0093] S602: The processor loads the network card driver into the network card memory and initializes the network protocol stack in the network card memory.
[0094] In this embodiment, to enable the network protocol stack and network card driver to be configured in the network card memory, this application has specifically adjusted the operating system initialization process. Please refer to... Figure 9 , Figure 9 This is a schematic diagram of an operating system initialization process provided in an embodiment of this application. Figure 9The left side shows the operating system boot process in related technologies. First, the host memory physical address is registered, and the operating system manages the host memory. Then, two processes run in parallel: initializing the network protocol stack and scanning and managing the network interface card (NIC). In related technologies, the operating system does not manage the NIC's memory, so the network protocol stack initialization occurs in the host memory. Figure 9 The right side shows the operating system startup process of this application. First, the operating system manages the host / network card memory. The registration of the physical address of the host / network card memory is carried out in parallel. The network card memory space is also within the management scope of the operating system, and the network card device itself can also directly access it. The operating system directly accesses the network card memory space through the high-speed interconnect protocol. The network protocol stack is initialized on the network card memory, that is, the network protocol stack runs directly on the network card memory, which accelerates the performance of the network card in operating network data.
[0095] Furthermore, after the operating system boots up, the processor can set the relevant application data in the network card memory when the application starts. However, considering the limited memory resources of the network card, setting all applications in the network card memory can easily affect the network card's operation. Therefore, this application can also set applications in the network card memory as needed, according to the application's requirements. Specifically, the application can call the interface based on the high-speed interconnect protocol to load the application and its data into the network card memory as needed.
[0096] Based on this, the processor stores both network service data and network service programs in the network card memory, which may include:
[0097] S603: When the processor performs application initialization, it calls an interface based on a high-speed interconnect protocol to load the application and application data into the network card memory.
[0098] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0099] Embodiments of this application also provide a non-volatile computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above data processing method embodiments when running.
[0100] In one exemplary embodiment, the aforementioned non-volatile computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0101] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above data processing method embodiments.
[0102] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above data processing method embodiments.
[0103] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0104] The data processing method, electronic device, program product, and storage medium provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. A data processing method, characterized in that, The method is applied to an electronic device, which includes a processor, host memory, and a network interface card (NIC), wherein the NIC has NIC memory, the host memory and the NIC memory are independent memory regions, and both the processor and the NIC directly access the NIC memory based on a high-speed interconnect protocol. The processor stores both network service data and network service programs in the network interface card (NIC) memory. The network service programs include an application program, a network protocol stack, and a NIC driver. The NIC memory is incorporated into the operating system memory, which is divided into a user-mode memory area and a kernel-mode memory area by the operating system. The application program is located in the user-mode memory area, while the network protocol stack and the NIC driver are located in the kernel-mode memory area. The processor accesses the network service data and network service program in the network card memory, and performs service processing on the network service data based on the network service program; The network interface card (NIC) device accesses the network service data in the NIC memory and performs NIC service processing and network transmission processing on the network service data; When the processor runs the application, it calls the network protocol stack in the kernel-mode memory area through the operating system interface based on the high-speed interconnect protocol. When the processor runs the network protocol stack, it responds to the application in the user-mode memory area through the operating system interface based on the high-speed interconnect protocol. Based on the network service program, the network service data is processed, including: The processor obtains first application data from the network card memory, and processes the first application data based on the application to obtain second application data; The processor obtains the first data to be transmitted from the network card memory, and processes the first data to be transmitted based on the network protocol stack to obtain the second data to be transmitted. The network service data is processed by the network interface card (NIC) for network services and then transmitted over the network, including: The network interface card (NIC) device obtains the second application data from the NIC memory, performs application processing on the second application data, and obtains the first data to be transmitted. The network interface card (NIC) device retrieves the second data to be transmitted from the NIC memory, performs communication calculations on the second data to be transmitted, and obtains a network data packet. The network interface card (NIC) device performs network transmission processing on the network data packets.
2. The data processing method according to claim 1, characterized in that, The processor stores both network service data and network service programs in the network card's memory, including: When the processor performs operating system initialization, it registers the physical address of the host memory, performs device scanning to initialize the network card device, and registers the physical address of the network card memory, so as to incorporate both the host memory and the network card memory into the operating system memory. The processor loads the network card driver into the network card memory and initializes the network protocol stack in the network card memory.
3. The data processing method according to claim 2, characterized in that, The processor stores both network service data and network service programs in the network card's memory, including: When the processor performs application initialization, it calls an interface based on the high-speed interconnect protocol to load the application and application data into the network card memory.
4. The data processing method according to claim 1, characterized in that, The network interface card (NIC) service processing includes application processing and communication computing processing.
5. The data processing method according to claim 1, characterized in that, The processor accesses the network service data and network service program in the network card's memory, and performs service processing on the network service data based on the network service program, including: The processor loads the network service data and the network service program from the network card memory into the processor cache based on the high-speed interconnection protocol; The processor performs service processing on the network service data in the processor cache based on the network service program in the processor cache, and updates the network card processor cache of the network card device based on the high-speed interconnection protocol after the network service data is updated; The network interface card (NIC) device accesses the network service data in the NIC's memory and performs NIC service processing and network transmission processing on the network service data, including: The network interface card (NIC) device loads the network service data from the NIC memory into the NIC processor cache based on the high-speed interconnection protocol; The processor performs network service processing on the network service data in the network card processor cache, and updates the processor cache based on the high-speed interconnect protocol after the network service data is updated.
6. The data processing method according to any one of claims 1 to 5, characterized in that, The processor accesses the network service data and network service program in the network card's memory, and performs service processing on the network service data based on the network service program, including: The processor accesses the raw service data and the network service program in the network card memory based on the high-speed interconnect protocol, and performs service processing on the raw service data based on the network service program to obtain the data to be sent; The network interface card (NIC) device accesses the network service data in the NIC's memory and performs NIC service processing and network transmission processing on the network service data, including: The network interface card (NIC) device accesses the data to be sent in the NIC memory based on the high-speed interconnection protocol, and performs NIC service processing on the data to be sent to obtain a first data packet; The network interface card (NIC) device sends the first data packet to an external device via the network.
7. The data processing method according to claim 6, characterized in that, Before the processor accesses the raw service data and the network service program in the network card memory based on the high-speed interconnect protocol, and performs service processing on the raw service data based on the network service program to obtain the data to be sent, the method further includes: The processor migrates the original service data in the host memory to the network card memory based on the high-speed interconnection protocol.
8. The data processing method according to claim 6, characterized in that, The network interface card (NIC) device accesses the network service data in the NIC's memory and performs NIC service processing and network transmission processing on the network service data, including: The network interface card (NIC) device receives a second data packet sent by an external device; The network interface card (NIC) device performs NIC service processing on the second data packet to obtain the data to be received, and writes the data to be received into the NIC memory based on the high-speed interconnect protocol; The processor accesses the network service data and network service program in the network card's memory, and performs service processing on the network service data based on the network service program, including: The processor accesses the data to be received and the network service program in the network card memory based on the high-speed interconnect protocol, and performs service processing on the data to be received based on the network service program.
9. The data processing method according to claim 8, characterized in that, After the processor accesses the data to be received and the network service program in the network card memory based on the high-speed interconnect protocol, and performs service processing on the data to be received based on the network service program, the method further includes: The processor migrates the service processing results corresponding to the data to be received in the network card memory to the host memory based on the high-speed interconnection protocol, so that the application in the host memory can process the service processing results.
10. An electronic device, characterized in that, It includes a processor, host memory, and a network interface card (NIC) device. The NIC device has NIC memory. The host memory and the NIC memory are independent memory regions. Both the processor and the NIC device directly access the NIC memory based on a high-speed interconnect protocol. The processor and network interface card (NIC) are used to perform the data processing method as described in any one of claims 1 to 9.
11. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the data processing method as described in any one of claims 1 to 9.
12. A non-volatile computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when loaded and executed by a processor, implement the data processing method as described in any one of claims 1 to 9.