Storage resource switching system, method and device, storage medium and computer program product

By working collaboratively between cloud and edge nodes, and decoupling the relationship between PV and storage resources using dynamic storage objects, the binding relationship between DS and storage resources is dynamically maintained. This solves the problem of low efficiency in switching storage resources for applications in existing technologies, achieves millisecond-level storage resource switching, and improves update efficiency.

CN121940282APending Publication Date: 2026-04-28ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ALIBABA CLOUD COMPUTING CO LTD
Filing Date
2024-10-25
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, switching storage resources for applications requires rebuilding Pods, PVCs, and PVs, resulting in low switching efficiency and failing to meet the needs of large-scale updates.

Method used

By working collaboratively between cloud nodes and edge nodes, dynamic storage objects are used to decouple the relationship between PVs and storage resources, dynamically maintain the binding relationship between DSs and storage resources, and enable applications to dynamically switch storage resources, avoiding the need to rebuild Pods, PVCs, and PVs.

Benefits of technology

Without rebuilding Pods, PVCs, and PVs, millisecond-level awareness of storage resource switching was achieved, improving switching efficiency and reducing single update time from 40 seconds to 900 milliseconds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121940282A_ABST
    Figure CN121940282A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a storage resource switching system, method and equipment, a storage medium and a computer program product, and is applied to the technical field of computers. In the embodiment of the invention, in the process of switching the storage resources for the application program, the incidence relation between the PV and the storage resources is decoupled through the dynamic storage object, so that the incidence relation between the dynamic storage object and the storage resources can be dynamically maintained under the condition of ensuring that the incidence relation among Pod, PVC, PV and the storage resources is not changed, and the user experience is improved. Therefore, one PV can be bound with different storage resources according to needs, the capacity of dynamically switching the storage resources for the application program is achieved under the condition that Pod, PVC and PV are not reconstructed, the problem that Pod, PVC and PV need to be reconstructed for updating the storage resources for the application program is solved, a switching link for switching the storage resources for the application program is simplified, the switching process is made to be lighter, and the switching efficiency is improved. And the switching efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a storage resource switching system, method, device, storage medium, and computer program product. Background Technology

[0002] In various cloud computing application scenarios such as cloud gaming, cloud phones, or cloud desktops, applications are deployed in the form of Pods (container groups) and container storage is used. During application deployment, Pods reference PVCs (Persistent Volume Claims), ultimately establishing a binding relationship between Pods, PVCs, PVs (Persistent Volumes), and storage resources, enabling Pods to utilize storage resources for persistent data storage.

[0003] In practical applications, applications often need to switch storage resources. Switching an application from an old storage resource to a new one requires first unbinding the old dependencies, releasing old Pods, PVCs, PVs, and other objects, and then recreating new PVCs, new Pods, and other objects, establishing new dependencies. However, this switching method is inefficient. Summary of the Invention

[0004] This application provides a storage resource switching system, method, apparatus, storage medium, and computer program product to simplify the switching process for switching storage resources for applications and improve switching efficiency.

[0005] This application provides a storage resource switching system, including: a cloud node and an edge node that work together; the cloud node is used to receive a resource switching request for an application, wherein the application has used a first storage resource that meets first resource requirement information, and the resource switching request includes second resource requirement information and the identifier of the target Pod corresponding to the application; in response to the resource switching request for the application, it searches for a second storage resource that meets the second resource requirement information among multiple storage resources; it obtains the identifier of the target PVC referenced by the target Pod according to the identifier of the target Pod, and determines the identifier of the target dynamic storage object according to the identifier of the target PVC, a first binding relationship between the target PVC and the target PV, and a second binding relationship between the target PV and the target dynamic storage object; according to the identifier of the target dynamic storage object, it releases the third binding relationship between the target dynamic storage object and the first storage resource, establishes a fourth binding relationship between the target dynamic storage object and the second storage resource, and marks the target dynamic storage object with a waiting-to-switch tag; the edge node is used to detect whether the target dynamic storage object has a waiting-to-switch tag; if the waiting-to-switch tag of the target dynamic storage object is detected, it switches the storage resource currently mounted on the mount point of the target Pod from the first storage resource to the second storage resource according to the fourth binding relationship.

[0006] This application also provides a storage resource switching method applied to a cloud node. The method includes: receiving a resource switching request for an application sent by a user terminal, wherein the application has used a first storage resource that meets first resource requirement information, and the resource switching request includes second resource requirement information and an identifier of a target Pod corresponding to the application; responding to the resource switching request for the application, searching for a second storage resource that meets the second resource requirement information among multiple storage resources; obtaining the identifier of a target PVC referenced by the target Pod based on the identifier of the target Pod, and determining the identifier of a target dynamic storage object based on the identifier of the target PVC, a first binding relationship between the target PVC and the target PV, and a second binding relationship between the target PV and the target dynamic storage object; releasing the third binding relationship between the target dynamic storage object and the first storage resource based on the identifier of the target dynamic storage object, establishing a fourth binding relationship between the target dynamic storage object and the second storage resource, and marking the target dynamic storage object with a waiting-for-switching tag.

[0007] This application also provides a storage resource switching method applied to edge nodes. The method includes: detecting whether a target dynamic storage object is tagged with a waiting-to-switch label; if a waiting-to-switch label is detected on the target dynamic storage object, switching the storage resource currently mounted on the mount point of the target Pod from the first storage resource to the second storage resource according to the established fourth binding relationship between the target dynamic storage object and the second storage resource.

[0008] This application also provides an electronic device, including: a memory and a processor; the memory for storing a computer program; and the processor coupled to the memory for executing the computer program to perform steps in a storage resource switching method.

[0009] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the storage resource switching method.

[0010] This application also provides a computer program product, including a computer program / instruction that, when executed by a processor, enables the processor to implement the steps in the storage resource switching method.

[0011] In this embodiment, during the process of switching storage resources for an application, the association between the PV and the storage resource is decoupled through dynamic storage objects. This allows for the dynamic maintenance of the association between the DS and the storage resource while ensuring that the relationships between the Pod, PVC, PV, and storage resource remain unchanged. Consequently, a PV can be bound to different storage resources as needed, enabling dynamic switching of storage resources for the application without rebuilding the Pod, PVC, and PV. This solves the problem of needing to rebuild the Pod, PVC, and PV to update storage resources for an application, simplifying the switching process and making it more lightweight and efficient. Compared to rebuilding the Pod, PVC, and PV to update storage resources, edge nodes directly use dynamic storage objects, reducing the average update time from 40 seconds to 900 milliseconds, achieving millisecond-level perceptible switching and improving update efficiency. Attached Figure Description

[0012] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0013] Figure 1 This is a schematic diagram illustrating the principle of an application mounting a cloud disk for the first time in existing technology.

[0014] Figure 2 A system architecture diagram of a storage resource switching system provided in this application embodiment;

[0015] Figure 3 This is an example of a signaling interaction diagram for the first time mounting storage resources for an application;

