Data volume change method, device, equipment and storage medium

By combining the remount and restart of containers under the change mechanism of the parent and child directories of the data volume, the problem of low data volume change efficiency in the existing technology is solved, efficient and flexible data volume changes are achieved, and storage resource waste is reduced and the stability of the file system is improved.

CN114064210BActive Publication Date: 2025-08-26BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111348035.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-15
Publication Date
2025-08-26
Estimated Expiration
2041-11-15

AI Technical Summary

Technical Problem

In the prior art, the data volume change process requires the container to be stopped, resulting in inefficient change and the flexible change of the data volume cannot be achieved without stopping the container.

Method used

By introducing the concepts of parent directory and subdirectories of data volumes, change the name of the subdirectories of data volumes, and add subdirectories under the parent directory of data volumes, combining the remount and restart of containers, the data volume directory changes are realized.

Benefits of technology

Improves the efficiency and flexibility of data volume changes, reduces labor costs, avoids waste of storage resources, and ensures the stability of the file system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064210B_ABST
    Figure CN114064210B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data volume change method, a data volume change device, an electronic device, and a non-transient computer-readable storage medium, which relate to the field of computer technology, in particular to cloud computing technology, and can be used in the field of cloud phones. The specific implementation scheme is: in response to a data volume change request for a target container group, obtain the data volume directory mounted by the target container group; the data volume directory includes a data volume parent directory corresponding to a remote absolute path and a data volume subdirectory corresponding to a local relative path; change the original name of the data volume subdirectory; add a replacement subdirectory with the original name under the data volume parent directory; remount the target container group under the data volume directory, and restart the container in the target container group. According to the technology disclosed in the present disclosure, the efficiency of data volume changes, the flexibility of data volume changes, and the accuracy of data volume change results are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, in particular to cloud computing technology, and can be used in the field of cloud phones. Specifically, it relates to a data volume change method, a data volume change device, an electronic device, and a non-transient computer-readable storage medium. Background Art

[0002] With the rapid development of virtualization technology, container technology, which is more lightweight than virtual machines, has emerged.

[0003] Containers encapsulate applications and the environment in which they run, eliminating the need for an operating system installation and sharing the same kernel as the host machine. Data generated by running applications can be persisted in data volumes mounted within the container. Summary of the Invention

[0004] The present disclosure provides a data volume change method, a data volume change device, an electronic device, and a non-transitory computer-readable storage medium.

[0005] According to one aspect of the present disclosure, a method for changing a data volume is provided, comprising:

[0006] In response to a data volume change request for a target container group, obtaining a data volume directory mounted on the target container group; the data volume directory includes a data volume parent directory corresponding to a remote absolute path and a data volume subdirectory corresponding to a local relative path;

[0007] Change the original name of the data volume subdirectory;

[0008] Add a replacement subdirectory with the original name under the parent directory of the data volume;

[0009] Remount the target container group to the data volume directory and restart the containers in the target container group.

[0010] According to another aspect of the present disclosure, there is also provided an electronic device, including:

[0011] at least one processor; and

[0012] a memory communicatively connected to at least one processor; wherein,

[0013] The memory stores instructions that can be executed by at least one processor. The instructions are executed by the at least one processor so that the at least one processor can execute any one of the data volume change methods provided in the present disclosure.

[0014] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is further provided, wherein the computer instructions are used to enable a computer to execute any one of the data volume change methods provided in the present disclosure.

[0015] According to the technology disclosed in the present invention, the efficiency, flexibility and accuracy of data volume changes are improved.

[0016] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.

[0018] Figure 1 This is a flow chart of a data volume change method provided by an embodiment of the present disclosure;

[0019] Figure 2 is a flow chart of another data volume change method provided by an embodiment of the present disclosure;

[0020] Figure 3A This is a structural diagram of a data volume deletion system provided by an embodiment of the present disclosure;

[0021] Figure 3B This is a flow chart of a data volume deletion method provided by an embodiment of the present disclosure;

