Data configuration method and device, storage medium and electronic equipment

By monitoring the target field change events of the virtual network card and synchronizing the namespace configuration data to the configuration information of different communication modes, it solves the problem of inconsistent namespace configurations in container resources and achieves normal application of container resources and efficient data transmission.

CN118784484APending Publication Date: 2024-10-15LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410832389.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

When a container uses a virtual network card, the namespace configurations corresponding to different communication modes are inconsistent, resulting in abnormal application of container resources.

Method used

By monitoring the target field change events of the virtual network card, the namespace configuration data is synchronized to the configuration information of the container resources in the Ethernet communication mode and RDMA communication mode to ensure the consistency of the namespace configuration.

Benefits of technology

It solves the problem of inconsistent namespace configuration, improves the convenience and accuracy of container resource application, and ensures the normal operation of container resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784484A_ABST
    Figure CN118784484A_ABST
Patent Text Reader

Abstract

The invention discloses a data configuration method and device, a storage medium and electronic equipment. The method comprises the following steps: monitoring a target field of a virtual network card capable of realizing a remote direct memory access (RDMA) communication mode; under the condition that a change event of a target field of the virtual network card is detected, synchronizing configuration data of a namespace represented by the target field to configuration information of the container resource in the first communication mode and the second communication mode; wherein the target field is arranged in the configuration space of the virtual network card and is used for representing the identification information of the virtual network card in the independent namespace allocated by the container.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and more specifically to a data configuration method, device, storage medium and electronic device. Background Art

[0002] With the popularization of centralized storage, distributed storage, and cloud databases, more and more data needs to be obtained from the network for application services, which places higher and higher requirements on the exchange speed and performance of the network. For example, in the AI ​​(artificial intelligence) distributed training scenario, the workload generally runs in the container of each node, and the nodes communicate through RDMA (Remote Direct Memory Access), thereby meeting the high bandwidth and low latency requirements of AI distributed training tasks.

[0003] If data needs to be transmitted through RDMA communication, relevant configuration is required. How to accurately configure it to ensure the normal application of the corresponding container has become a problem that needs to be solved. Summary of the invention

[0004] In view of this, this application provides the following technical solutions:

[0005] A data configuration method, comprising:

[0006] Monitoring the target field of the virtual network card that can implement the remote direct memory access (RDMA) communication mode;

[0007] When a change event of the target field of the virtual network card is detected, synchronizing the configuration data of the namespace represented by the target field to the configuration information of the container resource in the first communication mode and the second communication mode;

[0008] The target field is set in the configuration space of the virtual network card and is used to represent the identification information of the independent namespace allocated to the container by the virtual network card.

[0009] Optionally, it also includes:

[0010] A virtual network card based on a physical network card of a host is configured, and a target field of the virtual network card is set and assigned an initial value when it is determined that the physical network card supports RDMA.

[0011] Optionally, it also includes:

[0012] When the target container application allocates a virtual network card to the container, obtain configuration information of an independent namespace corresponding to the container;

[0013] Based on the configuration information of the independent namespace, the initial value of the target field of the virtual network card is modified to the current value.

[0014] Optionally, the change event of the target field of the virtual network card includes: an initial value of the target field of the virtual network card changes to the current value;

[0015] Wherein, the method further comprises:

[0016] If it is detected that the namespace corresponding to the container changes, update the configuration information of the independent namespace;

[0017] Based on the updated configuration information of the independent namespace, update the current value of the target field of the virtual network card;

[0018] The target field is updated based on the updated current value of the target field.

[0019] Optionally, the first communication mode includes an Ethernet communication mode, the second communication mode includes an RDMA communication mode, and synchronizing the configuration data of the namespace represented by the target field to the configuration information of the container resource in the first communication mode and the second communication mode includes:

[0020] The configuration data of the namespace represented by the target field is synchronized to the kernel protocol stack corresponding to the Ethernet communication mode and the RDMA protocol stack corresponding to the RDMA communication mode; wherein the container application platform performs data transmission in the Ethernet communication mode based on the configuration information of the kernel protocol stack, and the container application platform performs data transmission in the RDMA communication mode based on the configuration information of the RDMA protocol stack.