[0016] Figure 4This is an example of a signaling interaction diagram for switching storage resources for an application;

[0017] Figure 5 This is a schematic diagram illustrating the initial mounting of a cloud disk for an application.

[0018] Figure 6 This is an example of a signaling interaction diagram for the first time mounting storage resources for an application;

[0019] Figure 7 This is an example of a schematic diagram for switching cloud disks for an application.

[0020] Figure 8 This is an example of a signaling interaction diagram for switching cloud disks for an application;

[0021] Figure 9 A flowchart illustrating a storage resource switching method provided in an embodiment of this application;

[0022] Figure 10 A flowchart illustrating another storage resource switching method provided in this application embodiment;

[0023] Figure 11 This is a schematic diagram of the structure of a storage resource switching device provided in an embodiment of this application;

[0024] Figure 12 This is a schematic diagram of another storage resource switching device provided in an embodiment of this application;

[0025] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the access relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone, where A and B can be singular or plural. In the textual description of this application, the character " / " generally indicates that the preceding and following associated objects have an "or" relationship. Furthermore, in the embodiments of this application, "first," "second," "third," etc., are only used to distinguish the content of different objects and have no other special meaning.

[0028] First, let's introduce some of the terms used in this application:

[0029] Kubernetes (K8s) is a powerful container orchestration system that provides a standardized platform for the deployment, management, and automatic scaling of containerized applications.

[0030] Pod (container group): A Pod is a lightweight group of containers consisting of one or more containers. Pods can be used to run containerized applications, such as cloud gaming applications.

[0031] CSI (Container Storage Interface) is a standardized interface that provides storage plugins for container orchestration systems such as Kubernetes.

[0032] A PVC (Persistent Volume Claim) is a declaration of storage resource usage requirements, allowing users to specify attributes such as the required storage size and access mode.

[0033] PV (Persistent Volume): A storage resource in a cluster that can be provided by various backend storage resources, such as local disks, network storage systems, cloud disks, etc.

[0034] DS (Dynamic Storage) object: A storage-related custom resource specification that enables the logic of quickly switching storage volumes, similar to a virtual disk.

[0035] Figure 1 This is a schematic diagram illustrating the initial mounting of a cloud disk by an application in existing technology. See also... Figure 1The Kubernetes system consists of cloud nodes and edge nodes. Cloud nodes can be considered as master nodes, and edge nodes as worker nodes. The master node acts as the management node, responsible for managing the entire Kubernetes system. The master node primarily includes components such as the API Server, Controller, Scheduler, and etcd (a distributed data storage system). The API Server is the core component of the Kubernetes system, serving as the data bus and data center for the entire system, responsible for interaction with other components within the master node and all worker nodes. The Controller manages the cluster state. The Scheduler is primarily responsible for scheduling cluster resources, allocating containers to appropriate worker nodes based on specific scheduling algorithms and strategies to utilize cluster resources more efficiently and effectively. etcd is a distributed data storage system that stores various cluster state information. Each worker node deploys one or more containers. Worker nodes provide components such as kubelet (node ​​agent), CSI Agent (container storage interface agent), and containerd (container generation component). The kubelet group's main functions include starting and stopping containers, managing container resource allocation, and performing container health checks. CSI Agent is the container storage interface agent, responsible for managing and operating storage volumes. containerd is responsible for managing the container lifecycle, including pulling images, creating and starting containers, etc.

[0036] The following is combined with Figure 1 This section explains how users deploy applications with storage requirements on a Kubernetes (K8s) system. The process can be roughly divided into two steps. Step 1: The user declares their storage requirements, and the K8s system automatically creates the corresponding storage resources. Step 2: The application is deployed, and the application uses the relevant storage resources for persistent data storage.

[0037] 1. The storage requirement declaration process is as follows:

[0038] See Figure 1 As shown in 1.1, storage requests are submitted to the K8s system through the user client;

[0039] See Figure 1 As shown in section 1.2, in the K8s system, cloud nodes format storage requirements through the API Server, which is to create PVCs.

[0040] See Figure 1 As shown in 1.3, cloud nodes persist storage requirements, that is, they create cloud disks (not shown in the figure) and PVs.

[0041] 2. The application deployment process is as follows:

[0042] See Figure 1 As shown in Figure 2.1, the client sends an application deployment task to the K8s system. The application deployment task indicates that the application should be deployed in the form of a Pod and references a PVC.

[0043] See Figure 1 As shown in Figure 2.2, the API Server selects the edge node for the deployed Pod and distributes the Pod creation task to the kubelet component of the relevant edge node.

[0044] See Figure 1 As shown in Figure 2.3, after the kubelet component detects the task of creating a Pod, it starts to call containerd (the container generation component) through the CRI (Container Runtime Interface) interface to create the Pod.

[0045] See Figure 1 As shown in section 2.4, after containerd is invoked, it begins to create and start the container of the Pod.

[0046] See Figure 1 As shown in Figure 2.5, the kubelet component calls the CSI Agent to attach the previously created cloud disk to the edge node and finally mount it into the Pod.

[0047] See Figure 1 As shown in Figure 2.6, after the CSI Agent is invoked, it attaches the cloud disk, that is, it makes the cloud disk appear on the edge node as a block device and generates the corresponding disk letter.

[0048] See Figure 1 As shown in Figure 2.7, the CSI Agent continues to mount the cloud disk to the Pod's mount point. After the Pod starts up and runs, the Pod's application reads or writes data through the mount point.

[0049] As discussed above, the traditional solution for switching cloud disks for applications is to rebuild Pods, PVCs, and PVs to update the cloud disk. This requires unbinding old bindings, releasing old Pods, PVCs, and PVs, and then creating new PVCs, Pods, and other objects, and establishing new bindings. However, this method of switching cloud disks for applications is inefficient and unsuitable for large-scale (e.g., millions of Pods) version updates. Its low update efficiency cannot meet the needs of frequent daily updates.

[0050] The technical solutions of this application and how they solve the aforementioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The technical solutions provided by each embodiment of this application are described in detail below with reference to the accompanying drawings.

[0051] Figure 2 This is a system architecture diagram of a storage resource switching system provided in an embodiment of this application. See also... Figure 2 The system may include: cloud node 10 and edge node 20.

[0052] In this embodiment, cloud node 10 can be regarded as a management node, responsible for formatting and persisting storage requirements, creating dynamic storage (DS) objects, scheduling edge nodes for application deployment, and coordinating with edge nodes to switch storage resources for applications; cloud node is, for example, the master node in the K8s system.

[0053] In this embodiment, edge node 20 is responsible for creating and running containerized applications, and works with cloud nodes to switch storage resources for the applications; edge nodes are, for example, worker nodes in a Kubernetes system.