[0022] Figure 4 This is a structural diagram of a data volume change device provided by an embodiment of the present disclosure;

[0023] Figure 5 It is a block diagram of an electronic device used to implement the data volume change method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0025] The data volume modification methods and data volume modification devices provided herein are applicable to modifying the data volumes mounted on the container group that implements a business application, such as during initialization or upgrade of the business application. The data volume modification methods provided herein can be performed by a data volume modification device, which can be implemented using software and / or hardware and specifically configured in an electronic device, such as a working node deployed with a container, such as a server.

[0026] See also Figure 1 A data volume change method shown includes:

[0027] S101. In response to a data volume change request for a target container group, obtain a data volume directory mounted on the target container group; the data volume directory includes a data volume parent directory corresponding to a remote absolute path and a data volume subdirectory corresponding to a local relative path.

[0028] A pod is the smallest deployable unit in an open-source system for deploying, scaling, and managing containerized applications. A pod can include at least one application container, storage resources, a unique network IP (Internet Protocol) address, and options for determining how the container runs. A pod represents an independent instance of an application running in an open-source system, which can consist of a single container or at least two tightly coupled containers. The target pod is the container pod that has a data volume change requirement in this disclosure.

[0029] The disclosed data volume is essentially a specially designated virtual directory that leverages the container group's joint file system to provide stable features or data sharing for the container group, enabling the data volume to be shared between containers within the container group. A data volume change request can be a request to reset or replace the data volume.

[0030] Optionally, the data volume change request may be generated on a scheduled basis, such as periodically. Alternatively, the data volume change request may be triggered when there is a need to change the data volume.

[0031] In an optional embodiment, the data volume change request may be generated based on a reset operation on an annotation field of a target container group object.

[0032] Specifically, an annotation field is set in the target container group object to indicate changes to the data volume mounted by the target container group. Exemplarily, in response to a reset operation on the annotation field of the target container group object, the field value of the annotation field is set to the reset field value, indicating that a data volume change request for the data volume mounted by the target container group exists, and a data volume change request is generated.

[0033] It can be understood that by adding an annotation field to the target container group object and generating a data volume change request based on the setting operation of the annotation field, the method of generating data volume change requests is simplified, the operation is convenient, and it can adapt to batch setting scenarios, which helps to improve the efficiency of data volume changes.

[0034] It should be noted that the data volume change request can be generated locally on the working node (i.e., computing device) that executes the data volume change method, or on other devices that are in communication with the working node, such as a control node. Thus, by a single setting of the control node, the data volume mounted on the target container group of at least one connected working node can be changed.

[0035] In one specific implementation, the annotation fields of the target container group objects can be reset by a reset operation (e.g., a factory reset operation) performed by the business application operator. In another specific implementation, when batch downloading, batch upgrading, or batch resetting of business applications is required, the annotation fields of the target container group objects can be reset by the administrator touching the corresponding functional area on the management interface.

[0036] The data volume directory includes a data volume parent directory and a data volume subdirectory under the data volume parent directory. The data volume parent directory corresponds to a remote absolute path, which is managed by the remote server. Therefore, during the data volume mounting period, the data volume parent directory cannot be arbitrarily changed. The data volume subdirectory corresponds to a local relative path, which is assigned an access identifier by the local operating system. Therefore, during the data volume mounting period, the local relative path can be changed by modifying the directory name of the data volume subdirectory and having the operating system reallocate the access identifier, thereby changing the data volume directory.

[0037] It should be noted that, in existing technologies, the data volume directory only sets a single-level directory corresponding to the remote absolute path, without introducing secondary directories corresponding to parent and child directories. Therefore, it is impossible to modify the data volume without stopping the running container. If the container is stopped for modification, the container in the target container group must wait until the data volume modification is completed before restarting, which reduces the modification efficiency.

[0038] S102. Change the original name of the data volume subdirectory.