[0021] Optionally, it also includes:

[0022] If the container application platform generates a resource call request, the resource call request is parsed to determine a target communication mode corresponding to the resource call request;

[0023] Based on the independent namespace corresponding to the target communication mode, obtaining target container resource information corresponding to the target communication mode;

[0024] The resource call request is responded to based on the target container resource information.

[0025] A data configuration device, comprising:

[0026] A monitoring unit, configured to monitor a target field of a virtual network card capable of implementing a remote direct memory access (RDMA) communication mode;

[0027] A synchronization unit, configured to synchronize the configuration data of the namespace represented by the target field to the configuration information of the container resource in the first communication mode and the second communication mode when a change event of the target field of the virtual network card is detected;

[0028] The target field is set in the configuration space of the virtual network card and is used to represent the identification information of the independent namespace allocated to the container by the virtual network card.

[0029] Optionally, it also includes:

[0030] The setting unit is used to configure a virtual network card based on a physical network card of a host, and when it is determined that the physical network card supports RDMA, a target field of the virtual network card is set and an initial value is assigned.

[0031] A storage medium stores a computer program thereon, wherein when the computer program is executed by a processor, the data configuration method described in any one of the above is implemented.

[0032] An electronic device may include:

[0033] A memory, used to store applications and data generated by the operation of the applications;

[0034] A processor is used to execute the application program to implement the data configuration method as described in any one of the above. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0036] Figure 1 A flowchart of a data configuration method provided in an embodiment of the present application;

[0037] Figure 2 An application scenario diagram of AI distributed training provided in an embodiment of the present application;

[0038] Figure 3 A schematic diagram of a synchronization configuration process provided in an embodiment of the present application;

[0039] Figure 4 A schematic diagram of the structure of a data configuration device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0041] The terms "first" and "second" etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0042] A data configuration method provided in an embodiment of the present application is applied to the field of virtual machine containers. By synchronizing the configuration data of the namespace of the virtual network card to the configuration information of the container resources in different communication modes, the problem of inconsistent namespace configuration of the virtual network card corresponding to different communication modes when the container uses the virtual network card is solved, thereby ensuring the normal application of the container resources.

[0043] In order to facilitate the description of the data configuration method provided in the embodiment of the present application, the relevant terms applied in the present application are now explained.

[0044] Kubernetes, or K8s for short, is an abbreviation that uses the number 8 to replace the eight characters in the middle of the name, "ubernete". Kubernetes is an open source platform for managing containerized applications on multiple hosts in a cloud platform. The goal of Kubernetes is to make the deployment of containerized applications simple and efficient. Kubernetes provides mechanisms for application deployment, planning, updating, and maintenance. Kubernetes implements application deployment on a cloud platform by creating containers. Each container is isolated from each other and has its own file system. The processes between containers do not affect each other, and computing resources can be distinguished. Compared with virtual machines, containers can be deployed quickly.

[0045] Kubernetes is a container-based cluster management platform used to manage containerized applications on multiple hosts in the platform. Containers are used to carry software programs. Correspondingly, Pods are the basic operating units of Kubernetes and the smallest deployment unit that can be created, debugged, and managed. Multiple containers in the same container group can share network resources (such as IP addresses), and each container group can encapsulate one or more containers.

[0046] Namespaces are used to implement network isolation. Namespaces can divide the use of network devices, addresses, ports, routes, firewall rules, etc. into different boxes to virtualize the network in a single running kernel instance. In addition, multiple objects in the same namespace can share network resources. For example, multiple containers deployed in a container group are in the same namespace, so that multiple containers in the same container group can share network resources.

[0047] RDMA (Remote Direct Memory Access) is a remote direct memory access technology. As a high-throughput, low-latency network communication that does not require the intervention of the operating systems of the communicating parties, it has been applied in more and more scenarios.