[0054] Cloud nodes typically refer to high-performance computing resources located in data centers, usually managed by cloud service providers. They possess powerful computing capabilities, storage capacity, and network bandwidth, enabling them to handle large-scale data and complex computational tasks. Edge nodes, on the other hand, are computing devices located closer to the data source or end user, typically at the network edge. Edge nodes handle tasks requiring high real-time performance and low latency, reducing the burden on cloud nodes. In this embodiment, cloud node 10 and edge node 20 work collaboratively to improve resource switching efficiency.

[0055] The following is combined with Figure 3 This describes the process of mounting storage resources to an application for the first time. See also... Figure 3 When mounting storage resources for an application for the first time, the following steps can be performed:

[0056] S1. The cloud node receives a resource request for the application sent by the user. The resource request includes first resource requirement information and mode indication information. The mode indication information is used to indicate whether to use dynamic storage mode.

[0057] In practical applications, users submit resource requests for their applications to cloud nodes via their client. The first resource requirement information carried in these requests reflects the storage resources needed by the application. These storage resources may include, but are not limited to, local disks, network storage systems, and cloud disks. This first resource requirement information may include, but is not limited to, storage capacity and storage type. The mode indication information carried in the resource request indicates whether dynamic storage mode is used. If the mode indication information indicates the use of dynamic storage mode, a dynamic storage object (also known as a DS object) needs to be created; if the mode indication information indicates that dynamic storage mode is not used, no dynamic storage object needs to be created.

[0058] S2. In response to the resource request, the cloud node creates the target PVC and the first storage resource based on the first resource requirement information, as well as the target PV, and establishes the first binding relationship between the target PVC and the target PV.

[0059] In this embodiment, after receiving a resource request, the cloud node creates a PVC that meets the first resource requirement information; this created PVC is referred to as the target PVC. In practical applications, a target PVC can be created based on its configuration file. The target PVC's configuration file defines various attributes of the target PVC, such as access mode, resource requirements, storage type name, volume mode, and volume name.

[0060] Taking a storage capacity of 100 GiB (gigabits) in the first resource requirement information as an example, the key information of the target PVC configuration file is as follows:

[0061] {

[0062] spec: / / Defines various properties of the target PVC

[0063] accessModes: ReadWriteOnce / / Access mode, which can be ReadWriteOnce. This access mode indicates that the storage volume can only be mounted by one node in read-write mode.

[0064] resources: / / resource requirements

[0065] requests: / / resource requirements

[0066] storage: 100GiB / / Requested storage capacity, which is 100GiB from the first resource requirement information.

[0067] storageClassName:edge-csi-clouddisk-iscsi-storage / / Storage type name, here is cloud disk

[0068] volumeMode: Filesystem / / Volume mode, here it is Filesystem (file system)

[0069] volumeName:pvcs-26cf9d46-f405-44cb-b8d51-666dd3d7edac / / Volume name, i.e., the identifier of the target PVC.

[0070] }

[0071] In this embodiment, after receiving a resource request, the cloud node also needs to create storage resources that meet the first resource requirement information. Here, the created storage resource is referred to as the first storage resource. The storage type of the first storage resource includes, but is not limited to, local disks, network storage systems, cloud disks, etc. For example, if the storage capacity in the first resource requirement information is 100 GiB, a cloud disk with a storage capacity of 100 GiB can be created as the first storage resource.

[0072] In this embodiment, after receiving a resource request, the cloud node also needs to create a PV. Here, the created PV is called the target PV, and a binding relationship is established between the target PVC and the target PV. Here, the binding relationship between the target PVC and the target PV is called the first binding relationship. The first binding relationship includes the association between the identifier of the target PVC and the identifier of the target PV.

[0073] S3. If the mode indication information indicates the use of dynamic storage mode, the cloud node creates the target dynamic storage object, and establishes a second binding relationship between the target PV and the target dynamic storage object, and a third binding relationship between the target dynamic storage object and the first storage resource.

[0074] In this embodiment, if the mode indication information indicates the use of dynamic storage mode, it means that a dynamic storage object needs to be created. Here, the created dynamic storage object is referred to as the target dynamic storage object. A binding relationship between the target PV and the target dynamic storage object is established based on the identifier of the target dynamic storage object and the identifier of the target PV. Here, the binding relationship between the target PV and the target dynamic storage object is referred to as the second binding relationship, that is, the second binding relationship includes the association between the identifier of the target dynamic storage object and the identifier of the target PV. In addition, a binding relationship between the target dynamic storage object and the first storage resource is established based on the identifier of the target dynamic storage object and the identifier of the first storage resource. Here, the binding relationship between the target dynamic storage object and the first storage resource is referred to as the third binding relationship, that is, the third binding relationship includes the association between the identifier of the target dynamic storage object and the identifier of the first storage resource.

[0075] S4, the cloud node receives application deployment instructions sent by the user terminal.

[0076] S5: Cloud nodes send application deployment requests for applications to edge nodes.

[0077] In practical applications, cloud nodes respond to application deployment instructions sent by the user terminal by sending application deployment requests to edge nodes to request the edge nodes to deploy the application.

[0078] S6. In response to the application deployment request sent by the cloud node, the edge node creates and runs the target Pod that references the target PVC.

[0079] S7. During the execution of the target Pod, the edge node mounts the first storage resource to the mount point of the target Pod according to the first binding relationship, the second binding relationship, and the third binding relationship to complete the application deployment.

[0080] In practical applications, edge nodes reference the target PVC in the target PVC's configuration file, and create a target Pod that references the target PVC based on the target PVC's configuration file. After the target Pod is created, it is started and run. During the target Pod's operation, the first storage resource is mounted to the target Pod's mount point according to the first, second, and third binding relationships to complete application deployment. Specifically, the identifier of the first storage resource is determined based on the identifier of the target PVC referenced by the target Pod, the first, second, and third binding relationships; based on the identifier of the first storage resource, it is mounted to the target Pod's mount point. This completes the task of mounting storage resources for the application, and subsequently, the application's target Pod can use the first storage resource for persistent data storage.

[0081] As can be seen from the above, unlike the traditional initial mounting of storage resources to an application, the present application's embodiment proposes that, after establishing the binding relationship between PVC and PV objects, a new dynamic storage object is created during the initial mounting of storage resources to an application. This dynamic storage object decouples the association between PV and storage resources. Thus, the relationship between DS and storage resources can be dynamically maintained while ensuring that the association between Pod, PVC, PV, and storage resources remains unchanged. This allows a PV to bind to different storage resources as needed, enabling the application to dynamically switch storage resources without rebuilding Pod, PVC, and PV. This solves the problem of needing to rebuild Pod, PVC, and PV to update storage resources for an application, simplifying the switching chain for switching storage resources for an application, making the switching process lighter, and improving switching efficiency.

[0082] After initially mounting storage resources to the application during application deployment, the application may need to switch storage resources over time, for example, due to version upgrades. This paper describes how to dynamically switch storage resources for the application without rebuilding Pods, PVCs, and PVs using dynamic storage objects. The following section will combine... Figure 4 This describes the process of switching storage resources for an application. See also: Figure 4 During the process of switching storage resources for an application, the following steps can be performed:

[0083] S1. The cloud node receives a resource switching request for the application sent by the user. The application has used the first storage resource that meets the first resource requirement information. The resource switching request includes the second resource requirement information and the identifier of the target Pod corresponding to the application.

[0084] Specifically, if an application is already using a first storage resource that meets the first resource requirement information, there may be a need to switch storage resources for the application over time. In practice, the cloud node receives a resource switching request from the user client for the application. This request requests a change in storage resources for the application. The second resource requirement information in the request reflects the latest storage resource information required by the application. This second resource requirement information differs from the first resource requirement information. The identifier of the target Pod in the request is used to quickly identify the target dynamic storage object.

[0085] S2. In response to the resource switching request, the cloud node searches for a second storage resource that meets the requirements of the second resource among multiple storage resources.

[0086] For example, if the first storage resource that meets the first resource requirement is a 100GiB cloud disk, and the second storage resource that meets the second resource requirement is a 200GiB cloud disk, then the cloud node needs to find a 200GiB cloud disk as the storage resource after the application is switched.

[0087] S3. The cloud node obtains the identifier of the target PVC referenced by the target Pod based on the identifier of the target Pod, and determines the identifier of the target dynamic storage object based on the identifier of the target PVC, the first binding relationship between the target PVC and the target PV, and the second binding relationship between the target PV and the target dynamic storage object.

[0088] In practical applications, the target Pod's configuration file can be located based on the target Pod's identifier to obtain the identifier of the target PVC referenced by the target Pod.

[0089] S4. Based on the identifier of the target dynamic storage object, the cloud node removes the third binding relationship between the target dynamic storage object and the first storage resource, establishes a fourth binding relationship between the target dynamic storage object and the second storage resource, and marks the target dynamic storage object with a tag waiting to switch.

[0090] Specifically, the cloud node locates the established third binding relationship between the target dynamic storage object and the first storage resource based on the identifier of the target dynamic storage object, and releases the third binding relationship between the target dynamic storage object and the first storage resource; and establishes a fourth binding relationship between the target dynamic storage object and the second storage resource, the fourth binding relationship including the association relationship between the identifier of the target dynamic storage object and the identifier of the second storage resource.

[0091] After establishing the fourth binding relationship between the target dynamic storage object and the second storage resource, the cloud node also adds a "waiting to switch" tag to the target dynamic storage object. The "waiting to switch" tag is used to indicate the switching of storage resources according to the fourth binding relationship.

[0092] S5. Edge node detection: Check whether the target dynamic storage object is tagged with "Waiting to switch".

[0093] S6. If the edge node detects the waiting switch tag of the target dynamic storage object, it will switch the storage resource currently mounted on the mount point of the target Pod from the first storage resource to the second storage resource according to the fourth binding relationship.

[0094] Specifically, the edge node detects whether the target dynamic storage object is tagged with a "waiting to switch" label. If the "waiting to switch" label is detected, it means that the storage resource needs to be switched according to the fourth binding relationship. At this time, the edge node determines the identifier of the second storage resource after the switch according to the fourth binding relationship, unmounts the first storage resource currently mounted on the mount point of the target Pod, and mounts the second storage resource to the mount point of the target Pod according to the identifier of the second storage resource. Thus, the storage resource currently mounted on the mount point of the target Pod is switched from the first storage resource to the second storage resource.

[0095] In practical applications, when mounting a second storage resource to the mount point of a target Pod based on its identifier, the second storage resource can be logged into on the edge node based on its identifier and then mounted to the mount point of the target Pod.

[0096] Further optionally, to ensure the reliability of the switchover, the implementation method for the edge node to switch the storage resource currently mounted on the mount point of the target Pod from the first storage resource to the second storage resource according to the fourth binding relationship includes: determining the identifier of the second storage resource according to the fourth binding relationship; and logging into the second storage resource on the edge node according to the identifier of the second storage resource.

[0097] Unmount the first storage resource from the target Pod's mount point and log it out of the edge node; mount the second storage resource onto the target Pod's mount point.

[0098] Further optionally, before the edge node logs the first storage resource off the edge node, it can also determine that the first storage resource is not referenced by other Pods.

[0099] In practical applications, the first storage resource may be shared and mounted by different Pods. The reference count of the first storage resource reflects the number of Pods using it. This reference count determines whether the first storage resource is not referenced by other Pods. For example, if the reference count is greater than 1, it means the first storage resource is referenced by other Pods; if the reference count is equal to 1, it means the first storage resource is only referenced by the target Pod. Understandably, before an edge node logs off the first storage resource, ensuring it is not referenced by other Pods guarantees that the normal operation of other Pods will not be affected.

[0100] It is worth noting that if the first storage resource is referenced by other Pods, you can simply unmount the first storage resource from the mount point of the target Pod without logging the first storage resource off the edge node.

[0101] In some optional embodiments, after the edge node switches the storage resource currently mounted on the target Pod's mount point from the first storage resource to the second storage resource according to the fourth binding relationship, it can also delete the pending switch tag of the target dynamic storage object and add a complete switch tag to the target dynamic storage object. Correspondingly, in response to detecting the complete switch tag of the target dynamic storage object, the cloud node notifies the user that the storage resource switch for the application has been completed. Thus, the transparency and reliability of the storage resource switching process are ensured through tag management and user notification mechanisms.

[0102] As described above, during the process of switching storage resources for an application, the dynamic storage object decouples the association between the PV and the storage resource. This allows for the dynamic maintenance of the association between the DS and the storage resource while ensuring that the relationships between the Pod, PVC, PV, and storage resource remain unchanged. This enables a PV to bind to different storage resources as needed, achieving the ability to dynamically switch storage resources for the application without rebuilding the Pod, PVC, and PV. This solves the problem of needing to rebuild the Pod, PVC, and PV to update storage resources for an application, simplifying the switching process and making it more lightweight and efficient. Compared to rebuilding the Pod, PVC, and PV to update storage resources, edge nodes directly use dynamic storage objects, reducing the average update time from 40 seconds to 900 milliseconds, achieving millisecond-level perceptible switching and improving update efficiency.

[0103] To better understand the technical solution of this application, the following is combined with... Figures 5-8 Specific scenario examples will be introduced.

[0104] Figure 5 This is a schematic diagram illustrating the initial mounting of a cloud disk to an application. First, let's... Figure 5 Taking this as an example, we will introduce the process of mounting a cloud disk for an application for the first time.

[0105] See Figure 5 The user storage requirement declaration process is as follows:

[0106] See Figure 5 As shown in 1.1, storage requests are submitted to the K8s system through the user client;

[0107] See Figure 5 As shown in section 1.2, in the K8s system, cloud nodes format storage requirements through the API Server, which is to create PVCs.

