Method and device for dynamically configuring partition key, computer equipment and readable storage medium

By dynamically configuring partition keys, and utilizing the Kubernetes platform and UFM network management platform, the partition keys of IB network interface card (NIC) nodes are dynamically managed, solving the security problem of multi-tenant isolation of IB NICs and improving management efficiency and security.

CN121619224APending Publication Date: 2026-03-06CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511770630.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

In existing technologies, multi-tenant isolation of IB network cards has security issues. The UFM network management platform cannot dynamically divide partition key subnets, causing users to spend a lot of time and effort on static configuration.

Method used

By employing a dynamic partition key configuration method, and by deploying server and client components, the partition keys of network interface nodes are dynamically managed using the Kubernetes platform and the UFM network management platform, enabling partition key updates triggered by container group creation and deletion events.

Benefits of technology

It achieves multi-tenant isolation for IB network cards, reducing the time and effort users spend configuring partition keys and improving the security and management efficiency of IB network cards in multi-tenant environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121619224A_ABST
    Figure CN121619224A_ABST
Patent Text Reader

Abstract

The invention relates to a method and device for dynamically configuring partition keys, computer equipment, a readable storage medium and a program product. The method comprises the following steps: deploying a server component by using a first resource object, and deploying a client component at a network card node by using a second resource object; initializing a configuration management resource device; creating a resource object, and writing the resource object into a configuration management resource device by adopting a mapping relation among a server component service name, a container group managed by the resource object and a partition key; acquiring a mapping relationship from the configuration management resource device by adopting a client component; the client component writes the partition key corresponding to the created container group into the network card on the basis of the mapping relationship under the condition that the creation of the resource object triggers the container group creation event; deleting the partition keys corresponding to the deleted container groups on the network card under the condition that the container group deletion event is triggered; the partition keys stored in the network card are used for eliminating isolation between the container groups managed by the resource objects. By adopting the method, the dynamic configuration of the partition key is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular to a method, apparatus, computer device, computer-readable storage medium, and computer program product for dynamically configuring partition keys. Background Technology

[0002] In the context of AI-powered computing, computing servers equipped with IB network cards have become a standard configuration. However, since IB network cards in the entire computing cluster can access each other by default, there are security issues with IB network cards in terms of multi-tenant isolation.

[0003] In traditional technologies, the UFM (Unified Fabric Manager) network management platform has been developed to achieve multi-tenant isolation. However, the UFM network management platform lacks flexibility in partition key (P_key) subnet management. In terms of planning P_key subnets, it can only allocate P_keys in a pre-defined static way, and cannot automatically and dynamically allocate P_key subnets as needed. Users need to spend a lot of time and effort configuring P_keys according to the network cards used by the services.

[0004] Therefore, a dynamic configuration method for P_key is needed to solve the multi-tenancy security problem of IB network cards. Summary of the Invention

[0005] Therefore, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product that can achieve multi-tenant isolation of IB network cards by providing a dynamic configuration partition key.

[0006] Firstly, this application provides a method for dynamically configuring partition keys, including:

[0007] Deploy a preset number of server components using the first resource object, and deploy client components using the second resource object on the network interface node;

[0008] Initialize and configure the resource manager;

[0009] Create resource objects and use server components to write the mapping relationship between the service name of the resource object, the container group managed by the resource object, and the partition key into the configuration management resource controller;

[0010] The mapping relationship is obtained from the configuration management resource using a client component;

[0011] Based on the mapping relationship, when the creation of a resource object triggers a container group creation event, a client component writes the partition key corresponding to the created container group to the network interface card (NIC). When the creation of a resource object triggers a container group deletion event, a client component deletes the partition key corresponding to the deleted container group on the NIC. The partition key stored on the NIC node is used to eliminate the isolation between container groups managed by the resource object.

[0012] In one embodiment, deploying a preset number of server components using a first resource object further includes:

[0013] A competitive process is used to select a master server component from a preset number of server components for operation, while the remaining server components are used as backups.

[0014] In one embodiment, a client component is used to obtain the mapping relationship from the configuration management resourcer, including:

[0015] The client component uses a polling method to obtain the mapping relationship from the configuration management resource.

[0016] In one embodiment, based on the mapping relationship, when the creation of a resource object triggers a container group creation event, the partition key corresponding to the container group created by the client component is written to the network interface node, including:

[0017] When the creation of a resource object triggers a container group creation event, the client component is notified via a callback to parse the network interface information corresponding to the created container group.

[0018] Based on the network interface card (NIC) information and mapping relationship, a client component is used to write the partition key corresponding to the created container group into the NIC.

[0019] In one embodiment, the method further includes:

[0020] To delete a resource object, the server component deletes the mapping relationship between the service name of the resource object and the configuration management resource in the resource manager.

[0021] The partition key in the network interface card of the container group running the resource object is deleted using a client component.

[0022] In one embodiment, deleting the partition key in the network interface node corresponding to the service name of the resource object using a client component further includes:

[0023] The client component uses a polling method to check the service name of the container group running on the network interface node and the configuration of the partition key in the network interface of the network interface node.

[0024] Secondly, this application also provides a dynamically configurable partition key device, comprising:

[0025] The deployment module is used to deploy a preset number of server components using a first resource object, and to deploy client components on the network interface node using a second resource object.

[0026] The initial module is used to initialize the configuration management resource generator;

[0027] The write module is used to create resource objects. It uses server components to write the mapping relationship between the service name of the resource object, the container group managed by the resource object, and the partition key into the configuration management resource controller.

[0028] The acquisition module is used to retrieve mapping relationships from the configuration management resourcer using client components;

[0029] The configuration module is used to write the partition key corresponding to the created container group to the network interface card (NIC) based on the mapping relationship when the creation of a resource object triggers a container group creation event; and to delete the partition key corresponding to the deleted container group on the NIC from the NIC when the creation of a resource object triggers a container group deletion event. The partition key stored in the NIC node is used to eliminate the isolation between container groups managed by the resource object.

[0030] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0031] Deploy a preset number of server components using the first resource object, and deploy client components using the second resource object on the network interface node;

[0032] Initialize and configure the resource manager;

[0033] Create resource objects and use server components to write the mapping relationship between the service name of the resource object, the container group managed by the resource object, and the partition key into the configuration management resource controller;

[0034] The mapping relationship is obtained from the configuration management resource using a client component;

[0035] Based on the mapping relationship, when the creation of a resource object triggers a container group creation event, a client component writes the partition key corresponding to the created container group to the network interface card (NIC). When the creation of a resource object triggers a container group deletion event, a client component deletes the partition key corresponding to the deleted container group on the NIC. The partition key stored on the NIC node is used to eliminate the isolation between container groups managed by the resource object.

[0036] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0037] Deploy a preset number of server components using the first resource object, and deploy client components using the second resource object on the network interface node;

[0038] Initialize and configure the resource manager;

[0039] Create resource objects and use server components to write the mapping relationship between the service name of the resource object, the container group managed by the resource object, and the partition key into the configuration management resource controller;

[0040] The mapping relationship is obtained from the configuration management resource using a client component;

[0041] Based on the mapping relationship, when the creation of a resource object triggers a container group creation event, a client component writes the partition key corresponding to the created container group to the network interface card (NIC). When the creation of a resource object triggers a container group deletion event, a client component deletes the partition key corresponding to the deleted container group on the NIC. The partition key stored on the NIC node is used to eliminate the isolation between container groups managed by the resource object.

[0042] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0043] Deploy a preset number of server components using the first resource object, and deploy client components using the second resource object on the network interface node;

[0044] Initialize and configure the resource manager;

[0045] Create resource objects and use server components to write the mapping relationship between the service name of the resource object, the container group managed by the resource object, and the partition key into the configuration management resource controller;

[0046] The mapping relationship is obtained from the configuration management resource using a client component;

[0047] Based on the mapping relationship, when the creation of a resource object triggers a container group creation event, a client component writes the partition key corresponding to the created container group to the network interface card (NIC). When the creation of a resource object triggers a container group deletion event, a client component deletes the partition key corresponding to the deleted container group on the NIC. The partition key stored on the NIC node is used to eliminate the isolation between container groups managed by the resource object.