[0048] See also Figure 1 , is a flow chart of a data configuration method provided in an embodiment of the present application, the method may include the following steps:

[0049] S101. Monitor a target field of a virtual network card that can implement a remote direct memory access (RDMA) communication mode.

[0050] When creating a container on a host, a virtual network card corresponding to the container can be generated based on the physical network card of the host. In an embodiment of the present application, the virtual network card can implement remote direct memory access RDMA communication mode. In the PCI configuration space of the virtual network card that supports the RDMA feature, a target field is added for each virtual network card. The target field is used to characterize the identification information of the independent namespace allocated to the virtual network card in the container. The specific information of the namespace allocated to the virtual network card in the container can be obtained through the target field. For example, when the target field is 1, the corresponding independent namespace is Namespace1. The target field can be monitored to determine whether the independent namespace allocated to the virtual network card in the container has changed, such as adding an independent namespace, deleting the previous independent namespace, or adjusting the namespace.

[0051] S102: When a change event of a target field of the virtual network card is detected, synchronize the configuration data of the namespace represented by the target field to the configuration information of the container resource in the first communication mode and the second communication mode.

[0052] In the process of monitoring the target field, if a change event of the target field is detected, synchronization processing under different communication modes needs to be performed. Among them, the change event of the target field may refer to the identification information of the namespace represented by the current target field being different from the identification information of the namespace in the previous monitoring cycle; it may also be that the current identification information of the namespace represented by the target field is different from the initial identification information of the naming control. After detecting the change event of the target field, the configuration data of the namespace represented by the target field is synchronized to the configuration information of the container resource in the first communication mode and the second communication mode. The first communication mode and the second communication mode are two different communication modes, such as the first communication mode is an Ethernet communication mode, and the second communication mode can be an RDMA communication mode. The configuration data of the independent namespace of the virtual network card is synchronized for the two communication modes to facilitate the use of the virtual network card by the container.

[0053] For example, when an application based on remote direct memory access (RDMA) is deployed on a virtualization platform such as k8s, the platform will start a network namespace corresponding to a container, in which to start the RDMA application, and the RDMA network card will use the RDMA physical network card (PF, Physical function) on the physical server to virtualize the corresponding virtual network card (VF, Virtual function) to achieve the virtualization of the RDMA network card. However, the kernel stack and the RDMA software stack generate Ethernet and RDMA networks respectively when processing the virtual network card. Therefore, when the container uses the virtual network card VF, it is necessary to set the Ethernet namespace and the RDMA namespace respectively. Through the monitoring of the target field of the virtual network card by this application, after detecting the change event of the target field, the configuration data of the namespace represented by the target field is synchronized to the configuration information of the container resources in these two network communication modes, which solves the problem of missing or inconsistent configuration when configuring the namespace, thereby facilitating the calling of container resources.

[0054] In one implementation of the embodiment of the present application, in order to facilitate the synchronization of the configuration information of the namespace, the target field can be pre-set to monitor the target field and synchronize the information based on the detected changes. Specifically, the virtual network card configured in the physical network card of the host sets the target field of the virtual network card when it is determined that the physical network card supports RDMA, and assigns an initial value. In this implementation, when the physical network card supports RDMA, the virtual network card generated based on the physical network card also supports RDMA, and the corresponding target field is also set when the virtual network card is generated, so as to facilitate the subsequent monitoring of the identification information of the namespace. Specifically, when the software configures the container to use VF (virtual network card), it directly calls the network card driver and configures the target field in the configuration space of the VF, such as represented by the nsid field, and the initial value is usually 0. Since the target field is only configured in the corresponding virtual network card when the physical network card supports RDMA, it can be determined whether the virtual network card supports RDMA by detecting whether the target field exists in the configuration information of the virtual network card. This can omit the detection process of the software when configuring the container virtual network card VF, that is, there is no need to check whether the virtual network card supports RDMA and whether the system has installed RDMA-related software stacks, thereby improving the efficiency of data applications.

[0055] Furthermore, the method further comprises:

[0056] When the target container application allocates a virtual network card to the container, configuration information of an independent namespace corresponding to the container is obtained; based on the configuration information of the independent namespace, an initial value of a target field of the virtual network card is modified to a current value.

[0057] In the PCI (standard for defining local buses) configuration space of the network card that supports RDMA, a target field is added to each virtual network card VF. When the physical network card PF is initialized to generate the virtual network card VF, the initial value of the target field (such as nsid) of each virtual network card is 0. When the kernel protocol stack and the RDMA protocol stack initialize the virtual network card VF to generate the corresponding Ethernet network structure (represented by net_device) and the RDMA network structure (represented by ibv_device), they still follow the normal initialization process. During initialization, the networknamespace (network namespace) of each virtual network card VF is 0. When the target container application (such as K8s and the corresponding CNI) allocates a virtual network card VF to a container, if the container uses its own independent network namespace, the CNI (container network interface) calls the network card driver to set the target field (such as nsid) in the VFPCI configuration space to the current value, that is, to the identification information of the container's namespace (such as namespace id).

[0058] Correspondingly, the detected change event of the target field of the virtual network card includes: the initial value of the target field of the virtual network card changes to the current value. The method further includes:

[0059] If a change is detected in the namespace corresponding to the container, the configuration information of the independent namespace is updated; based on the updated configuration information of the independent namespace, the current value of the target field of the virtual network card is updated; based on the updated current value of the target field, the target field is updated.

[0060] In the application process, in order to isolate different types of resources, different types of namespaces are implemented in the Linux kernel, such as process namespace, network namespace, mount namespace, and user namespace. Taking the network namespace as an example, this namespace isolates network resources, including network interfaces, IP addresses, routing tables, etc. Each container usually has its own network namespace, which enables it to run its own network stack and be isolated from other containers. When it is detected that the isolated resources corresponding to the namespace have changed, or the related information included therein has changed, it can be determined that the namespace has changed, and the configuration information of the independent namespace can be updated accordingly. If the updated configuration information affects the value corresponding to the target field, the current value of the target field of the virtual network card will be updated synchronously.

[0061] When the first communication mode includes an Ethernet communication mode and the second communication mode includes an RDMA communication mode, synchronizing the configuration data of the namespace represented by the target field to the configuration information of the container resource in the first communication mode and the second communication mode includes:

[0062] The configuration data of the namespace represented by the target field is synchronized to the kernel protocol stack corresponding to the Ethernet communication mode and the RDMA protocol stack corresponding to the RDMA communication mode; wherein the container application platform performs data transmission in the Ethernet communication mode based on the configuration information of the kernel protocol stack, and the container application platform performs data transmission in the RDMA communication mode based on the configuration information of the RDMA protocol stack.

[0063] Furthermore, the method further comprises:

[0064] If the container application platform generates a resource call request, the resource call request is parsed to determine the target communication mode corresponding to the resource call request; based on the independent namespace corresponding to the target communication mode, the target container resource information corresponding to the target communication mode is obtained; and the resource call request is responded to based on the target container resource information.

[0065] The container application platform can be a container application software, such as an AI (artificial intelligence) application. When it generates a resource call request, it needs to parse and obtain the corresponding data transmission communication mode. If the RDMA communication mode is adopted, the communication mode is determined as the target communication mode, and the corresponding namespace is obtained, such as the network namespace. The network interface, IP address and other information included in the network namespace are cleared to establish a copper wire connection of the RDMA communication mode, thereby obtaining the corresponding container resource information in the container.

[0066] In an embodiment of the present application, by monitoring the target field and completing the synchronization of configuration information, the configuration information of the namespace represented by the target field in the network card PCI configuration space can be synchronized to the kernel protocol stack and the RDMA protocol stack in real time, and there will be no configuration errors or mismatches on both sides, thereby improving the convenience and accuracy of container resource application.