[0108] See Figure 5As shown in section 1.3, the cloud node persists the storage requirements, that is, it creates a cloud disk (not shown in the figure) and a PV, and establishes a binding relationship between the PVC and the PV. In addition, the cloud node creates a DS object, and establishes a binding relationship between the DS object and the cloud disk, and a binding relationship between the DS object and the PV.

[0109] 2. The application deployment process is as follows:

[0110] See Figure 5 As shown in Figure 2.1, the client sends an application deployment task to the K8s system. The application deployment task indicates that the application should be deployed in the form of a Pod and references a PVC.

[0111] See Figure 5 As shown in Figure 2.2, the API Server selects the edge node for the deployed Pod and distributes the Pod creation task to the kubelet component of the relevant edge node.

[0112] See Figure 5 As shown in Figure 2.3, after the kubelet component detects the task of creating a Pod, it starts calling containerd through the CRI interface to create the Pod.

[0113] See Figure 5 As shown in section 2.4, after containerd is invoked, it begins to create and start the container of the Pod.

[0114] See Figure 5 As shown in Figure 2.5, the kubelet component calls the CSI Agent to attach the previously created cloud disk to the edge node and finally mount it into the Pod.

[0115] See Figure 5 As shown in Figure 2.6, after the CSI Agent is invoked, it mounts the cloud disk. Before mounting the cloud disk, the corresponding cloud disk can be logged into on the edge node, that is, the cloud disk appears on the edge node as a block device and a corresponding disk letter is generated.

[0116] See Figure 5 As shown in Figure 2.7, the CSI Agent continues to mount the cloud disk to the Pod's mount point. After the Pod starts up and runs, the Pod's application reads or writes data through the mount point.

[0117] Specifically, after the CSI Agent is invoked, it determines the identifier of the cloud disk to be mounted based on the identifier of the PVC referenced by the Pod, the binding relationship between the PVC and PV, the binding relationship between the DS object and the cloud disk, and the binding relationship between the DS object and the PV. Based on the identifier of the cloud disk to be mounted, it logs into the corresponding cloud disk on the edge node and mounts the cloud disk to the global directory (i.e., the global mount point) of the edge node. Finally, it mounts the global directory to which the cloud disk is mounted to the Pod's mount point to complete the cloud disk mounting. Afterwards, users can query the running status of the Pod and the creation result of the PVC from the Kubernetes system through the client.

[0118] To better understand the principle of mounting a cloud disk for an application for the first time, the following will combine... Figure 6 To be introduced. See also Figure 6 When mounting a cloud disk for the first time to an application, you can perform the following steps:

[0119] Step 1.1: The user sets the parameter dynamicStorage=true through the storage center interface and notifies the interface server through the storage center to create resources such as Pods and PVCs;

[0120] The parameter dynamicStorage=true indicates that dynamic storage mode is used; the parameter dynamicStorage=true indicates that the dynamicStorage flag is carried.

[0121] Step 1.2: The CSI controller detects the newly created PVC and detects the PVC carrying the dynamicStorage tag;

[0122] Step 1.3: The CSI controller creates a cloud disk, creates a PV, and establishes a binding relationship between the PV and the PVC;

[0123] Step 1.4: The CSI controller creates a DS object, establishes the binding relationship between the DS object and the cloud disk, and establishes the binding relationship between the DS object and the PV.

[0124] Step 1.5: The CSI controller issues a Pod creation task;

[0125] Step 1.6: After the kubelet component detects the Pod creation task, it begins to create the Pod;

[0126] Step 1.7: During the creation of the Pod by the kubelet component, it was discovered that the Pod uses a PVC, and a request was made to the CSI Agent to mount the cloud disk.

[0127] Step 1.8: After the CSI Agent is invoked, it begins logging into the relevant cloud disk;

[0128] Step 1.9: The CSI Agent will be mounted to the global mount on the edge node;

[0129] Step 1.10: The CSI Agent mounts the global directory to the Pod's mount point;

[0130] Step 1.11: The CSI Agent returns the mounting completion result to the kubelet component;

[0131] Step 1.12: The kubelet component confirms the completion of Pod creation;

[0132] Step 1.13: The kubelet component synchronizes the Pod running status with the interface server;

[0133] Step 1.14: The user queries the running status of the Pod and the creation result of the PVC;

[0134] Step 1.15: Return the query results to the user.

[0135] Figure 7 This is an example of a schematic diagram illustrating how an application switches cloud drives. The following section combines... Figure 7 This describes the process of switching cloud drives for applications.

[0136] See Figure 7 The user's specific storage update requirements are as follows:

[0137] See Figure 7 As shown in Figure 1, the user submits information about the cloud disk used by the Pod to the storage center of the cloud node.

[0138] See Figure 7 As shown in Figure 2, the storage center requests the interface server to query and update the associated DS object.

[0139] See Figure 7 As shown in Figure 3, the interface server updates the associated DS object and adds a "waiting for switching" tag to the DS object.

[0140] See Figure 7 Cloud nodes and edge nodes work together to switch cloud disks, as detailed below:

[0141] See Figure 7 As shown in Figure 4, if the CSI Agent in the edge node detects that the DS object is tagged with "Waiting for Switch", it is determined that a user request update has been detected.

[0142] See Figure 7 As shown in 5 and 6, the CSI Agent unmounts the old cloud disk from the Pod's mount point; the CSI Agent logs out of the old cloud disk.

[0143] See Figure 7 As shown in 7 and 8, the CSI Agent logs into the new cloud disk, and the new cloud disk is mounted on the Pod's mount point.

[0144] See Figure 7 As shown in 9-11, the CSI Agent confirms the completion of the DS object update and tags the DS object with a "complete switchover" label. The storage center detects the "complete switchover" label on the DS object and confirms that the DS object has been updated. The storage center then returns cloud disk update information for the completed Pod to the user.

[0145] To better understand the principle behind switching cloud drives for applications, the following will combine... Figure 8 To be introduced. See also Figure 8 To switch cloud drives for your application, you can perform the following steps:

[0146] Step 2.1: Call the quick switching interface.

[0147] Specifically, the user client calls the quick switch interface and passes in the identifier of the Pod to be switched and the new cloud disk requirement information.

[0148] Step 2.2: Tag the DS object with wait-switch=true.

[0149] Specifically, the storage center finds the PVC, PV, and DS objects associated with the Pod based on the identifier of the Pod to be switched, and marks the DS object with wait-switch=true (i.e., a waiting switch label).

[0150] Step 2.3: The CSI Agent starts the edge dynamic mode and detects the DS objects associated with the Pods on the edge nodes.

[0151] Step 2.4: The CSI Agent detected the disk replacement requirement.

[0152] Specifically, the CSI Agent detects a change in the DS object with a wait-switch tag, confirming that a disk swapping requirement has been detected, which means that a dynamic switch request has been received.

[0153] Step 2.5: The CSI Agent checks whether the dynamic switching has been completed. If it has, it returns.

[0154] Step 2.5 involves adding idempotent security design for duplicate requests;