[0048] The aforementioned method, apparatus, computer device, computer-readable storage medium, and computer program product for dynamically configuring partition keys utilize a first resource object to deploy a preset number of server components and a second resource object to deploy client components on the network interface card (NIC) node. The process involves initializing a configuration management resource; creating a resource object, whereby the server components write the mapping relationship between the service name of the created resource object, the container group managed by the resource object, and the partition key into the configuration management resource; retrieving the mapping relationship from the configuration management resource using the client components; based on the mapping relationship, when the creation of a resource object triggers a container group creation event, the client components write the partition key corresponding to the created container group into the NIC; and when the creation of a resource object triggers a container group deletion event, the client components delete the partition key corresponding to the deleted container group on the NIC. The partition key stored on the NIC node is used to eliminate isolation between container groups managed by the resource object. This method enables multi-tenant isolation of IB NICs, reducing the time and effort users spend configuring partition keys based on the NIC used for a service, and improving the security and management efficiency of IB NICs in a multi-tenant environment. Attached Figure Description

[0049] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0050] Figure 1 This is a diagram illustrating the application environment of a method for dynamically configuring partition keys in one embodiment.

[0051] Figure 2 This is a flowchart illustrating a method for dynamically configuring partition keys in one embodiment;

[0052] Figure 3 This is a flowchart illustrating the method for dynamically configuring partition keys in another embodiment;

[0053] Figure 4 This is a schematic diagram illustrating the use of various components to implement dynamically configured partition keys in one embodiment;

[0054] Figure 5 This is a structural block diagram of a dynamically configured partition key device in one embodiment;

[0055] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0057] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0058] The dynamic configuration partition key method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Specifically, terminal 102 or server 104 implements a dynamic configuration partition key method, which includes: deploying a preset number of server components using a first resource object, and deploying client components on the network interface card (NIC) node using a second resource object; initializing the configuration management resource; creating a resource object, and using the server components to write the mapping relationship between the service name of the created resource object, the container group managed by the resource object, and the partition key into the configuration management resource; using the client components to obtain the mapping relationship from the configuration management resource; based on the mapping relationship, when the creation of a resource object triggers a container group creation event, using the client components to write the partition key corresponding to the created container group into the NIC; when the creation of a resource object triggers a container group deletion event, using the client components to delete the partition key corresponding to the deleted container group on the NIC; the partition key stored on the NIC node is used to eliminate isolation between container groups managed by the resource object.

[0059] Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, and projection equipment. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted displays. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, and smart glasses. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0060] In one exemplary embodiment, such as Figure 2 As shown, a method for dynamically configuring partition keys is provided, which can be applied to... Figure 1 Taking terminal 102 as an example, the explanation includes the following steps 202 to 210. Wherein:

[0061] Step 202: Deploy a preset number of server components using the first resource object, and deploy client components on the network interface node using the second resource object.

[0062] The network interface card (NIC) refers to the InfiniBand (IB) NIC, a high-performance computing network communication interface for HPC / AI, characterized by extremely high throughput and extremely low latency. The first resource object refers to the Deployment resource object in the Kubernetes platform; the second resource object refers to the DaemonSet resource object in the Kubernetes platform. The server component (IB-Controller-Server) is an instance of the InfiniBand control service; the client component (IB-Controller-Agent) is also an InfiniBand control service instance, only responding to pod creation and container deletion events on its host node. Each NIC node can run at least one pod.

[0063] Specifically, the dynamic partition key configuration method is implemented using the UFM network management platform in conjunction with the Kubernetes (k8s) platform. The k8s platform is an open-source container cluster orchestration system that enables automated deployment, scaling, and maintenance of container clusters. In Kubernetes, a Deployment describes the deployment of an application, manages the number of Pod replicas, and handles rolling updates. A Pod is the smallest deployable unit in Kubernetes, representing one or more tightly coupled containers. A DaemonSet ensures that a user-defined Pod replica runs on every node in the cluster (or on nodes meeting specific conditions) within the Kubernetes cluster.

[0064] For example, in a Kubernetes cluster, a pre-defined number of server components are deployed using Deployment, while a client component is deployed on each IB node using DaemonSet.

[0065] Step 204: Initialize the configuration management resource generator.

[0066] The configuration management resource is a globally accessible resource object named ConfigMap, used to record the mapping relationship between the service name that created the resource object, the container group managed by the resource object, and the partition key. Specifically, in Kubernetes, ConfigMap is used to separate non-confidential configuration data (such as configuration files and environment variables) from Pods, allowing configuration to be managed independently.

[0067] Optionally, the server component can add, delete, modify, and query configuration management resources; the client component can periodically read the configuration management resources and set the configuration information on the specific IB network interface card.