[0039] Optionally, the original name of the data volume subdirectory can be modified using a preset naming rule. For example, the preset naming rule can be implemented based on a random generation algorithm.

[0040] Alternatively, you can change the data volume subdirectory from its original name to the target name, ensuring that the target name is an unused directory name under the data volume parent directory, thereby avoiding the constraints of naming rules and the inconvenience caused by duplicate naming.

[0041] S103. Add a replacement subdirectory with the original name under the parent directory of the data volume.

[0042] The replacement subdirectory can be understood as a new subdirectory used to replace the original data volume subdirectory corresponding to the local relative path in the data volume directory when the data volume directory is changed.

[0043] By adding a replacement subdirectory with the original name under the parent directory of the data volume, the replacement subdirectory replaces the original data volume subdirectory, thereby changing the data volume directory at the directory content level.

[0044] The replacement subdirectory can be an empty subdirectory, a subdirectory containing settings, or a new subdirectory generated by migrating a folder containing settings from another location. The replacement subdirectory and the settings contained in the replacement subdirectory can be adjusted based on the actual application scenario.

[0045] In an optional embodiment, a base configuration subdirectory with the original directory name can be added as a replacement subdirectory under the data volume parent directory. The base configuration subdirectory contains the basic configuration data for implementing the business functions of the target container group. It will be appreciated that using the base configuration subdirectory containing the basic configuration data as a replacement subdirectory facilitates replacing the contents of the data volume.

[0046] Specifically, if the target container group encapsulates a business application that implements the set business function, when the business application needs to be reset to the default version, the folder corresponding to the basic configuration data of the default version is added to the parent directory of the data volume, thereby generating a substitute subdirectory.

[0047] It should be noted that the folder corresponding to the basic configuration data can be pre-set in the parent directory of the data volume. You only need to change the folder name to the original name to modify the replacement subdirectory. The folder corresponding to the basic configuration data can be pre-set in another directory. You can first rename the folder to the original name and then migrate the renamed folder to the parent directory of the data volume; or you can first migrate the folder to the parent directory of the data volume and then rename the migrated folder to the original name.

[0048] In another optional embodiment, an empty subdirectory with the target name being the original name can be created under the data volume parent directory as a substitute subdirectory. It is understandable that by adopting the empty subdirectory as the substitute subdirectory, it helps to delete the content of the data volume.

[0049] Specifically, an empty folder with the original name can be created under the parent directory of the data volume, thereby creating an empty subdirectory with the original name under the parent directory of the data volume, thereby achieving the effect of the empty subdirectory as a substitute subdirectory.

[0050] S104: Remount the target container group to the data volume directory and restart the containers in the target container group.

[0051] It should be noted that when the data volume subdirectory is replaced with a substitute subdirectory whose directory name is the original name, the change of the data volume directory is only realized at the content level. Since the data volume subdirectory corresponding to the local relative path is accessed through the access identifier assigned by the operating system, at this time, the access identifier still corresponds to the data volume subdirectory after the original name is changed, rather than the substitute subdirectory. Therefore, it is also necessary to reallocate the access identifier for the local relative path corresponding to the data volume subdirectory by remounting the data volume directory and restarting the container in the target container group, thereby replacing the access identifier of the local relative path of the data volume directory with the access identifier of the substitute subdirectory, thereby realizing the change of the data volume directory at the access level.

[0052] Based on the above technical solutions, excessive unused data volume subdirectories under the data volume parent directory can waste storage resources. To avoid this, subdirectories under the data volume parent directory with names different from the original ones can be periodically deleted, thereby clearing out subdirectories with non-original names, i.e., unused data volume subdirectories. This saves storage resources and helps improve the overall performance of the device executing the data volume modification method.

[0053] It should be noted that the present disclosure does not impose any restrictions on the deletion duration, deletion cycle and deletion interval of periodic deletion, which can be set or adjusted by technical personnel based on actual needs or experience, or determined through a large number of experiments.