[0155] Step 2.6: Log in to the new cloud drive and mount it to the corresponding new global directory.

[0156] Specifically, the CSI Agent completes the login for the new disk to be switched and mounts it to the corresponding new global directory (i.e., the globalmount mount point).

[0157] Step 2.7: The CSI Agent uninstalls the old cloud disk;

[0158] Specifically, the CSI Agent can perform lazy umount on old cloud disks to unmount them from the mount point corresponding to the Pod.

[0159] Step 2.8: The CSI Agent checks the reference count of the old cloud disk. If there are no references, it logs out of the old cloud disk.

[0160] Specifically, the CSI Agent checks whether the old cloud disk is shared and mounted by different Pods (in this scenario, there is a situation where a single disk is used as a read-only shared mount). If there are no other references, the old cloud disk is logged out.

[0161] Step 2.9: The CSI Agent mounts the global directory of the new cloud disk to the mount point of the Pod, thus completing the disk swap.

[0162] Step 2.10: The CSI Agent updates the reference count of the cloud disk.

[0163] Specifically, the CSI Agent updates the reference counts of the new and old cloud disks and persists them.

[0164] Step 2.11: The CSI Agent tags the DS object with switch-done=true;

[0165] Specifically, the CSI Agent tags the DS object with switch-done=true (i.e., the switch is complete) and removes the wait-switch tag;

[0166] Step 2.12: The storage center detects that the Pod has completed the disk replacement;

[0167] Step 2.13: The storage center will synchronously return the disk replacement results to the user.

[0168] Figure 9 A flowchart illustrating a storage resource switching method provided in an embodiment of this application. This method is applied to cloud nodes; see [link to relevant documentation]. Figure 9 The method includes the following steps:

[0169] 101. Receive a resource switching request for an application sent by a user client, wherein the application has used a first storage resource that meets the first resource requirement information, and the resource switching request includes a second resource requirement information and the identifier of the target Pod corresponding to the application.

[0170] 102. In response to a resource switching request for an application, locate a second storage resource among multiple storage resources that meets the second resource requirement information.

[0171] 103. Obtain the identifier of the target PVC referenced by the target Pod based on the identifier of the target Pod, and determine the identifier of the target dynamic storage object based on the identifier of the target PVC, the first binding relationship between the target PVC and the target PV, and the second binding relationship between the target PV and the target dynamic storage object.

[0172] 104. Based on the identifier of the target dynamic storage object, remove the third binding relationship between the target dynamic storage object and the first storage resource, establish the fourth binding relationship between the target dynamic storage object and the second storage resource, and mark the target dynamic storage object with a tag waiting to switch.

[0173] Further optionally, the above method also includes: in response to detecting the completion switch tag of the target dynamic storage object, notifying the client that the storage resource has been switched for the application; wherein, the completion switch tag of the target dynamic storage object is attached by the edge node after deleting the waiting switch tag of the target dynamic storage object, and the edge node deletes the waiting switch tag of the target dynamic storage object after switching the storage resource currently mounted on the mount point of the target Pod from the first storage resource to the second storage resource.

[0174] Further optionally, before receiving the resource switching request for the application sent by the user, the method further includes: sending an application deployment request for the application to the edge node, so that the edge node creates and runs a target Pod that references the target PVC, and during the running of the target Pod, mounting the first storage resource to the mount point of the target Pod according to the first binding relationship, the second binding relationship and the third binding relationship to complete the application deployment.

[0175] Optionally, before responding to the application deployment instruction sent by the user terminal, the method further includes: receiving a resource request request sent by the user terminal for the application, the resource request request including first resource requirement information and mode indication information, the mode indication information being used to indicate whether dynamic storage mode is used; in response to the resource request request, creating a target PVC and a first storage resource according to the first resource requirement information, and creating a target PV, and establishing a first binding relationship; if the mode indication information indicates the use of dynamic storage mode, creating a target dynamic storage object, and establishing a second binding relationship and a third binding relationship.

[0176] The implementation of each step of the storage resource switching method in this embodiment can be found in the foregoing embodiments, and will not be repeated here.

[0177] The technical solution provided in this application, during the process of switching storage resources for an application, decouples the association between the PV and the storage resource through dynamic storage objects. This allows for the dynamic maintenance of the association between the DS and the storage resource while ensuring that the relationships between the Pod, PVC, PV, and storage resource remain unchanged. Consequently, a PV can be bound to different storage resources as needed, enabling the dynamic switching of storage resources for the application without rebuilding the Pod, PVC, and PV. This solves the problem of needing to rebuild the Pod, PVC, and PV to update storage resources for an application, simplifying the switching chain and making the switching process more lightweight and efficient. Compared to rebuilding the Pod, PVC, and PV to update storage resources, edge nodes directly use dynamic storage objects, reducing the average time per update from 40 seconds to 900 milliseconds, achieving millisecond-level perceptible switching and improving update efficiency.

[0178] Figure 10 A flowchart illustrating another storage resource switching method provided in this application embodiment. This method is applied to edge nodes; see [link to relevant documentation]. Figure 10 The method includes the following steps:

[0179] 201. Check if the target dynamic storage object is tagged with "Waiting to switch".

[0180] 202. If a waiting switch tag for the target dynamic storage object is detected, the storage resource currently mounted on the mount point of the target Pod will be switched from the first storage resource to the second storage resource according to the established fourth binding relationship between the target dynamic storage object and the second storage resource.

[0181] Further optionally, after switching the storage resource currently mounted on the target Pod's mount point from the first storage resource to the second storage resource according to the fourth binding relationship, the method further includes: deleting the waiting switch tag of the target dynamic storage object and adding a completed switch tag to the target dynamic storage object.

[0182] Further optionally, before detecting whether the target dynamic storage object is tagged as waiting for switching, the method further includes: in response to an application deployment request for the application sent by the cloud node, creating and running a target Pod that references the target PVC; during the running of the target Pod, determining the identifier of the first storage resource based on the identifier of the target PVC, the first binding relationship, the second binding relationship, and the third binding relationship; and mounting the first storage resource to the mount point of the target Pod based on the identifier of the first storage resource.

[0183] Further optionally, based on the established fourth binding relationship between the target dynamic storage object and the second storage resource, the storage resource currently mounted on the mount point of the target Pod is switched from the first storage resource to the second storage resource, including: determining the identifier of the second storage resource based on the fourth binding relationship; logging into the second storage resource on the edge node based on the identifier of the second storage resource; unmounting the first storage resource from the mount point of the target Pod and logging out of the first storage resource from the edge node; and mounting the second storage resource on the mount point of the target Pod.

[0184] Further optionally, before logging the first storage resource off the edge node, it also includes determining that the first storage resource is not referenced by other Pods.

[0185] The implementation of each step of the storage resource switching method in this embodiment can be found in the foregoing embodiments, and will not be repeated here.