[0067] The following uses the application scenario of AI (artificial intelligence) distributed training as an example to illustrate the data configuration method of the embodiment of the present application. Figure 2 In the AI ​​distributed training scenario, the workload generally runs in the container of each node. The node uses RDMA VF to perform high-performance RDMA communication to meet the high bandwidth and low latency requirements of AI distributed training tasks. When the container needs to use the virtual network card VF, it is necessary to set the namespace of net_device (Ethernet network) and ibv_device (RDMA network), and ensure the consistency of the configuration of the two.

[0068] exist Figure 2 In the , AI distributed training tasks include n tasks, each task runs in the container of each node. When the container needs to use the virtual network card VF, it will be implemented through the namespace corresponding to the VF. Different specific tasks correspond to different VFs and different namespaces. For example, AI distributed training task 1 corresponds to VF1, and the corresponding namespace is Namespace1; AI distributed training task 2 corresponds to VF2, and the corresponding namespace is Namespace2; AI distributed training task 3 corresponds to VF3, and the corresponding namespace is Namespace3; AI distributed training task n corresponds to VFn, and the corresponding namespace is Namespace n. Each VF has a corresponding target field, which represents the identification information of the namespace. Figure 2 It is represented by Nsid, for example, the target field corresponding to VF1 is Nisd1, and the target field corresponding to VFn is Nisdn.