[0054] The disclosed embodiment achieves changes to the data volume directory at the content level by setting the data volume directory to include a data volume parent directory corresponding to a remote absolute path and a data volume subdirectory corresponding to a local relative path, and by changing the directory name of the data volume subdirectory and adding a replacement subdirectory with the same name; and achieves changes to the data volume directory at the access level by remounting the data volume of the target container group and restarting the container of the container in the target container group. The above technical solution does not require stopping the container in the target container group before the data volume is changed, and does not require waiting for the data volume change, thereby improving the efficiency of data volume changes. At the same time, the above solution is implemented in an automated manner, without the need for manual intervention, reducing labor costs and further improving the efficiency of data volume changes. In addition, when multiple data volumes are mounted, the above solution can select some data volumes for change processing according to needs, making the data volume change process more flexible.

[0055] Based on the above technical solutions, this disclosure also provides an optional embodiment. In this optional embodiment, the operation of changing the original name of the data volume subdirectory is optimized and improved. It should be noted that for the undisclosed parts of this embodiment, please refer to the relevant descriptions of the above embodiments.

[0056] See also Figure 2 A data change method shown includes:

[0057] S201. In response to a data volume change request for a target container group, obtain a data volume directory mounted on the target container group; the data volume directory includes a data volume parent directory corresponding to a remote absolute path and a data volume subdirectory corresponding to a local relative path.

[0058] S202. Change the data volume subdirectory from its original name to a target name; the target name is an unused directory name under the data volume parent directory.

[0059] By changing the name of the data volume subdirectory to an unused target name under the data volume parent directory, the impact caused by the changed name being the same as the used directory name is avoided.

[0060] The target name may be realized by using at least one name generation method in the prior art, and the present disclosure does not impose any limitation on the method for generating the target name.

[0061] In an optional embodiment, the target name may be directly generated based on the current timestamp and a random number.

[0062] In another optional embodiment, the used directory name under the parent directory of the data volume can be identified and the identification result can be used as a reference name; a target name is generated based on the reference name, and the directory name of the data volume subdirectory is renamed to the target name.

[0063] Exemplarily, the folder names of each existing folder under the parent directory of the data volume can be read as reference names; at least part of the reference names can be modified to generate target names different from the reference names; and the directory names of the data volume subdirectories can be renamed to the target names.

[0064] In a specific implementation, the folder name of an existing folder under the parent directory of the data volume is read as a reference name; wherein the reference name includes a unified identifier and a serial number identifier; the serial number value of the serial number identifier in each reference name is obtained; the serial number value is increased or decreased according to a preset step size to obtain a target serial number value; and the target name is obtained based on the combination of the unified identifier and the target serial number value.

[0065] For example, if the data volume directory is "volume_parent / volume_child_0", where the data volume parent directory is named "volume_parent" and the data volume child directory is named "volume_child_0", and there are no other subdirectories under the data volume parent directory, that is, there are no other folders under the data volume parent directory except "volume_child_0", then the data volume child directory's name can be changed from "volume_child_0" to "volume_child_1". Continuing with the previous example, if there is another subdirectory named "volume_child_1" under the data volume parent directory, that is, the data volume parent directory includes two folders, "volume_child_0" and "volume_child_1", then the data volume child directory's name can be changed from "volume_child_0" to "volume_child_2", which is different from "volume_child_1".

[0066] It can be understood that by introducing the identification of used reference names and generating target names different from the reference names, the impact caused by the generated target names being the same as the used directory names is avoided. At the same time, the target name generation method is simplified, the amount of data calculation for target name generation is reduced, and the target name generation efficiency is improved, which helps to improve the change efficiency of data volume changes and the accuracy of change results.

[0067] Typically, to ensure the stability of the file system on the device where the data volume modification method is executed, only one valid subdirectory exists under the data volume parent directory. That is, only one subdirectory (the one with the same name as the original) is mounted in the target container group, and all other subdirectories are invalid. To reduce the storage space occupied by invalid subdirectories, you can periodically delete subdirectories under the data volume parent directory that have different names than the original.