[0186] The technical solution provided in this application, during the process of switching storage resources for an application, decouples the association between the PV and the storage resource through dynamic storage objects. This allows for the dynamic maintenance of the association between the DS and the storage resource while ensuring that the relationships between the Pod, PVC, PV, and storage resource remain unchanged. Consequently, a PV can be bound to different storage resources as needed, enabling the dynamic switching of storage resources for the application without rebuilding the Pod, PVC, and PV. This solves the problem of needing to rebuild the Pod, PVC, and PV to update storage resources for an application, simplifying the switching chain and making the switching process more lightweight and efficient. Compared to rebuilding the Pod, PVC, and PV to update storage resources, edge nodes directly use dynamic storage objects, reducing the average time per update from 40 seconds to 900 milliseconds, achieving millisecond-level perceptible switching and improving update efficiency.

[0187] Figure 11 This is a schematic diagram of a storage resource switching device provided in an embodiment of this application. See also... Figure 11 The device may include:

[0188] The receiving module 10 is used to receive a resource switching request for an application sent by a user terminal, wherein the application has used a first storage resource that meets the first resource requirement information, and the resource switching request includes a second resource requirement information and the identifier of the target Pod corresponding to the application.

[0189] The lookup module 20 is used to look up a second storage resource among multiple storage resources that meets the second resource requirement information in response to a resource switching request for an application.

[0190] The dynamic storage object determination module 30 is used to obtain the identifier of the target PVC referenced by the target Pod based on the identifier of the target Pod, and determine the identifier of the target dynamic storage object based on the identifier of the target PVC, the first binding relationship between the target PVC and the target PV and the second binding relationship between the target PV and the target dynamic storage object.

[0191] The binding processing module 40 is used to remove the third binding relationship between the target dynamic storage object and the first storage resource based on the identifier of the target dynamic storage object, establish a fourth binding relationship between the target dynamic storage object and the second storage resource, and affix a waiting-to-switch tag to the target dynamic storage object.

[0192] Further optionally, the above device also includes: a notification module, used to notify the user terminal that the storage resource has been switched for the application in response to the detection of the completion switch tag of the target dynamic storage object; wherein, the completion switch tag of the target dynamic storage object is attached by the edge node after deleting the waiting switch tag of the target dynamic storage object, and the edge node deletes the waiting switch tag of the target dynamic storage object after switching the storage resource currently mounted on the mount point of the target Pod from the first storage resource to the second storage resource.

[0193] Further optionally, the above apparatus further includes: a sending module, configured to send an application deployment request for the application to the edge node before receiving a resource switching request for the application sent by the user terminal, so that the edge node creates and runs a target Pod referencing the target PVC, and during the running of the target Pod, mounts a first storage resource to the mount point of the target Pod according to a first binding relationship, a second binding relationship and a third binding relationship to complete the application deployment.

[0194] Further optionally, before sending the application deployment request for the application to the edge node, the receiving module is also configured to: receive the resource request for the application sent by the user terminal, the resource request including first resource requirement information and mode indication information, the mode indication information being used to indicate whether to use dynamic storage mode;

[0195] The binding processing module 40 is also used to respond to a resource request by creating a target PVC and a first storage resource based on the first resource requirement information, as well as creating a target PV and establishing a first binding relationship; if the mode indication information indicates the use of dynamic storage mode, then creating a target dynamic storage object and establishing a second binding relationship and a third binding relationship.

[0196] Figure 11 The device shown can perform Figure 9 The implementation principle and technical effects of the method shown in the embodiments will not be elaborated further.

[0197] Figure 12 A schematic diagram of another storage resource switching device provided in an embodiment of this application. This device is applied to an edge node, see [link / reference]. Figure 12 The device may include:

[0198] Detection module 10 is used to detect whether the target dynamic storage object is tagged with a "waiting to switch" label;

[0199] The switching module 20 is used to switch the storage resource currently mounted on the mount point of the target Pod from the first storage resource to the second storage resource if a waiting switching tag of the target dynamic storage object is detected, based on the established fourth binding relationship between the target dynamic storage object and the second storage resource.

[0200] Further optionally, after switching the storage resource currently mounted on the mount point of the target Pod from the first storage resource to the second storage resource according to the fourth binding relationship, the switching module 20 is also used to: delete the waiting switching tag of the target dynamic storage object and add a completed switching tag to the target dynamic storage object.

[0201] Further optionally, the above apparatus also includes: a mounting module, used to create and run a target Pod referencing the target PVC in response to an application deployment request sent by a cloud node before detecting whether the target dynamic storage object is tagged as waiting for switching; during the running of the target Pod, determining the identifier of the first storage resource based on the identifier of the target PVC, the first binding relationship, the second binding relationship, and the third binding relationship; and mounting the first storage resource to the mount point of the target Pod based on the identifier of the first storage resource.

[0202] Optionally, when the mounting module switches the storage resource currently mounted on the mount point of the target Pod from the first storage resource to the second storage resource according to the fourth binding relationship, it is specifically used to: determine the identifier of the second storage resource according to the fourth binding relationship; log in to the second storage resource on the edge node according to the identifier of the second storage resource; unmount the first storage resource from the mount point of the target Pod and log out of the first storage resource from the edge node; and mount the second storage resource on the mount point of the target Pod.

[0203] Further optionally, the mounting module is also used to: determine that the first storage resource is not referenced by other Pods before logging the first storage resource off the edge node.

[0204] Figure 12 The device shown can perform Figure 10 The implementation principle and technical effects of the method shown in the embodiments will not be elaborated further.

[0205] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 201 to 202 can be device A; or the execution subject of step 201 can be device A, and the execution subject of step 202 can be device B; and so on.

[0206] Furthermore, in some of the processes described in the above embodiments and accompanying drawings, multiple operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 201, 202, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.

[0207] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0208] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 13As shown, the electronic device includes: a memory 11 and a processor 12;

[0209] Memory 11 is used to store computer programs and can be configured to store various other data to support operation on the computing platform. Examples of this data include instructions for any application or method operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc.

[0210] The memory 11 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random-access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0211] The processor 12, coupled to the memory 11, is used to execute a computer program in the memory 11 for: performing steps in the storage resource switching method.

[0212] Optional, such as Figure 13 As shown, the electronic device also includes other components such as a communication component 13, a display 14, a power supply component 15, and an audio component 16. Figure 13 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 13 The components shown. Additionally... Figure 13 The components within the dashed box are optional, not mandatory, and their specific requirements depend on the product form of the electronic device. The electronic device in this embodiment can be a desktop computer, laptop computer, smartphone, or IoT (Internet of Things) device, or a server-side device such as a conventional server, cloud server, or server array. If the electronic device in this embodiment is a desktop computer, laptop computer, or smartphone, it may include... Figure 13 The components within the dashed box; if the electronic device in this embodiment is implemented as a conventional server, cloud server, or server array, etc., it may be omitted. Figure 13 The component within the dashed box.