[0068] Step 206: Create a resource object. Use the server component to write the mapping relationship between the service name of the resource object, the container group managed by the resource object, and the partition key into the configuration management resource controller.

[0069] In Kubernetes, a resource object is an abstract entity used to represent various resources. The service name used to create a resource object is the name created in Kubernetes to access a Pod managed by a resource object (such as a Deployment or StatefulSet). Each port in InfiniBand has a partition key (P_key) table. Partition keys define network partitions, and only nodes or ports with the same partition key can communicate with each other. By configuring the P_key table on each network interface node, each Pod can be assigned at least one P_key, thereby controlling network connectivity between Pods.

[0070] For example, when creating a resource object, based on the P_key rule, the server component writes the mapping relationship between the service name for creating the resource object, the container group managed by the resource object, and the partition key into the configuration management resource.

[0071] Step 208: Use the client component to obtain the mapping relationship from the configuration management resource.

[0072] For example, a client component obtains the mapping relationship from the configuration management resource. Based on the mapping relationship, the client component obtains the service name and its corresponding partition key running on the container group of its network interface node.

[0073] Step 210: Based on the mapping relationship, when the creation of a resource object triggers a container group creation event, the client component writes the partition key corresponding to the created container group to the network interface card (NIC); when the creation of a resource object triggers a container group deletion event, the client component deletes the partition key corresponding to the deleted container group on the NIC; the partition key stored in the NIC node is used to eliminate the isolation between container groups managed by the resource object.

[0074] In Kubernetes, creating a resource object triggers the creation and deletion events of container groups on the network interface node.

[0075] For example, the client component obtains the triggering status of container group creation and deletion events on the network interface node via callbacks. If the client component confirms that creating a resource object triggers a container group creation event, it writes the partition key corresponding to the created container group to the network interface node corresponding to the client component. If the client component confirms that creating a resource object triggers a container group deletion event, it deletes the partition key corresponding to the deleted container group on the network interface node corresponding to the client component.

[0076] In the above-described method for dynamically configuring partition keys, a preset number of server components are deployed using a first resource object, and client components are deployed on the network interface card (NIC) node using a second resource object. The configuration management resource is initialized; a resource object is created, and the server components write the mapping relationship between the service name of the created resource object, the container group managed by the resource object, and the partition key into the configuration management resource; the client components retrieve the mapping relationship from the configuration management resource; based on the mapping relationship, when the creation of a resource object triggers a container group creation event, the client components write the partition key corresponding to the created container group into the NIC; when the creation of a resource object triggers a container group deletion event, the client components delete the partition key corresponding to the deleted container group on the NIC; the partition key stored on the NIC node is used to eliminate isolation between container groups managed by the resource object. This method enables multi-tenant isolation of IB NICs, reducing the time and effort users spend configuring partition keys based on the NIC used by the service, and improving the security and management efficiency of IB NICs in a multi-tenant environment.

[0077] In one embodiment, deploying a preset number of server components using a first resource object further includes: selecting a master server component from the preset number of server components for operation in a competitive manner, with the remaining server components used as backups.

[0078] The preset quantity is 3.

[0079] For example, a server component with 3 replicas is deployed using the first controller. The master server component is selected internally through a competitive election process to run the server, while the remaining server components are used as backups.

[0080] In this embodiment, the competitive master election mechanism ensures that the backup server component can quickly take over the service when the master server component fails. The master-slave architecture facilitates load balancing and dynamically allocates tasks according to actual needs, thereby improving system performance. While ensuring the continuous availability and stability of the system, it also enhances the system's fault tolerance.

[0081] In one specific embodiment, obtaining mapping relationships from the configuration management resource using a client component includes: obtaining mapping relationships from the configuration management resource using a client component in a polling manner.

[0082] Polling refers to the client component periodically and proactively sending requests to the configuration management resource to check for new data updates. The polling frequency can be adjusted based on specific needs and performance considerations.

[0083] For example, after the server component writes the mapping relationship to the configuration management resource, there are data updates in the configuration management resource; the client component periodically sends requests to the configuration management resource, and when it finds that there are data updates in the configuration management resource, it retrieves the mapping relationship.

[0084] In this embodiment, by using a client component to obtain the mapping relationship from the configuration management resource in a polling manner, the client component can obtain the latest configuration information in a timely manner, so that the client component can maintain synchronization with the configuration management resource without relying on complex notification or push mechanisms.