[0068] When the data volume mounted by the target container group changes frequently and subdirectories under the parent directory of the data volume with different names from the original ones have not been regularly deleted, a large number of invalid subdirectories will exist under the parent directory of the data volume, resulting in a waste of storage resources and affecting device operating efficiency. To avoid this, in an optional embodiment, a replacement subdirectory with the original name can be added to the parent directory of the data volume, and then the subdirectory with the same name as the target one under the parent directory of the data volume can be deleted. Thus, after the data volume subdirectory under the parent directory of the data volume is replaced, the subdirectory before the replacement is deleted, saving storage space.

[0069] It should be noted that in order to avoid deletion failure or incomplete deletion, you can also regularly delete subdirectories under the parent directory of the data volume that have different names from the original ones, thereby achieving a comprehensive deletion.

[0070] S203. Add a replacement subdirectory with the original name under the parent directory of the data volume.

[0071] S204: Remount the target container group to the data volume directory and restart the containers in the target container group.

[0072] The disclosed embodiment refines the operation of changing the original name of the data volume subdirectory into changing the data volume subdirectory from the original name to the target name; the target name is an unused directory name under the parent directory of the data volume, thereby avoiding the target name being the same as the used directory name under the parent directory of the data volume, which may cause data volume change failure or other impacts, and helps to improve the efficiency of data volume change and the stability of the file system of the device where the data volume change method is executed.

[0073] On the basis of the above technical solutions, the present disclosure also provides a preferred embodiment for realizing data volume deletion. Figure 3A A data volume deletion system and Figure 3B The flowchart of a data volume deletion method is shown in FIG. , and is described in detail. The data volume deletion method includes:

[0074] S301: In response to a reset operation by an operator, a control node sets the annotation field of a target container group object to a deletion flag and generates a data volume deletion request.

[0075] S302: The working node monitors the control node and obtains a data volume deletion request.

[0076] S303. The working node obtains the data volume directory mounted by the target container group; the data volume directory includes a data volume parent directory corresponding to the remote absolute path and a data volume subdirectory corresponding to the local relative path.

[0077] S304: Rename the original name of the data volume subdirectory to an unused target name in the data volume parent directory.

[0078] S305. Create an empty subdirectory with the original name under the parent directory of the data volume.

[0079] S306: Delete the subdirectory with the same name as the target directory under the parent directory of the data volume.

[0080] S307: Remount the target container group to the data volume directory and restart the containers in the target container group.

[0081] S308. Regularly delete subdirectories under the parent directory of the data volume that have different names from the original ones.

[0082] The data volume deletion method disclosed in the present invention automates the data volume deletion process without manual intervention, improves the efficiency of data volume deletion, and is suitable for application scenarios such as rapid resetting of cloud hosts. In addition, the above-mentioned data volume deletion operation does not require stopping the operation of the containers in the target container group before deletion, nor does it require a long data volume deletion waiting time, thereby improving deletion efficiency. At the same time, the above-mentioned solution can retain temporary data in the target container group, and in a multi-data volume scenario, supports the cleanup of a specified data volume while retaining the content in other data volumes, which is more flexible.

[0083] As an implementation of the above-mentioned data volume change methods, the present disclosure also provides an optional embodiment of an execution device for implementing the data volume change method. Figure 4 A data volume change method shown includes:

[0084] See also Figure 4 The data volume change device shown in the figure includes: a data volume directory acquisition module 401, an original name change module 402, a replacement subdirectory addition module 403 and a mount restart module 404.

[0085] The data volume directory acquisition module 401 is configured to obtain the data volume directory mounted on the target container group in response to a data volume change request for the target container group; the data volume directory includes a data volume parent directory corresponding to a remote absolute path and a data volume subdirectory corresponding to a local relative path;

[0086] The original name changing module 402 is used to change the original name of the data volume subdirectory;