[0213] For a detailed description of the implementation process of each action by the processor, please refer to the relevant descriptions in the foregoing method embodiments or device embodiments, which will not be repeated here.

[0214] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be performed by an electronic device in the above method embodiments.

[0215] Accordingly, this application also provides a computer program product, including a computer program / instructions, which, when executed by a processor, enables the processor to perform the steps that can be executed by an electronic device in the above method embodiments.

[0216] The aforementioned communication components are configured to facilitate wired or wireless communication between the device containing the communication components and other devices. The device containing the communication components can access wireless networks based on communication standards, such as WiFi (Wireless Fidelity), 2G (2nd Generation), 3G (3rd Generation), 4G (4th Generation) / LTE (long Term Evolution), 5G (5th Generation), or combinations thereof. In one exemplary embodiment, the communication components receive broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication components also include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth, and other technologies.

[0217] The aforementioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen can be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation.

[0218] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.

[0219] The aforementioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0220] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0221] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0222] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0223] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0224] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interfaces, network interfaces, and memory.

[0225] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0226] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random-access memory (SRAM), dynamic random-access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. As defined in this article, computer-readable media do not include transient media, such as modulated data signals and carrier waves.

[0227] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0228] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A storage resource switching system, characterized in that, include: Cloud nodes and edge nodes that work together in a collaborative manner; The cloud node is configured to receive resource switching requests for an application, wherein the application has used a first storage resource that meets first resource requirement information, and the resource switching request includes second resource requirement information and the identifier of the target Pod corresponding to the application; in response to the resource switching request for the application, it searches for a second storage resource among multiple storage resources that meets the second resource requirement information; it obtains the identifier of the target PVC referenced by the target Pod based on the identifier of the target Pod, and determines the identifier of the target dynamic storage object based on the identifier of the target PVC, a first binding relationship between the target PVC and the target PV, and a second binding relationship between the target PV and the target dynamic storage object; based on the identifier of the target dynamic storage object, it releases the third binding relationship between the target dynamic storage object and the first storage resource, establishes a fourth binding relationship between the target dynamic storage object and the second storage resource, and marks the target dynamic storage object with a "waiting for switching" tag; The edge node is used to detect whether the target dynamic storage object is tagged with a waiting-to-switch label; if the waiting-to-switch label of the target dynamic storage object is detected, the storage resource currently mounted on the mount point of the target Pod is switched from the first storage resource to the second storage resource according to the fourth binding relationship.

2. A storage resource switching method, characterized in that, Applied to cloud nodes, the method includes: Receive a resource switching request for an application sent by a user client, wherein the application has used a first storage resource that meets the first resource requirement information, and the resource switching request includes a second resource requirement information and the identifier of the target Pod corresponding to the application; In response to a resource switching request from an application, a second storage resource that meets the second resource requirement information is located among multiple storage resources. The identifier of the target PVC referenced by the target Pod is obtained based on the identifier of the target Pod, and the identifier of the target dynamic storage object is determined based on the identifier of the target PVC, the first binding relationship between the target PVC and the target PV, and the second binding relationship between the target PV and the target dynamic storage object. Based on the identifier of the target dynamic storage object, the third binding relationship between the target dynamic storage object and the first storage resource is released, and a fourth binding relationship between the target dynamic storage object and the second storage resource is established, and a "waiting to switch" tag is affixed to the target dynamic storage object.

3. The method according to claim 2, characterized in that, Also includes: In response to detecting the completion switch tag of the target dynamic storage object, the client is notified that the storage resource has been switched for the application. The completion switch tag of the target dynamic storage object is added by the edge node after it deletes the waiting switch tag of the target dynamic storage object. The edge node deletes the waiting switch tag of the target dynamic storage object after switching the storage resource currently mounted on the mount point of the target Pod from the first storage resource to the second storage resource.

4. The method according to any one of claims 2 to 3, characterized in that, Before receiving a resource switching request for the application sent by the user, it also includes: An application deployment request for the application is sent to the edge node, so that the edge node creates and runs the target Pod that references the target PVC. During the running of the target Pod, the first storage resource is mounted to the mount point of the target Pod according to the first binding relationship, the second binding relationship and the third binding relationship to complete the application deployment.

5. The method according to claim 4, characterized in that, Before sending the application deployment request for the application to the edge node, the process also includes: The application receives a resource request sent by the user terminal, the resource request including the first resource requirement information and mode indication information, the mode indication information being used to indicate whether to use dynamic storage mode; In response to the resource request, the target PVC and the first storage resource are created based on the first resource requirement information, and the target PV is created, and the first binding relationship is established; If the mode indication information indicates the use of dynamic storage mode, then the target dynamic storage object is created, and the second binding relationship and the third binding relationship are established.

6. A storage resource switching method, characterized in that, Applied to edge nodes, the method includes: Detect whether the target dynamic storage object is tagged with "Waiting to switch"; If the waiting switch tag of the target dynamic storage object is detected, the storage resource currently mounted on the mount point of the target Pod will be switched from the first storage resource to the second storage resource according to the established fourth binding relationship between the target dynamic storage object and the second storage resource.

7. The method according to claim 6, characterized in that, After switching the currently mounted storage resource of the target Pod from the first storage resource to the second storage resource based on the established fourth binding relationship between the target dynamic storage object and the second storage resource, the process also includes: Delete the pending switch tag from the target dynamic storage object and add a completed switch tag to the target dynamic storage object.

8. The method according to claim 6, characterized in that, Before detecting whether the target dynamic storage object is tagged with a "waiting for switching" label, the process also includes: In response to an application deployment request for the application sent by a cloud node, create and run the target Pod that references the target PVC; During the execution of the target Pod, the identifier of the first storage resource is determined based on the identifier of the target PVC, the first binding relationship, the second binding relationship, and the third binding relationship; and the first storage resource is mounted to the mount point of the target Pod based on the identifier of the first storage resource.

9. The method according to claim 7, characterized in that, Based on the established fourth binding relationship between the target dynamic storage object and the second storage resource, the storage resource currently mounted on the mount point of the target Pod is switched from the first storage resource to the second storage resource, including: The identifier of the second storage resource is determined based on the fourth binding relationship; Log the second storage resource on the edge node according to the identifier of the second storage resource; Unmount the first storage resource from the mount point of the target Pod and log out of the first storage resource from the edge node; The second storage resource is mounted on the mount point of the target Pod.

10. The method according to claim 9, characterized in that, Before logging the first storage resource off the edge node, the method further includes: It was determined that the first storage resource was not referenced by other Pods.

11. An electronic device, characterized in that, include: Memory and processor; The memory is used to store computer programs; The processor is coupled to the memory for executing the computer program to perform the steps of the method according to any one of claims 2-10.

12. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method according to any one of claims 2-10.

13. A computer program product, characterized in that, Includes a computer program / instruction that, when executed by a processor, causes the processor to perform the steps of the method according to any one of claims 2-10.