[0085] In one specific embodiment, based on the mapping relationship, when the creation of a resource object triggers a container group creation event, the partition key corresponding to the container group created by the client component is written to the network interface card (NIC) node. This includes: when the creation of a resource object triggers a container group creation event, the client component is notified via a callback to parse the NIC information corresponding to the created container group; based on the NIC information and the mapping relationship, the client component writes the partition key corresponding to the created container group to the NIC node.

[0086] A watch function is an asynchronous notification mechanism that occurs after an event. Network interface card (NIC) information includes the IB NIC's device name, node information, port information, and bus information.

[0087] For example, the client component obtains the container group creation event trigger status on the network interface card (NIC) node via a callback. If the client component confirms that the creation of a resource object triggered the container group creation event, it will be notified to parse the NIC information corresponding to the created container group. Based on the NIC information, the client component determines the NIC node. Based on the determined NIC node and mapping relationship, the client component writes the partition key corresponding to the created container group to the NIC node.

[0088] Furthermore, the client component obtains the container group deletion event trigger status on the network interface card (NIC) node via callback; if the client component confirms that the creation of the resource object triggered the container group deletion event, it will be notified to parse the NIC information corresponding to the deleted container group; based on the NIC information, the client component determines the NIC node; based on the determined NIC node and mapping relationship, the client component deletes the partition key corresponding to the deleted container group on the NIC.

[0089] In this embodiment, by notifying the client component via callback and writing the partition key corresponding to the container group to the network interface card (NIC) node or deleting the partition key within the NIC node, more accurate and efficient network partition management can be achieved. This callback mechanism ensures that the client component can be notified quickly after the container group creation event occurs, and then quickly parse the relevant NIC information to write the partition key corresponding to the created container group. At the same time, it can also be notified quickly after the container group deletion event occurs, and then delete the partition key corresponding to the deleted container group on the NIC node based on the mapping relationship.

[0090] In one embodiment, the method further includes: deleting the resource object by using a server component to delete the mapping relationship between the service name and the service name of the deleted resource object in the configuration management resource manager; and using a client component to delete the partition key in the network interface card of the container group managed by the running resource object.

[0091] In this embodiment, by using a server component to delete the mapping relationship between the service name corresponding to the deleted resource object in the configuration management resource controller, and by using a client component to delete the partition key in the network interface node of the container group managed by the running resource object, the information stored in the configuration management resource controller and the network interface node can be kept consistent with the actual state, and the network connectivity between container groups can be eliminated, thus ensuring the effectiveness of network isolation.

[0092] In one embodiment, deleting the partition key in the network interface node corresponding to the service name of the resource object using a client component further includes: using the client component to check the configuration of the service name of the container group running on the network interface node and the partition key in the network interface of the network interface node in a polling manner.

[0093] In this embodiment, by using a client component to poll and check the configuration of the service name of the container group running on the network interface card (NIC) node and the partition key in the NIC node, it is possible to promptly detect and correct any possible configuration errors or inconsistencies, ensuring that each NIC is correctly assigned a partition key. This maintains the accuracy and effectiveness of network partitions, prevents network communication problems caused by configuration errors, and further improves the management efficiency and security of IB NICs in a multi-tenant environment.

[0094] The following is for reference. Figure 3 The present application's method for dynamically configuring partition keys will be illustrated with a specific embodiment.

[0095] Step 1: Deploy the server and client components.

[0096] A three-replica server component is deployed using Deployment, and the server runs internally through a competitive leader election process. Simultaneously, a client component is deployed on each IB node using DaemonSet.

[0097] Step 2: The server component listens to the job status.

[0098] like Figure 4 As shown, initialize a global ConfigMap; use a server component to listen for job status.

[0099] If a resource object is created, the server component will write the mapping relationship between P_key and job name in the ConfigMap based on the partition key (P_key) rule and the service name. An example table of the mapping relationship between P_key and job name is shown in Table 1.

[0100] Table 1

[0101] P_key job Name 0x8001 p-job-x1 0x8002 p-job-x2 0x8003 m-job-x1 0x8004 m-job-x2

[0102] If a resource object is deleted, the server component will remove the corresponding partition key configuration from the ConfigMap.

[0103] Step 3: The client component listens to the state of the container group.