[0087] A substitute subdirectory adding module 403 is used to add a substitute subdirectory with the original name under the parent directory of the data volume;

[0088] The mount and restart module 404 is used to remount the target container group to the data volume directory and restart the containers in the target container group.

[0089] The disclosed embodiment achieves changes to the data volume directory at the content level by setting the data volume directory to include a data volume parent directory corresponding to a remote absolute path and a data volume subdirectory corresponding to a local relative path, and by changing the directory name of the data volume subdirectory and adding a replacement subdirectory with the same name; and achieves changes to the data volume directory at the access level by remounting the data volume of the target container group and restarting the container of the container in the target container group. The above technical solution does not require stopping the container in the target container group before the data volume is changed, and does not require waiting for the data volume change, thereby improving the efficiency of data volume changes. At the same time, the above solution is implemented in an automated manner, without the need for manual intervention, reducing labor costs and further improving the efficiency of data volume changes. In addition, when multiple data volumes are mounted, the above solution can select some data volumes for change processing according to needs, making the data volume change process more flexible.

[0090] In an optional embodiment, the original name changing module 402 includes:

[0091] The original name change unit is used to change the data volume subdirectory from the original name to the target name; the target name is an unused directory name under the data volume parent directory.

[0092] In an optional embodiment, the original name change unit includes:

[0093] The reference name identification subunit is used to identify the used directory name under the parent directory of the data volume and use the identification result as the reference name;

[0094] The target name generation subunit is used to generate a target name according to the reference name and rename the directory name of the data volume subdirectory to the target name.

[0095] In an optional embodiment, the original name changing module 402 further includes:

[0096] The subdirectory deletion unit is used to add a replacement subdirectory with the original name under the parent directory of the data volume, and then delete the subdirectory with the same name as the target name under the parent directory of the data volume.

[0097] In an optional embodiment, the substitute subdirectory adding module 403 includes:

[0098] A basic configuration subdirectory adding unit is used to add a basic configuration subdirectory with the original name under the parent directory of the data volume as a substitute subdirectory; the basic configuration subdirectory includes basic configuration data for the target container group to implement business functions; or,

[0099] The empty subdirectory adding unit is used to create an empty subdirectory with the original name under the parent directory of the data volume as a substitute subdirectory.

[0100] In an optional embodiment, the data volume change device further includes:

[0101] The periodic deletion module is used to periodically delete subdirectories under the parent directory of the data volume that have different names from the original ones.

[0102] In an optional embodiment, the data volume change request is generated based on a reset operation on an annotation field of a target container group object.

[0103] The upper data volume change device can execute the data volume change method provided by any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing each data volume change method.

[0104] In the technical solution disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of the data volume directory involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0105] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0106] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0107] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0108] Various components in device 500 are connected to I / O interface 505, including: an input unit 506, such as a keyboard, mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, optical disk, etc.; and a communication unit 509, such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0109] The computing unit 501 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the data volume change method. For example, in some embodiments, the data volume change method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the data volume change method described above can be performed. Alternatively, in other embodiments, the computing unit 501 can be configured to perform the data volume change method by any other suitable means (e.g., by means of firmware).

[0110] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0111] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0112] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0113] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0114] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0115] A computer system may include a client and a server. The client and server are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services. The server may also be a server in a distributed system or a server integrated with blockchain.

[0116] Cloud computing refers to a technology system that provides network access to elastically scalable shared pools of physical or virtual resources. These resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on-demand in a self-service manner. Cloud computing technology provides efficient and powerful data processing capabilities for the application of technologies such as artificial intelligence and blockchain, as well as for model training.

[0117] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.

[0118] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. A method for changing a data volume, comprising: In response to a data volume change request for a target container group, obtaining a data volume directory mounted on the target container group; The data volume directory includes a data volume parent directory corresponding to a remote absolute path and a data volume subdirectory corresponding to a local relative path; Changing the original name of the data volume subdirectory; Add a replacement subdirectory with the original name under the parent directory of the data volume; Remount the target container group to the data volume directory, and restart the containers in the target container group.