[0069] By adding a synchronization module on the host ( Figure 2 The SyncNS module shown in the figure detects the change event of the Nsid field in the VF configuration space. When a change occurs, the Nsid value is synchronized to the Ibv_device and Net_device structures. In this way, from the perspective of the kernel protocol stack and the rdma protocol stack, the VF device is transferred to the container's namespace. Among them, the Net_device structure is a structure that stores network device information in the Linux kernel protocol stack; the Ibv_device structure is an rdma-related software stack (abbreviated as RDMA stack).

[0070] For details, see Figure 3 , which is a flowchart of a synchronization configuration provided in an embodiment of the present application.

[0071] In the PCI configuration space of the network card that supports RDMA, a target field nsid is added for each virtual network card VF. When the physical network card PF initializes and generates VF, the initial value of nsid of each VF is 0.

[0072] The kernel protocol stack and RDMA protocol stack initialize VF to generate corresponding structures, such as net_device / ibv_device, and initialize according to the normal process. During initialization, the network namespace of each VF is 0.

[0073] When software (such as K8s and the corresponding CNI) assigns a VF to a container, if the container uses its own independent network namespace, the CNI (container network interface) calls the NIC driver and sets the nsid in the VFPCI (virtual network card interface) configuration space to the namespace id of the container.

[0074] A new SyncNS module is added on the host. This module monitors the change events of the nsid field in the VFPCI configuration space. When a change occurs, the nsid value is synchronized to the ibv_device and net_device structures. In this way, from the perspective of the kernel protocol stack and the rdma protocol stack, the VF device is transferred to the container's namespace.

[0075] In the embodiment of this application scenario, in the PCI configuration space of the network card that supports the RDMA feature, an nsid field (namespace identification field) is added for each VF. When the software configures the container to use VF (virtual network card), it directly calls the network card driver and configures the nsid field in the configuration space of the VF. A synchronization module is added to the host to monitor the event notification of the PCI configuration space, and synchronize the nsid field in the PCI configuration space to the configuration of the net_device / ibv_device structure when it changes. Through this solution, the software's inspection and processing when configuring the container VF is omitted, and there is no need to detect whether the network card supports RDMA and whether the system has installed RDMA-related software stacks; through the synchronization module, the nsid field in the network card PCI configuration space is synchronized to the kernel protocol stack and the RDMA protocol stack in real time, and there will be no configuration missing or mismatch between the two sides.

[0076] See also Figure 4 In another embodiment of the present application, a data configuration device is provided, the device comprising:

[0077] A monitoring unit 201 is used to monitor a target field of a virtual network card capable of implementing a remote direct memory access (RDMA) communication mode;

[0078] A synchronization unit 202, configured to synchronize the configuration data of the namespace represented by the target field to the configuration information of the container resource in the first communication mode and the second communication mode when a change event of the target field of the virtual network card is detected;

[0079] The target field is set in the configuration space of the virtual network card and is used to represent the identification information of the independent namespace allocated to the container by the virtual network card.

[0080] Optionally, it also includes:

[0081] The setting unit is used to configure a virtual network card based on a physical network card of a host, and when it is determined that the physical network card supports RDMA, a target field of the virtual network card is set and an initial value is assigned.

[0082] Optionally, the device further comprises:

[0083] A first acquisition unit is used to obtain configuration information of an independent namespace corresponding to the container when the target container application allocates a virtual network card to the container;

[0084] A modification unit is used to modify the initial value of the target field of the virtual network card to the current value based on the configuration information of the independent namespace.

[0085] Optionally, the change event of the target field of the virtual network card includes: an initial value of the target field of the virtual network card changes to the current value;

[0086] Wherein, the device further comprises:

[0087] A first updating unit, configured to update configuration information of the independent namespace if a change is detected in the namespace corresponding to the container;

[0088] A second updating unit, configured to update a current value of a target field of the virtual network card based on the updated configuration information of the independent namespace;

[0089] The third updating unit is used to update the target field based on the updated current value of the target field.

[0090] Optionally, the first communication mode includes an Ethernet communication mode, the second communication mode includes an RDMA communication mode, and the synchronization unit is configured to:

[0091] The configuration data of the namespace represented by the target field is synchronized to the kernel protocol stack corresponding to the Ethernet communication mode and the RDMA protocol stack corresponding to the RDMA communication mode; wherein the container application platform performs data transmission in the Ethernet communication mode based on the configuration information of the kernel protocol stack, and the container application platform performs data transmission in the RDMA communication mode based on the configuration information of the RDMA protocol stack.

[0092] Optionally, the device further comprises:

[0093] A parsing unit, configured to parse a resource call request if the container application platform generates the resource call request, and determine a target communication mode corresponding to the resource call request;

[0094] A second acquisition unit, configured to obtain target container resource information corresponding to the target communication mode based on an independent namespace corresponding to the target communication mode;

[0095] A responding unit is used to respond to the resource calling request based on the target container resource information.

[0096] It should be noted that the specific implementation of each unit and sub-unit in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.

[0097] In another embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the data configuration method as described in any one of the above items is implemented.

[0098] In another embodiment of the present application, an electronic device is further provided, and the electronic device may include:

[0099] A memory, used to store applications and data generated by the operation of the applications;

[0100] A processor, configured to execute the application program to implement:

[0101] A data configuration method, comprising:

[0102] Monitoring the target field of the virtual network card that can implement the remote direct memory access (RDMA) communication mode;

[0103] When a change event of the target field of the virtual network card is detected, synchronizing the configuration data of the namespace represented by the target field to the configuration information of the container resource in the first communication mode and the second communication mode;

[0104] The target field is set in the configuration space of the virtual network card and is used to represent the identification information of the independent namespace allocated to the container by the virtual network card.

[0105] Optionally, it also includes:

[0106] A virtual network card based on a physical network card of a host is configured, and a target field of the virtual network card is set and assigned an initial value when it is determined that the physical network card supports RDMA.

[0107] Optionally, it also includes:

[0108] When the target container application allocates a virtual network card to the container, obtain configuration information of an independent namespace corresponding to the container;

[0109] Based on the configuration information of the independent namespace, the initial value of the target field of the virtual network card is modified to the current value.

[0110] Optionally, the change event of the target field of the virtual network card includes: an initial value of the target field of the virtual network card changes to the current value;

[0111] Wherein, the method further comprises:

[0112] If it is detected that the namespace corresponding to the container changes, update the configuration information of the independent namespace;

[0113] Based on the updated configuration information of the independent namespace, update the current value of the target field of the virtual network card;

[0114] The target field is updated based on the updated current value of the target field.

[0115] Optionally, the first communication mode includes an Ethernet communication mode, the second communication mode includes an RDMA communication mode, and synchronizing the configuration data of the namespace represented by the target field to the configuration information of the container resource in the first communication mode and the second communication mode includes:

[0116] The configuration data of the namespace represented by the target field is synchronized to the kernel protocol stack corresponding to the Ethernet communication mode and the RDMA protocol stack corresponding to the RDMA communication mode; wherein the container application platform performs data transmission in the Ethernet communication mode based on the configuration information of the kernel protocol stack, and the container application platform performs data transmission in the RDMA communication mode based on the configuration information of the RDMA protocol stack.

[0117] Optionally, it also includes:

[0118] If the container application platform generates a resource call request, the resource call request is parsed to determine a target communication mode corresponding to the resource call request;

[0119] Based on the independent namespace corresponding to the target communication mode, obtaining target container resource information corresponding to the target communication mode;

[0120] The resource call request is responded to based on the target container resource information.

[0121] It should be noted that the specific implementation of the processor in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.

[0122] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0123] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0124] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0125] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data configuration method, comprising: Monitoring the target field of the virtual network card that can implement the remote direct memory access (RDMA) communication mode; When a change event of the target field of the virtual network card is detected, synchronizing the configuration data of the namespace represented by the target field to the configuration information of the container resource in the first communication mode and the second communication mode; The target field is set in the configuration space of the virtual network card and is used to represent the identification information of the independent namespace allocated to the container by the virtual network card.