[0104] The client component listens to the status of the container group running on its IB node and confirms the creation and deletion events of the container group on the node via callbacks.

[0105] Step 4: The client component parses the IB network interface card information used by the container group.

[0106] If a resource object is created, when a container group is created, the network interface information used by the created container group is parsed; when a container group is deleted, the network interface information used by the deleted container group is parsed.

[0107] Step 5: The client component obtains the partition key for the task.

[0108] like Figure 4 As shown, the client component retrieves the P_key value corresponding to the name of the container group service running on this node from the ConfigMap in a round-robin manner.

[0109] Step 6: Configure the partition key for the IB network card in the client component.

[0110] If a resource object is created, when a container group is created, the P_key corresponding to the created container group is configured to the corresponding IB network interface card based on the network interface card information; when a container group is deleted, the P_key configuration on the IB network interface card corresponding to the deleted container group is deleted based on the network interface card information.

[0111] If a resource object is deleted, the client component will remove the corresponding partition key configuration from the IB network interface card.

[0112] Meanwhile, the client component needs to perform a full check on the service name and network interface P_key configuration of the container group every 15 seconds to prevent abnormal situations such as network interface configuration not being updated due to event loss.

[0113] Configuration examples are shown in Table 2.

[0114] Table 2

[0115] Node name IB0 IB1 IB2 Node1 0x8001 0x8001, 0x8002 0x8002 Node2 0x8001 0x8002 0x8002 Node3 0x8003 0x8003 0x8003, 0x8004

[0116] In the P_key allocation process, services (businesses) are centrally managed. Each service group uses the same P_key, ensuring mutual access within the same tenant. Different services use different P_keys, achieving network isolation at the NIC level. Tenant isolation is achieved by dividing the network into different P_key subnets. A tenant can have multiple container groups. As shown in Table 2, tenant A's P_key is 0x8001, and tenant B's P_key is 0x8002. All container groups of tenant A are configured to use 0x8001, allowing them to communicate; all container groups of tenant B are configured to use 0x8002, allowing them to communicate; however, container groups of tenant A and tenant B cannot communicate because their P_keys are different. In shared IB NIC mode, multiple tenants can use one IB NIC. In this case, one NIC will be configured with multiple P_keys. For example, if both 0x8001 and 0x8002 are configured on IB1 of Node1, then both tenant A and tenant B can use IB1.

[0117] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0118] Based on the same inventive concept, this application also provides a dynamic configuration partition key device for implementing the dynamic configuration partition key method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more embodiments of the dynamic configuration partition key device provided below can be found in the limitations of the dynamic configuration partition key method described above, and will not be repeated here.

[0119] In one exemplary embodiment, such as Figure 5 As shown, a dynamic configuration partition key device 500 is provided, including: a deployment module 502, an initialization module 504, a writing module 506, an acquisition module 508, and a configuration module 510, wherein:

[0120] Deployment module 502 is used to deploy a preset number of server components using a first resource object, and to deploy client components on a network interface node using a second resource object;

[0121] Initial module 504 is used to initialize the configuration management resource controller;

[0122] The write module 506 is used to create resource objects. It uses a server component to write the mapping relationship between the service name of the resource object, the container group managed by the resource object, and the partition key into the configuration management resource controller.

[0123] Module 508 is used to obtain mapping relationships from the configuration management resourcer using a client component;

[0124] Configuration module 510 is used to write the partition key corresponding to the created container group to the network interface card (NIC) using a client component when a container group creation event is triggered by the creation of a resource object, based on the mapping relationship; and to delete the partition key corresponding to the deleted container group on the NIC using a client component when a container group deletion event is triggered by the creation of a resource object. The partition key stored in the NIC node is used to eliminate the isolation between container groups managed by the resource object.

[0125] In one embodiment, the deployment module is further configured to select a master server component for operation from a preset number of server components in a competitive manner, with the remaining server components used as standby.

[0126] In one embodiment, the acquisition module is further configured to use a client component to obtain mapping relationships from the configuration management resource in a polling manner.

[0127] In one embodiment, the configuration module is further configured to notify the client component to parse the network interface card information corresponding to the created container group in a callback manner when the creation of a resource object triggers a container group creation event; based on the network interface card information and mapping relationship, the client component writes the partition key corresponding to the created container group to the network interface card.