2. The data volume change method according to claim 1, wherein: Changing the original name of the data volume subdirectory includes: The data volume subdirectory is changed from an original name to a target name; the target name is an unused directory name under the data volume parent directory.

3. The data volume change method according to claim 2, wherein: Changing the data volume subdirectory from an original name to a target name includes: Identify the used directory name under the parent directory of the data volume and use the identification result as a reference name; The target name is generated according to the reference name, and the directory name of the data volume subdirectory is renamed to the target name.

4. The data volume change method according to claim 2, wherein: After adding a replacement subdirectory with the original name under the parent directory of the data volume, the method further includes: Delete the subdirectory with the same name as the target under the parent directory of the data volume.

5. The data volume change method according to claim 1, wherein: The step of adding a replacement subdirectory with the original name under the parent directory of the data volume includes: Adding a basic configuration subdirectory with the original name as the replacement subdirectory under the parent directory of the data volume; the basic configuration subdirectory includes basic configuration data for the target container group to implement business functions; or An empty subdirectory with the original name is created under the parent directory of the data volume as the substitute subdirectory.

6. The data volume modification method according to any one of claims 1 to 5, further comprising: Periodically delete subdirectories under the parent directory of the data volume that have names different from the original names.

7. The data volume change method according to any one of claims 1 to 6, wherein: The data volume change request is generated based on a reset setting operation on an annotation field of the target container group object.

8. A data volume modification device, comprising: a data volume directory acquisition module, configured to, in response to a data volume change request for a target container group, acquire a data volume directory mounted on the target container group; The data volume directory includes a data volume parent directory corresponding to a remote absolute path and a data volume subdirectory corresponding to a local relative path; An original name changing module, used for changing the original name of the data volume subdirectory; A substitute subdirectory adding module, configured to add a substitute subdirectory with the original name under the parent directory of the data volume; The mount and restart module is used to remount the target container group to the data volume directory and restart the containers in the target container group.

9. The data volume changing device according to claim 8, wherein: The original name change module includes: The original name changing unit is used to change the data volume subdirectory from an original name to a target name; the target name is an unused directory name under the data volume parent directory.

10. The data volume changing device according to claim 9, wherein: The original name changing unit includes: a reference name identification subunit, configured to identify a used directory name under the parent directory of the data volume and use the identification result as a reference name; The target name generating subunit is configured to generate the target name according to the reference name and rename the directory name of the data volume subdirectory to the target name.

11. The data volume changing device according to claim 9, wherein: The original name change module further includes: The subdirectory deleting unit is configured to delete the subdirectory with the same name as the target name under the parent directory of the data volume after adding a replacement subdirectory with the original name under the parent directory of the data volume.

12. The data volume changing device according to claim 8, wherein: The substitute subdirectory adding module includes: A basic configuration subdirectory adding unit is configured to add a basic configuration subdirectory with the original name as the replacement subdirectory under the data volume parent directory; the basic configuration subdirectory includes basic configuration data for the target container group to implement business functions; or The empty subdirectory adding unit is used to create an empty subdirectory with the original name under the parent directory of the data volume as the substitute subdirectory.

13. The data volume modification device according to any one of claims 8 to 12, further comprising: The periodic deletion module is used to periodically delete subdirectories under the parent directory of the data volume that have names different from the original names.

14. The data volume changing device according to any one of claims 8 to 13, wherein: The data volume change request is generated based on a reset setting operation on an annotation field of the target container group object.

15. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to execute the data volume change method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable a computer to execute the data volume change method according to any one of claims 1 to 7.

17. A computer program product, comprising a computer program / instruction, wherein when the computer program / instruction is executed by a processor, the steps of the data volume change method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Data persistence processing method, device and system and readable storage medium

    CN110019081A

  • File processing method and device, electronic equipment and storage medium

    CN112905537A