Device environment snapshotting methods and apparatuses, replication methods and apparatuses, computing devices
By combining the OverlayFS file system with Git or SVN repositories, automated snapshot management and batch deployment of the device environment are achieved, solving the problem of manual snapshot management in existing technologies and improving operation and maintenance efficiency and storage space utilization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNIONTECH SOFTWARE TECH CO LTD
- Filing Date
- 2022-06-16
- Publication Date
- 2026-07-17
AI Technical Summary
Existing snapshot technology cannot achieve automated management; the generated snapshots need to be manually named and managed, which cannot achieve high efficiency in batch deployment and operation and maintenance.
It adopts a combination of file system and repository, using the OverlayFS file system and Git or SVN repository to achieve automated snapshot management by pulling, saving and pushing directory files, and supports remote or local deployment.
It enables automated snapshot management of the device environment, supports batch deployment and maintenance, automatically generates traceable snapshots, saves storage space, and automates the management of snapshot time points and notes.
Smart Images

Figure CN115168286B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network system snapshot technology, and in particular to a device environment snapshot method and apparatus, a copying method and apparatus, a computing device, and a readable storage medium. Background Technology
[0002] Operating systems, especially those driven by specific industry needs, require a network system snapshot technology (NAS system snapshot technology) to ensure system stability, data security, ease of operation and maintenance, and high production efficiency. This involves batch deployment, production, and maintenance through a remote, distributed approach to enable efficient business operations. This NAS system snapshot technology needs to address issues such as batch production, batch deployment, batch operation and maintenance, system protection, and system backup, thereby reducing costs at each stage of business production.
[0003] Current snapshot technology is based on creating snapshots using the Btrfs file system. This involves formatting a volume or disk as a Btrfs file system, mounting that volume or disk as the storage medium to the directory that needs to be backed up, and then using the command `sudo btrfs subvolume snapshot` to take a snapshot of the specified directory (provided that the directory being snapshotted is mounted on a Btrfs formatted storage medium).
[0004] The Btrfs file system can also perform incremental snapshots, which can effectively reduce storage space usage and also enable version rollback, but the rollback operation must be based on the previous snapshot.
[0005] The drawback of the existing snapshot technology is that the generated snapshots are incremental and continuous, requiring a manual naming and management method to manage the snapshot system, and thus cannot achieve automated management. Summary of the Invention
[0006] Therefore, the present invention provides a device environment snapshot method and apparatus, a copying method and apparatus, a computing device, and a readable storage medium, in an attempt to solve or at least alleviate at least one of the problems mentioned above.
[0007] According to a first aspect of the present invention, a device environment snapshot method is provided, which is executed through a combination of a file system and a repository. The file system includes a parent directory and a child directory. The child directory stores the initially installed system of the device, and the parent directory stores the environment deployments made on the device based on the initially installed system. The device environment snapshot method includes: pulling the parent directory from the repository as the parent directory within the file system on the device, wherein the parent directory pulled from the repository is a directory file prepared in advance by the user, and its name is consistent with the name of the parent directory within the file system; saving the environment deployments for the device in the parent directory of the file system; and pushing the environment deployments saved in the parent directory to the repository.
[0008] Optionally, in the device environment snapshot method of the present invention, saving the environment deployment of the first device in the parent directory includes: saving the environment deployment of the device in the parent directory at predetermined time intervals.
[0009] Optionally, in the device environment snapshot method of the present invention, the device pulls a parent directory from a repository as the parent directory within the file system on the device, and the parent directory in the repository already contains environment deployments performed by other devices.
[0010] Optionally, in the device environment snapshot method of the present invention, the repository is a Git repository or an SVN repository.
[0011] According to a second aspect of the present invention, a device environment replication method is provided, executed by another device, the other device including a file system, the file system including a parent directory and a child directory, the child directory storing the initially installed system of the other device, the parent directory being used to store the environment deployment made on the other device based on the initially installed system, the device environment replication method including: the other device pulling the parent directory from a repository as the parent directory within the file system on the other device; wherein the pulled parent directory already contains the environment deployment obtained by the device environment snapshot method described above, the environment deployment serving as the aforementioned "environment deployment made on the other device based on the initially installed system".
[0012] Optionally, in the device environment replication method of the present invention, the other devices pull the parent directory from the repository at predetermined time intervals.
[0013] According to a third aspect of the present invention, a device environment snapshot apparatus is provided, which executes a device environment snapshot method by combining a file system and a repository. The file system includes a parent directory and a child directory. The child directory stores the initially installed system of the device, and the parent directory stores the environment deployment of the device based on the initially installed system. The device environment snapshot apparatus includes: a pull module for pulling the parent directory from the repository as the parent directory within the file system on the device, wherein the parent directory pulled from the repository is a directory file prepared in advance by the user, and its name is consistent with the name of the parent directory within the file system; a save module for saving the environment deployment of the device in the parent directory of the file system; and a push module for pushing the environment deployment saved in the parent directory to the repository.
[0014] According to a fourth aspect of the present invention, a device environment replication apparatus is provided, located in another device, the other device including a file system, the file system including a parent directory and a child directory, the child directory storing the initially installed system of the other device, the parent directory being used to store the environment deployment made on the other device based on the initially installed system, the device environment replication apparatus including: a pull module, which pulls the parent directory from a repository as the parent directory within the file system on the other device; wherein the pulled parent directory already contains the environment deployment obtained by the device environment snapshot method as described in claim 1, the environment deployment serving as the aforementioned "environment deployment made on the other device based on the initially installed system".
[0015] According to a fifth aspect of the present invention, a computing device is provided, comprising: at least one processor and a memory storing program instructions; when the program instructions are read and executed by the processor, the computing device performs the method described above.
[0016] According to a sixth aspect of the present invention, a readable storage medium storing program instructions is provided, which, when read and executed by a computing device, causes the computing device to perform the method described above.
[0017] According to the technical solution of the present invention, the environment can be deployed only once and then copied to multiple devices, enabling batch deployment of devices. Furthermore, the use of a repository allows for local deployment or remote deployment via a server, thereby solving the snapshot version control problem. In other words, it can automatically generate traceable snapshots, automate snapshot management, and automatically complete the snapshot time point and snapshot description notes. Attached Figure Description
[0018] To achieve the foregoing and related objectives, certain illustrative aspects are described herein in conjunction with the following description and accompanying drawings. These aspects indicate various ways in which the principles disclosed herein may be practiced, and all aspects and their equivalents are intended to fall within the scope of the claimed subject matter. The foregoing and other objectives, features, and advantages of this disclosure will become more apparent from the following detailed description, taken in conjunction with the accompanying drawings. Throughout this disclosure, the same reference numerals generally refer to the same parts or elements.
[0019] Figure 1 The overall architecture diagram of the technical solution of the present invention is shown.
[0020] Figure 2 A schematic flowchart illustrating a device environment snapshot method according to an embodiment of the present invention is shown.
[0021] Figure 3 A schematic flowchart illustrating a device environment replication method according to an embodiment of the present invention is shown.
[0022] Figure 4 A schematic block diagram of a device environment snapshot apparatus according to an embodiment of the present invention is shown.
[0023] Figure 5 A schematic block diagram of a device environment replication apparatus according to an embodiment of the present invention is shown.
[0024] Figure 6 A schematic diagram of a computing device according to an embodiment of the present invention is shown. Detailed Implementation
[0025] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0026] The overall concept of the technical solution of this invention is as follows: This invention adopts a working method in which the file system in the device, such as the overlayFS file system, works in cooperation with the warehouse.
[0027] OverlayFS comprises lower and upper directories. The lower directory contains the complete file system after the initial system installation, protected as read-only. The upper directory stores environment deployments for the device, such as addition, deletion, and modification operations performed on the system—incremental content. Its working principle involves merging the lower and upper directories to form a new root file system, which stores the complete file system plus user-manipulated data. Files with the same name in both the lower and upper directories are defined according to the upper directory. In this invention, only repository version control of the upper directory's content is needed to implement a network snapshot system (NAS snapshot system).
[0028] The repository can be a Git repository or an SVN repository. For ease of explanation, this invention describes the implementation using a Git repository as an example; however, it should be understood that the technical means of this invention are equally applicable to SVN repositories. The repository can be located locally on the device or deployed remotely, depending on the needs of the scenario. The corresponding tools for the repository are deployed on the device, enabling the execution of a series of operations related to the repository.
[0029] Figure 1 The overall architecture diagram of the technical solution of the present invention is shown. Figure 1 As shown, device A pulls `upper.git` from the Git repository as the parent directory of overlayFS. Thus, the ` / overlay / upper` directory specified in overlayFS becomes the shared incremental content directory for both overlayFS and the Git repository. Here, `upper.git` is a pre-created repository name, identical to the parent directory name in overlayFS, both being `upper`. This allows the repository's `upper` directory to be used as the `upper` directory specified by overlayFS. As mentioned above, the parent directory specified by overlayFS is itself named `upper`, and all additions, deletions, and modifications to the initial system (the file systems contained in the lower directories of overlayFS) (i.e., user-mandated environment deployments on the device, also known as incremental content) are stored in this directory. Therefore, when performing addition, deletion, and modification operations on the overlay, it is actually performing addition, deletion, and modification operations on the Git repository in the client's working directory, eliminating the need for copying or cutting.
[0030] Deploy the environment on device A. Environment deployment could be, for example, deploying a website on an image (which comes with OverlayFS and Git tools). After deployment, the website environment will be automatically saved in the upper directory, and then the contents of the upper directory will be pushed to the Git repository. Each push is a snapshot of the environment deployment on device A. This completes a basic system snapshot.
[0031] If a new environment deployment is subsequently made on device A, it will be pushed out using a secondary incremental approach. The concept of secondary incremental deployment leverages a built-in feature of Git repositories. The previously saved basic environment snapshot can be considered incremental content (saving only changes equivalent to the underlying content). Subsequent environment deployments, based on changes made in the first deployment, only require pushing the changes from the first deployment as a patch—the secondary incremental deployment. This secondary incremental deployment, combined with the previous incremental content, forms a complete file / feature. This utilizes Git's inherent advantages, saving space.
[0032] Then comes the batch deployment phase: Devices B, C, and D pull the upper.git directory from the Git repository (at this point, the directory already contains the content pushed by device A) and overwrite their own upper directories. This completes the deployment of devices B, C, and D, thus forming a rapid batch deployment. Devices B, C, and D also contain file systems such as OverlayFS. These file systems include parent and child directories. The child directories store the initial installed system of devices B, C, and D (the same as in device A), while the parent directory stores the environment deployments made on other devices based on the initial installed system, i.e., the content stored in the upper.git directory pulled from the Git repository by devices B, C, and D.
[0033] Distributed deployment using the above method ensures that once the runtime environment is deployed on one device and pushed to the Git repository, other devices will receive the same, up-to-date, and complete environment. When it's necessary to roll back to a specific point in time, the Git checkout function of the Git repository can be used to perform the rollback.
[0034] According to an embodiment of the present invention, a method for taking a snapshot of a device environment is provided. Reference is made below. Figure 2 A device environment snapshot method according to an embodiment of the present invention is described. For example... Figure 2 As shown, the method includes:
[0035] S210, retrieve the parent directory from the repository as the parent directory within the file system on the device. The parent directory retrieved from the repository is a directory file prepared in advance by the user, and its name is consistent with the name of the parent directory within the file system.
[0036] As mentioned above, the directory within the repository is named "upper" and extracted to serve as the parent directory of OverlayFS. The system will automatically merge the repository directory with the specified path " / overlay / upper" within OverlayFS.
[0037] S220 stores the device's environment deployment in the parent directory of the file system.
[0038] This step may include saving the device's environment deployment in the parent directory at predetermined time intervals. These predetermined time intervals may be, for example, several hours, one day, or one week, depending on the business scenario, ensuring that the latest environment deployment of the device is preserved.
[0039] S230, push the environment deployment stored in the parent directory to the repository.
[0040] With the device environment deployment saved regularly, each system snapshot is pushed to the repository. As mentioned above, subsequent environment deployments are stored in the repository as patches.
[0041] The equipment mentioned in steps S210-S230 above can be Figure 1 Device A is shown. Figure 1 The diagram shows four devices (ADs), each of which can be the main deployment environment or can copy an environment from other devices. (Reference above) Figure 2 This describes the scenario where device A deploys an environment and clones that environment to other devices (BD). Device A can also pull a parent directory from a Git repository, and that parent directory already contains environment deployments performed by other devices. The process of other devices deploying environments and pushing them to the repository is the same as described above. Figure 2 The above is consistent. Other devices, such as... Figure 1 One of the devices shown in BD.
[0042] In existing technologies, snapshot creation based on Btrfs cannot automatically generate traceable snapshots, requiring manual snapshot management, including explicitly noting specific time points and snapshot descriptions. The technical solution of this invention solves the snapshot version control problem: by employing a repository that can be deployed on local / remote servers, the snapshot version control issue is resolved, enabling the automatic generation of traceable snapshots, automated snapshot management, and automatic completion of snapshot time points and descriptions.
[0043] According to an embodiment of the present invention, a method for replicating a device environment is also provided, comprising: Figure 1 The device BD shown is executed, where device BD will refer to the above. Figure 2 The environment obtained by the method is deployed and replicated to the device itself, thereby obtaining a system environment consistent with device A. For example... Figure 3 As shown, the device environment replication method includes:
[0044] S310, other devices pull the parent directory from the repository as the parent directory within their file systems, wherein the pulled parent directory already contains references. Figure 2 The environment deployment obtained by the device environment snapshot method described above.
[0045] The device's BD (Business Development) function can pull parent directories from the Git repository at predetermined intervals, thereby enabling regular environment updates. Depending on the business scenario, the predetermined interval can be several hours, several days, or a week, etc.
[0046] Any of the devices in the BD can also be ordered according to Figure 2 After deploying the environment using the method shown, the environment is pushed to the repository directory, and other devices then copy the environment.
[0047] Using the above methods, any additions, deletions, or modifications made to any device in the Device Active Directory (AD) can be considered as environment deployment, and this deployment is effective for any other device, eliminating the need for separate deployments. In other words, the environment only needs to be deployed once to be replicated to multiple devices. This allows for rapid service recovery to other devices in the event of a device failure.
[0048] The device BD can also switch snapshots via Git rollback, such as rolling back to different points in time to quickly restore business and meet customer stability requirements.
[0049] According to embodiments of the present invention, different business environments can also be switched using Git branching functionality, thereby enabling multiple services on a single machine: For example, device A pushes an environment deployment to a repository, and device B needs most of the environment of device A, but not entirely the same. In this case, developers can use Git branching functionality to create a branch A (A_branch) from the environment of device A (e.g., named A). Branch A has the same content as A and is located in the same directory. Then, a branch B (B_branch) is created from branch A, and branch B is pushed to device B, so that device B can have a snapshot of the system improved from device A. For example: Device A deploys a web server on port 80, and device B needs the same environment as a test server, but on port 8080. In this case, a branch B can be created as described above, changing the port to 8080. After being pushed to device B, device B can perform testing, and at the same time, it synchronizes with the latest updates from device A.
[0050] According to an embodiment of the present invention, a device environment snapshot apparatus is also provided to perform the above-described device environment snapshot method. For example... Figure 4 As shown, the device includes:
[0051] The pull module 410 pulls a parent directory from the repository to serve as the parent directory within the file system on the device. The parent directory pulled from the repository is a directory file prepared in advance by the user, and its name is consistent with the name of the parent directory within the file system.
[0052] The storage module 420 stores the device's environment deployment in the parent directory of the file system. Specifically, the storage module 420 can save the device's environment deployment in the parent directory at predetermined time intervals. These predetermined time intervals can be, for example, several hours, one day, or one week, depending on the business scenario, thus ensuring that the latest device environment deployment is preserved.
[0053] The push module 430 pushes the environment deployment stored in the parent directory to the repository.
[0054] The pull module 410 can also pull parent directories from the Git repository, and these parent directories already contain environment deployments performed by other devices.
[0055] According to an embodiment of the present invention, a device environment replication apparatus is also provided, which performs the device environment replication method described above. For example... Figure 5 As shown, the device environment replication apparatus includes:
[0056] The pull module 510 pulls a parent directory from the repository as the parent directory within the file system on the other devices, wherein the pulled parent directory already contains references. Figure 2 The environment deployment obtained by the device environment snapshot method described above.
[0057] The pull module 510 can pull parent directories from the Git repository at predetermined time intervals, thereby enabling regular environment updates. Depending on the business scenario, the predetermined time interval can be several hours, several days, or a week, etc.
[0058] Figure 5 The device may also include a rollback module, which can switch snapshots via Git rollback functionality, such as rolling back to an environment at a different point in time, to quickly restore business and meet customer stability requirements.
[0059] For the parts of the device environment snapshot apparatus and device environment copy apparatus according to embodiments of the present invention that are not described in detail, please refer to the above detailed description of the method embodiments.
[0060] The method of this invention can be executed in a computing device. The computing device can be any device with storage and computing capabilities, such as a server, workstation, or a personal computer such as a desktop computer or laptop computer, or a terminal device such as a mobile phone, tablet computer, smart wearable device, or Internet of Things device, but is not limited thereto.
[0061] Figure 6 A schematic diagram of a computing device according to an embodiment of the present invention is shown. It should be noted that... Figure 6 The computing device shown is merely an example. In practice, the computing device used to implement the method of this invention can be any type of device, and its hardware configuration can be similar to... Figure 6 The computing device shown is the same, and can also be used with Figure 6 The computing devices shown are different. In practice, the computing devices used to implement the methods of this invention can... Figure 6 The hardware components of the computing device shown may be added or removed. This invention does not limit the specific hardware configuration of the computing device.
[0062] like Figure 6 As shown, the device may include: a processor 610, a memory 620, an input / output interface 630, a communication interface 640, and a bus 650. The processor 610, memory 620, input / output interface 630, and communication interface 640 are interconnected internally via the bus 650.
[0063] The processor 610 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0064] The memory 620 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 620 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 620 and is called and executed by the processor 610.
[0065] The input / output interface 630 is used to connect input / output modules to enable information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0066] The communication interface 640 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (e.g., USB, Ethernet cable) or wireless means (e.g., mobile network, Wi-Fi, Bluetooth).
[0067] Bus 650 includes a pathway for transmitting information between various components of the device, such as processor 610, memory 620, input / output interface 630, and communication interface 640.
[0068] It should be noted that although the above-described device only shows the processor 610, memory 620, input / output interface 630, communication interface 640, and bus 650, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0069] This invention also provides a non-transitory readable storage medium storing instructions for causing a computing device to execute a method according to an embodiment of the invention. The readable medium in this embodiment includes both permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of readable storage media include, but are not limited to: phase-change memory (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 optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transitory readable storage medium.
[0070] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used with the examples of this invention. The required structure for constructing such systems is apparent from the above description. Furthermore, this invention is not directed to any particular programming language. It should be understood that the contents of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing preferred embodiments of the invention.
[0071] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0072] Similarly, it should be understood that, in order to simplify this disclosure and aid in understanding one or more aspects of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the description of exemplary embodiments of the invention above. However, this method of disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Those skilled in the art will understand that modules, units, or components of the device in the examples disclosed herein can be arranged in the device described in this embodiment, or alternatively, can be located in one or more devices different from the device in this example. The modules in the foregoing examples can be combined into a single module or further divided into multiple sub-modules.
[0073] Those skilled in the art will understand that modules in the apparatus of an embodiment can be adaptively modified and placed in one or more devices different from that embodiment. Modules, units, or components in an embodiment can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or apparatus so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0074] Furthermore, those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments. Additionally, some of the embodiments described herein are described as methods or combinations of method elements that can be implemented by a processor of a computer system or by other means of performing the functions. Therefore, a processor having the necessary instructions for implementing the method or method elements forms means for implementing the method or method elements. Furthermore, the elements described herein in the device embodiment are examples of devices used to implement the functions performed by the elements for the purpose of carrying out the invention.
[0075] As used herein, unless otherwise specified, the use of ordinal numbers such as “first,” “second,” “third,” etc., to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects being described must have a given order in time, space, ordering, or any other manner.
[0076] Although the invention has been described with respect to a limited number of embodiments, those skilled in the art will understand from the foregoing description that other embodiments are conceivable within the scope of the invention described herein. Furthermore, it should be noted that the language used in this specification has been chosen primarily for readability and instructional purposes, and not for the purpose of explaining or limiting the subject matter of the invention.
Claims
1. A device environment snapshot method, executed through a combination of a file system and a repository, wherein the file system includes a parent directory and a subdirectory, the subdirectory stores the initially installed system of the device, and the parent directory is used to store the environment deployments made on the basis of the initially installed system, the device environment snapshot method comprising: Pulling a parent directory from the repository as the parent directory within the file system on the device, wherein the parent directory pulled from the repository is a directory file prepared in advance by the user, and its name is consistent with the name of the parent directory within the file system, and pulling a parent directory from the repository as the parent directory within the file system on the device includes setting the specified path of the parent directory within the file system to be consistent with the parent directory of the repository. The environment deployment for the device is stored in the parent directory of the file system; Push the environment deployments stored in the parent directory to the repository; When a new environment deployment is set up for a device, the characteristics of the repository are utilized to push the new environment deployment to the repository in a secondary incremental manner, so that other devices can obtain the parent directory from the repository and set up their environment deployments.
2. The device environment snapshot method as described in claim 1, wherein, The environment deployment of the device is stored in the parent directory, including: The environment deployment for the device is saved in the parent directory at predetermined time intervals.
3. The device environment snapshot method as described in claim 1, wherein, The device pulls the parent directory from the repository as the parent directory within the file system on the device. The parent directory in the repository already contains environment deployments performed by other devices.
4. The device environment snapshot method as described in any one of claims 1-3, wherein, The repository is a Git repository or an SVN repository.
5. A device environment replication method, executed by another device, wherein the other device includes a file system, the file system comprising a parent directory and a subdirectory, the subdirectory storing the initially installed system of the other device, and the parent directory storing the environment deployment made on the other device based on the initially installed system, the device environment replication method comprising: Pull the parent directory from the repository as the parent directory within the file system on the other devices; The environment deployments in the parent directory are retrieved and configured from the repository, and the environment deployments in the repository are obtained according to the following steps: The device pulls a parent directory from the repository as the parent directory within the file system on the device. The parent directory pulled from the repository is a directory file prepared in advance by the user, and its name is consistent with the name of the parent directory within the file system. Pulling a parent directory from the repository as the parent directory within the file system on the device includes setting the specified path of the parent directory within the file system to be consistent with the parent directory of the repository. The environment deployment for the device is stored in the parent directory of the file system; Push the environment deployments stored in the parent directory to the repository; When a new environment deployment is set up for the device, the new environment deployment is pushed to the warehouse in a secondary incremental manner by leveraging the characteristics of the warehouse.
6. In the device environment replication method as described in claim 5, the other devices are rolled back to the environment deployment at a predetermined time point through the rollback function provided by the warehouse.
7. A device environment snapshot apparatus, which executes a device environment snapshot method by combining a file system and a repository, wherein the file system includes a parent directory and a child directory, the child directory stores the initially installed system of the device, and the parent directory is used to store the environment deployment of the device based on the initially installed system, the device environment snapshot apparatus comprising: The pull module is used to pull the parent directory from the repository as the parent directory in the file system on the device. The parent directory pulled from the repository is a directory file prepared in advance by the user, and its name is consistent with the name of the parent directory in the file system. Pulling the parent directory from the repository as the parent directory in the file system on the device includes setting the specified path of the parent directory in the file system to be consistent with the parent directory of the repository. The storage module stores the device's environment deployment in the parent directory of the file system; The push module pushes the environment deployments stored in the parent directory to the repository; The device is also adapted to push the new environment deployment to the warehouse in a secondary incremental manner when a new environment deployment is set for the device, by utilizing the characteristics of the warehouse, so that other devices can obtain the parent directory from the warehouse and set up environment deployments.
8. A device environment replication apparatus, located in another device, the other device including a file system, the file system including a parent directory and a child directory, the child directory storing the initially installed system of the other device, the parent directory being used to store the environment deployment of the other device based on the initially installed system, the device environment replication apparatus comprising: The pull module pulls the parent directory from the repository as the parent directory within the file system on the other device, including setting the specified path of the parent directory within the file system to be consistent with the parent directory of the repository. The environment deployments in the parent directory are retrieved and configured from the repository, and the environment deployments in the repository are obtained according to the following steps: The device pulls a parent directory from the repository as the parent directory within the file system on the device. The parent directory pulled from the repository is a directory file prepared in advance by the user, and its name is consistent with the name of the parent directory within the file system. The environment deployment for the device is stored in the parent directory of the file system; Push the environment deployments stored in the parent directory to the repository; When a new environment deployment is set up for the device, the new environment deployment is pushed to the warehouse in a secondary incremental manner by leveraging the characteristics of the warehouse.
9. A computing device, comprising: At least one processor and a memory storing program instructions; When the program instructions are read and executed by the processor, the computing device performs the method as described in any one of claims 1-6.
10. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method as described in any one of claims 1-6.