[0128] In one embodiment, the dynamic configuration partition key device further includes a deletion module, which is used to delete resource objects by using a server component to delete the mapping relationship between the service name corresponding to the deleted resource object in the configuration management resource manager; and by using a client component to delete the partition key in the network interface card of the container group running the resource object management.

[0129] In one embodiment, the deletion module is further configured to use a client component to poll the service name of the container running on the network interface node and the configuration of the partition key in the network interface card of the network interface node.

[0130] Each module in the aforementioned dynamically configurable partition key device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0131] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores mapping relationship data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a dynamically configured partition key method.

[0132] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0133] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0134] Deploy a preset number of server components using the first resource object, and deploy client components using the second resource object on the network interface node;

[0135] Initialize and configure the resource manager;

[0136] Create resource objects and use server components to write the mapping relationship between the service name of the resource object, the container group managed by the resource object, and the partition key into the configuration management resource controller;

[0137] The mapping relationship is obtained from the configuration management resource using a client component;

[0138] Based on the mapping relationship, when the creation of a resource object triggers a container group creation event, a client component writes the partition key corresponding to the created container group to the network interface card (NIC). When the creation of a resource object triggers a container group deletion event, a client component deletes the partition key corresponding to the deleted container group on the NIC. The partition key stored on the NIC node is used to eliminate the isolation between container groups managed by the resource object.

[0139] In one embodiment, when the processor executes the computer program, it further performs the following steps: selecting a master server component from a preset number of server components for operation in a competitive manner, while the remaining server components are used as standby.

[0140] In one embodiment, when the processor executes the computer program, it also performs the following steps: using a client component to obtain mapping relationships from the configuration management resource in a polling manner.

[0141] In one embodiment, when the processor executes the computer program, it further performs the following steps: when the creation of a resource object triggers a container group creation event, it notifies the client component to parse the network interface card information corresponding to the created container group in a callback manner; based on the network interface card information and mapping relationship, the client component writes the partition key corresponding to the created container group to the network interface card.

[0142] In one embodiment, when the processor executes the computer program, it further performs the following steps: deleting a resource object, using a server component to delete the mapping relationship in the configuration management resource manager corresponding to the service name of the deleted resource object; and using a client component to delete the partition key in the network interface card of the container group running the resource object management.

[0143] In one embodiment, when the processor executes the computer program, it also performs the following steps: using a client component to poll the configuration of the service name of the container running on the network interface card node and the partition key in the network interface card of the network interface card node.

[0144] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0145] Deploy a preset number of server components using the first resource object, and deploy client components using the second resource object on the network interface node;

[0146] Initialize and configure the resource manager;

[0147] Create resource objects and use server components to write the mapping relationship between the service name of the resource object, the container group managed by the resource object, and the partition key into the configuration management resource controller;

[0148] The mapping relationship is obtained from the configuration management resource using a client component;

[0149] Based on the mapping relationship, when the creation of a resource object triggers a container group creation event, a client component writes the partition key corresponding to the created container group to the network interface card (NIC). When the creation of a resource object triggers a container group deletion event, a client component deletes the partition key corresponding to the deleted container group on the NIC. The partition key stored on the NIC node is used to eliminate the isolation between container groups managed by the resource object.

[0150] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: selecting a master server component from a preset number of server components for operation in a competitive manner, with the remaining server components used as standby.

[0151] In one embodiment, when the computer program is executed by the processor, it also performs the following steps: using a client component to obtain mapping relationships from the configuration management resource in a polling manner.

[0152] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when the creation of a resource object triggers a container group creation event, it notifies the client component to parse the network interface card information corresponding to the created container group in a callback manner; based on the network interface card information and mapping relationship, the client component writes the partition key corresponding to the created container group to the network interface card.

[0153] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: deleting a resource object, using a server component to delete the mapping relationship in the configuration management resource manager corresponding to the service name of the deleted resource object; and using a client component to delete the partition key in the network interface card of the container group running the resource object management.

[0154] In one embodiment, when the computer program is executed by the processor, it also performs the following steps: using a client component to poll the configuration of the service name of the container running on the network interface card node and the partition key in the network interface card of the network interface card node.

[0155] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0156] Deploy a preset number of server components using the first resource object, and deploy client components using the second resource object on the network interface node;

[0157] Initialize and configure the resource manager;