2. The method according to claim 1, further comprising: A virtual network card based on a physical network card of a host is configured, and a target field of the virtual network card is set and assigned an initial value when it is determined that the physical network card supports RDMA.

3. The method according to claim 2, further comprising: When the target container application allocates a virtual network card to the container, obtain configuration information of an independent namespace corresponding to the container; Based on the configuration information of the independent namespace, the initial value of the target field of the virtual network card is modified to the current value.

4. According to the method of claim 3, the change event of the target field of the virtual network card comprises: The initial value of the target field of the virtual network card is changed to the current value; Wherein, the method further comprises: If it is detected that the namespace corresponding to the container changes, update the configuration information of the independent namespace; Based on the updated configuration information of the independent namespace, update the current value of the target field of the virtual network card; The target field is updated based on the updated current value of the target field.

5. The method according to claim 1, wherein the first communication mode comprises an Ethernet communication mode, the second communication mode comprises an RDMA communication mode, and the step of synchronizing the configuration data of the namespace represented by the target field to the configuration information of the container resource in the first communication mode and the second communication mode comprises: The configuration data of the namespace represented by the target field is synchronized to the kernel protocol stack corresponding to the Ethernet communication mode and the RDMA protocol stack corresponding to the RDMA communication mode; wherein the container application platform performs data transmission in the Ethernet communication mode based on the configuration information of the kernel protocol stack, and the container application platform performs data transmission in the RDMA communication mode based on the configuration information of the RDMA protocol stack.

6. The method according to claim 5, further comprising: If the container application platform generates a resource call request, the resource call request is parsed to determine a target communication mode corresponding to the resource call request; Based on the independent namespace corresponding to the target communication mode, obtaining target container resource information corresponding to the target communication mode; The resource call request is responded to based on the target container resource information.

7. A data configuration device, comprising: A monitoring unit, configured to monitor a target field of a virtual network card capable of implementing a remote direct memory access (RDMA) communication mode; A synchronization unit, configured to synchronize the configuration data of the namespace represented by the target field to the configuration information of the container resource in the first communication mode and the second communication mode when a change event of the target field of the virtual network card is detected; The target field is set in the configuration space of the virtual network card and is used to represent the identification information of the independent namespace allocated to the container by the virtual network card.

8. The data configuration device according to claim 7, further comprising: The setting unit is used to configure a virtual network card based on a physical network card of a host, and when it is determined that the physical network card supports RDMA, a target field of the virtual network card is set and an initial value is assigned.

9. A storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the data configuration method according to any one of claims 1 to 6 is implemented.

10. An electronic device, the electronic device may include: A memory, used to store applications and data generated by the operation of the applications; A processor, configured to execute the application program to implement the data configuration method according to any one of claims 1 to 6.