[0158] Create resource objects and use server components to write the mapping relationship between the service name of the resource object, the container group managed by the resource object, and the partition key into the configuration management resource controller;

[0159] The mapping relationship is obtained from the configuration management resource using a client component;

[0160] Based on the mapping relationship, when the creation of a resource object triggers a container group creation event, a client component writes the partition key corresponding to the created container group to the network interface card (NIC). When the creation of a resource object triggers a container group deletion event, a client component deletes the partition key corresponding to the deleted container group on the NIC. The partition key stored on the NIC node is used to eliminate the isolation between container groups managed by the resource object.

[0161] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: selecting a master server component from a preset number of server components for operation in a competitive manner, with the remaining server components used as standby.

[0162] In one embodiment, when the computer program is executed by the processor, it also performs the following steps: using a client component to obtain mapping relationships from the configuration management resource in a polling manner.

[0163] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: when the creation of a resource object triggers a container group creation event, it notifies the client component to parse the network interface card information corresponding to the created container group in a callback manner; based on the network interface card information and mapping relationship, the client component writes the partition key corresponding to the created container group to the network interface card.

[0164] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: deleting a resource object, using a server component to delete the mapping relationship in the configuration management resource manager corresponding to the service name of the deleted resource object; and using a client component to delete the partition key in the network interface card of the container group running the resource object management.

[0165] In one embodiment, when the computer program is executed by the processor, it also performs the following steps: using a client component to poll the configuration of the service name of the container running on the network interface card node and the partition key in the network interface card of the network interface card node.

[0166] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0167] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0168] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for dynamically configuring a partition key, the method comprising: The method comprises: deploying a preset number of server components using a first resource object, and deploying a client component on a network card node using a second resource object; initializing a configuration management resource device; creating a resource object, and writing, by the server component, a mapping relationship between a service name of the created resource object, container groups managed by the resource object, and partition keys into the configuration management resource device; obtaining, by the client component, the mapping relationship from the configuration management resource device; based on the mapping relationship, in a case where a container group creation event is triggered by the created resource object, writing, by the client component, a partition key corresponding to the created container group into a network card; in a case where a container group deletion event is triggered by the created resource object, deleting, by the client component, a partition key corresponding to a deleted container group on the network card; and the partition keys stored in the network card are used to eliminate isolation between the container groups managed by the resource object.

2. The method of claim 1, wherein, The method further comprises: selecting, in a competitive manner, a master server component from the preset number of server components for running, and using the remaining server components as backups.

3. The method of claim 1, wherein, The method further comprises: obtaining, by the client component, the mapping relationship from the configuration management resource device in a polling manner.

4. The method of claim 1, wherein, The method further comprises: in a case where a container group creation event is triggered by the created resource object, notifying, in a callback manner, the client component to parse network card information corresponding to the created container group; based on the network card information and the mapping relationship, writing, by the client component, a partition key corresponding to the created container group into the network card.

5. The method of claim 1, wherein, The method further comprises: deleting a resource object, and deleting, by the server component, a mapping relationship corresponding to a service name of the deleted resource object in the configuration management resource device; deleting, by the client component, a partition key in the network card on which the container group managed by the resource object runs.

6. The method of claim 5, wherein, The method further comprises: checking, by the client component in a polling manner, a configuration of a service name of a container group running on the network card node and a partition key in a network card of the network card node.

7. An apparatus for dynamically configuring a partition key, the apparatus comprising: The apparatus comprises: a deployment module, configured to deploy a preset number of server components using a first resource object, and deploy a client component on a network card node using a second resource object; an initialization module, configured to initialize a configuration management resource device; a writing module, configured to create a resource object, and write, by the server component, a mapping relationship between a service name of the created resource object, container groups managed by the resource object, and partition keys into the configuration management resource device; an obtaining module, configured to obtain, by the client component, the mapping relationship from the configuration management resource device; an obtaining module, configured to obtain, by the client component, the mapping relationship from the configuration management resource device; The configuration module is configured to, based on the mapping relationship, write, in a case where creation of a resource object triggers a container group creation event, a partition key corresponding to a created container group to a network card by using the client component; and delete, in a case where creation of a resource object triggers a container group deletion event, a partition key corresponding to a deleted container group on the network card by using the client component; and the partition key stored in the network card node is used to eliminate isolation between container groups managed by the resource object.

8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 6.

9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 6. The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 6.