Online ide code management method based on nas storage and related device
By using NAS storage mounting and multi-level directory isolation technology, the problems of code loss and resource waste in online IDE code management are solved, realizing the persistence and secure unified management of online IDE code, and improving the efficiency and security of multi-user development.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA LIFE INSURANCE CO LTD
- Filing Date
- 2022-03-21
- Publication Date
- 2026-05-01
AI Technical Summary
Existing online IDE products lack local code management and persistence solutions, which leads to code loss and waste of resources and insufficient security during multi-user development.
By using NAS storage mounting technology, online IDE code is persisted to NAS storage, and the workspaces of different users are isolated through multi-level directories, achieving unified management and secure storage.
It enables the persistence of code in online IDEs, preventing code loss, improving the security and resource utilization efficiency of multi-user development, and facilitating problem location and analysis.
Smart Images

Figure CN114924830B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of code management technology, and in particular to an online IDE code management method and related equipment based on NAS storage. Background Technology
[0002] There are many online IDE products in the industry, such as Visual Studio Code (VSCode), Theia, and the Projector suite (supporting IntelliJ IDEA, GoLand, PyCharm, DataGrip, etc.) from abroad, and DevStudio and CloudStudio from China. Many online IDE products provide a pure integrated development environment, only offering remote code hosting to code repositories (such as GitLab and SVN). They lack solutions for local code management and persistence, especially in enterprise scenarios with multi-user parallel development requiring comprehensive implementation solutions that support multiple types of online IDEs. Summary of the Invention
[0003] In view of this, the purpose of this application is to propose an online IDE code management method and related equipment based on NAS storage.
[0004] To achieve the above objectives, the first aspect of this application provides an online IDE code management method based on NAS storage, wherein multiple online integrated development environments (IDEs) are configured, and each online IDE is deployed using a Docker container. The method includes:
[0005] Persist the online IDE code under the Docker container;
[0006] Based on NAS network storage, the workspace of the online IDE code is managed in a unified manner, and the mount directory of the NAS network storage is obtained;
[0007] Based on the number of users and the mounted directories, the online IDE code is isolated using multi-level directories stored in the NAS network storage, resulting in the workspace for each user's online IDE code.
[0008] A second aspect of this application provides an online IDE code management device based on NAS storage, comprising:
[0009] The persistence module is configured to persist the online IDE code within the Docker container.
[0010] The unified management module is configured to: manage the workspace of the online IDE code in a unified manner based on the NAS network storage, and obtain the mount directory of the NAS network storage;
[0011] The isolation processing module is configured to: based on the number of users and the mounted directory, use the multi-level directory stored in the NAS network storage to isolate the online IDE code, thereby obtaining the workspace for the online IDE code corresponding to each user.
[0012] A third aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method provided in the first aspect of this application.
[0013] A fourth aspect of this application provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method provided in the first aspect of this application.
[0014] As described above, the online IDE code management method and related equipment based on NAS storage provided in this application firstly persists the online IDE code under the Docker container. The persisted online IDE code will not be destroyed when the Docker container is destroyed. When the host machine of the online IDE code is damaged, the writing of the online IDE code can be mounted to a new host machine to continue writing. Then, based on the NAS network storage, the workspace of the online IDE code is uniformly managed, resulting in the NAS network storage mount directory. Since online IDE users have varying skill levels, unified workspace management can alleviate the technical problem of users shielding the mounting of containerized NAS storage space. The unified workspace is the NAS network storage mount directory. Unified workspace management also assists users in locating and troubleshooting problems during the use of the online IDE, and is beneficial for later statistical analysis of the usage of the online IDE and code workspace. Finally, based on the number of users and the mounted directories, the online IDE code is isolated using a multi-level directory stored in the NAS network storage, resulting in a workspace for each user's online IDE code. The workspaces of multiple users' online IDE code are stored on a single NAS. By isolating the workspaces of different users through the multi-level directory of the NAS storage, it is ensured that when multiple users use the online IDE, they can only read and write their own workspace directory and cannot view the workspace directories of other users' NAS storage. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating an online IDE code management method based on NAS storage, as described in an embodiment of this application.
[0017] Figure 2 This is a block diagram of an online IDE code management method based on NAS storage, according to an embodiment of this application.
[0018] Figure 3 This is a flowchart illustrating the process of obtaining the mounted directory in an embodiment of this application.
[0019] Figure 4 This is a flowchart illustrating the determination of the workspace in an embodiment of this application;
[0020] Figure 5 This is a flowchart illustrating the creation of a mount directory in an embodiment of this application.
[0021] Figure 6 This is a flowchart illustrating the creation of a user directory according to an embodiment of this application;
[0022] Figure 7 This is a flowchart illustrating the creation of a random number catalog according to an embodiment of this application;
[0023] Figure 8 This is a flowchart illustrating the git clone command operation in an embodiment of this application;
[0024] Figure 9 This is a flowchart illustrating the persistence process in an embodiment of this application;
[0025] Figure 10 This is a structural diagram of an online IDE code management device based on NAS storage, according to an embodiment of this application.
[0026] Figure 11 This is a structural diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.
[0028] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0029] In related technologies, open-source online IDEs, such as the Projector suite (which supports IntelliJ IDEA, GoLand, PyCharm, DataGrip, etc.), offer containerization solutions for code download and host machine volume mounting to address the issue of code persistence within containers. However, while Docker containerization of online IDEs using host machine volume mounting can solve the problem of code persistence, the code will be destroyed if the host machine fails, the environment is migrated, or the environment is split. In DevStudio and Coding products, code management is hosted in remote code repositories, lacking a solution for managing uncommitted code. This hinders problem localization and troubleshooting during online IDE use and makes it difficult to statistically analyze the usage of the online IDE and code workspace later.
[0030] The online IDE code management method and related devices based on NAS storage provided in this application embodiment employ NAS storage binding mounts to the container host machine. This establishes a connection between a path on the host machine and a path within the container, allowing developers to map all read and write operations (all operations) performed by the online IDE to the associated path on the NAS storage. This isolates the storage device from the server. If the host machine fails, it can be easily mounted to a new host machine via binding mounts, ensuring that the online IDE code is not lost when Docker is destroyed. Newly created Docker containers also mount the original NAS, achieving persistence of the online IDE code. The multi-level directory structure of NAS storage isolates the workspaces of different users and uses NAS to uniformly store all users' workspaces, achieving unified management of workspaces. Isolating different users' workspaces avoids the resource waste caused by allocating separate storage space for each user.
[0031] In some embodiments, such as Figure 1 and Figure 2 As shown, an online IDE code management method based on NAS storage is described, wherein multiple online integrated development environments (IDEs) are configured, and each online IDE is deployed using Docker containers. The method includes:
[0032] Step 100: Persist the online IDE code under the Docker container.
[0033] In this step, if the online IDE code is not persisted, the local files of the online IDE code deployed within the Docker container will also be destroyed when the Docker container is destroyed. This is extremely inconvenient for developers, so data persistence within the container needs to be considered. In this embodiment, NAS storage is bound to the container host, and a path on the host machine is linked to a path in the container. This allows developers to map all read and write operations (all read and write operations) when using the online IDE to the associated path on the NAS storage, isolating the storage device from the server (NAS). When the host machine fails, it can be easily bound to a new host machine, ensuring that the online IDE code is not lost when the Docker container is destroyed. The newly created Docker container also binds to the original NAS, achieving persistence of the online IDE code.
[0034] Step 200: Based on the NAS network storage, perform unified management of the workspace of the online IDE code to obtain the mount directory of the NAS network storage.
[0035] In this step, all online IDE code is version-managed in a remote code repository (e.g., GitLab). A separate application backend program downloads the code from the remote repository to the NAS's mount directory, which serves as the user's workspace for online IDE code editing. Since different users' workspaces are all located within this mount directory, unified management of code from different online IDEs is achieved. Due to the differences in features among various online IDEs, some online IDEs cannot download code independently, and online IDE users have varying skill levels. Unified workspace management can shield users from the technical issues of mounting containerized NAS storage (if a user downloads code arbitrarily to a container directory without persistence, the code will be lost after the container restarts); it facilitates troubleshooting and problem identification during the use of online IDEs; and it also facilitates the later statistical analysis of online IDE and code workspace usage.
[0036] Step 300: Based on the number of users and the mounted directory, the online IDE code is isolated using multi-level directories stored in the NAS network storage, thus obtaining the workspace for the online IDE code corresponding to each user.
[0037] In this step, while allocating a separate storage space for each user can achieve good isolation, it may lead to some resource waste due to varying storage usage among users. Therefore, a multi-level directory system using NAS network storage is used to isolate the online IDE code, creating a workspace for each user's online IDE code. All online IDE code workspaces for multiple users share a single NAS for storage. By isolating different users' workspaces through the multi-level directory system of the NAS storage, it is ensured that multiple users can only read and write their own workspace directory when using the online IDE and cannot view other users' NAS storage workspace directories.
[0038] Among them, such as Figure 2As shown, the application backend service is deployed in a Docker container, responsible for all users' `git clone` command operations based on the code space. The NAS-mounted directory of this container is " / home / project / ", and the application backend service has read and write permissions to all directories and files under " / home / project / ". Online IDE: Each online IDE is a separate container. Multiple online IDEs under the same username are stored in the corresponding user directory " / home / project / user unique identifier / ". Therefore, within an online IDE, users can only read and write files and directories under their own name and cannot access other users' files and directories, achieving code isolation and security. The remote code repository can be GitLab or SVN, and can be a public code repository or a code repository built internally by an enterprise or organization (GitLab is used as an example of a remote code repository in the design diagram). Online IDEs generally integrate version control plugins based on Git or SVN, allowing operations such as commit and pull to the remote code repository. NAS Storage: The backend application service container and all online IDEs share a single NAS storage. NAS multi-level directories are used to configure operable areas to achieve file data sharing and isolation across different scopes.
[0039] Optionally, a unified NAS network storage device can be requested. This NAS network storage device is shared by the background service for the unified `git clone` command and the workspaces of all online IDEs for multiple users. The mount directory of the NAS is " / home / project / ". The background service can read and write all files under " / home / project / " and can create subdirectories based on user information (e.g., " / home / project / user unique identifier / "). The user unique identifier can be an ID. A user can have multiple online IDEs (different IDEs for different programming languages). Each online IDE has its own subdirectory (e.g., " / home / project / user unique identifier / random number / "). The online IDE code is ultimately downloaded to these subdirectories through the application background service, so that each user has their own NAS storage space. The online IDE containers of the same user are mounted to the same NAS directory " / home / project / user unique identifier / ". The online IDE can only read and write all files under " / home / project / user unique identifier / ", and other users' user directories are not visible or readable / writable.
[0040] In some embodiments, such as Figure 3 As shown, step 200: Based on the NAS network storage, the workspace of the online IDE code is managed uniformly to obtain the mount directory of the NAS network storage, specifically including:
[0041] Step 210: Request a unified NAS storage space in the NAS network storage.
[0042] In this step, a unified NAS storage space needs to be applied for on the NAS, and the multiple online IDE codes downloaded by the background service are stored in this storage space.
[0043] Step 220: Use the download path of the NAS storage space as the mount directory.
[0044] In this step, the download path in the NAS storage space can be selected as NAS: " / home / project / ", which means using the " / home / project / " directory in the NAS as the mount directory for downloading online IDE code.
[0045] In some embodiments, such as Figure 4 As shown, step 300: Based on the number of users and mounted directories, the online IDE code is isolated using multi-level directories stored in the NAS network storage, resulting in a workspace for each user's online IDE code. Specifically, this includes:
[0046] Step 310: Create a user directory for each user in the mount directory, where the user directory is a subdirectory of the mount directory.
[0047] In this step, the online IDE code is isolated by using the multi-level directory stored in the NAS network storage. This requires creating a subdirectory at the next level in the mounted directory " / home / project / ". Since the workspace in this embodiment is divided at the first level based on different users, a user directory with a unique user identifier will be created in the mounted directory as a subdirectory of the mounted directory.
[0048] Step 320: Determine the workspace for the online IDE code in the user directory.
[0049] In this step, the workspace for the online IDE code is determined based on the different situations of different users. When a user has only one online IDE to edit, only one directory is needed to store the corresponding online IDE code. Therefore, the user directory " / home / project / user unique identifier / " can be used as the workspace for the user's online IDE code. When a user has multiple online IDEs (different online IDEs for different programming languages), it is necessary to separate the different online IDEs for the same user at the next level. Therefore, a corresponding number of subdirectories are created in the user directory " / home / project / user unique identifier / ": the random number directory " / home / project / user unique identifier / random number / " can be used as the workspace for the user's different IDE codes. Optionally, the random number can be replaced with other symbols used for classification, or it can be arranged in a certain order starting from 1 and arranged in ascending order. For example, for a certain user m, the random number directory for user m's online IDE code can be " / home / project / user m unique identifier / 1 / ". Because of the separation, user m can only view and edit the random number directory within " / home / project / user m's unique identifier / ", and cannot see or read / write other users' user directories, thus protecting the security of each user's online IDE code.
[0050] In some embodiments, such as Figure 5 As shown, step 310: Create a user directory for each user in the mount directory, specifically including:
[0051] Step 311: Obtain the git repository address information and the user's unique identifier.
[0052] In this step, if you want to create a user directory that corresponds one-to-one with each user, you need to add unique identifier information that can uniquely represent the user to the user directory, and you also need to obtain the address information that can download the remote code repository to the user directory: the git repository address information.
[0053] Step 312: Create the user directory in the mount directory based on the git repository address information and the user's unique identifier.
[0054] In this step, a subdirectory named " / home / project" needs to be created based on the Git repository address information and the user's unique identifier: the user directory " / home / project / user unique identifier / ". The user's unique identifier information is added to the subdirectory to help users locate and troubleshoot problems while using the online IDE. That is, when a problem occurs, the user's online IDE code storage directory can be accurately located based on the unique user identifier. It also facilitates the later statistics and analysis of the usage of the online IDE and code workspace.
[0055] In some embodiments, such as Figure 6 As shown, step 312: Create a user directory in the mount directory, which specifically includes:
[0056] Step 3121: In response to the determination that there is a subdirectory with a unique identifier in the mount directory, the subdirectory is designated as the user directory.
[0057] In this step, if a subdirectory corresponding to the user's unique identifier exists in the mount directory, it means that the user has created a corresponding user directory as a workspace in the mount directory based on the same development language. However, since this is not the first time editing code in the online IDE, the process of creating the user directory can be skipped, and the existing user directory can be directly used as the workspace for this online IDE editing.
[0058] Step 3122: In response to the determination that there is no subdirectory corresponding to the unique identifier in the mount directory, create the folder corresponding to the user's unique identifier as the user directory.
[0059] In this step, if the user's unique identifier subdirectory does not exist in the mount directory, it means that the user has not created a corresponding user directory as a workspace in this mount directory based on the same development language. Since this is the first time editing code in the online IDE, a unique folder corresponding to the user will be created in the mount directory as the user directory.
[0060] In some embodiments, such as Figure 7 As shown, step 320: Determine the workspace for the online IDE code in the user directory, specifically including:
[0061] Step 321: Based on the user directory, generate a random number directory as a subdirectory of the user directory.
[0062] This step addresses the scenario where a user has multiple online IDEs (different online IDEs may exist for different programming languages). In this case, it's necessary to further separate the workspaces of the user's different online IDEs. Therefore, a corresponding number of subdirectories are created within the user directory " / home / project / user's unique identifier / ": random number directories " / home / project / user's unique identifier / random number / " serve as the workspaces for the user's different IDEs. For example, for user m, a random number directory for user m's online IDE code is created within the user directory " / home / project / user m's unique identifier / ": " / home / project / user m's unique identifier / random number / ". The number of random number directories is related to the number of online IDEs the user has. Using random number directories provides the lowest level of separation for the workspace. User m can only view and edit the random number directories within " / home / project / user m's unique identifier / ", and they are not visible or writable by other users' user directories, protecting the security of each user's online IDE code and achieving isolation between different users.
[0063] Step 322: Use the random number directory as the workspace for the git repository address. Execute the `git clone` command in the random number directory to download the online IDE code to the workspace.
[0064] In this step, the process of executing the git clone command is as follows: Figure 8 As shown, the online IDE code is downloaded from a remote code repository to a random number directory through the application's backend service. This random number directory serves as the user's workspace for editing online IDE code. The online IDE code is divided into multiple levels: First level: Mounted directory " / home / project / ", which can be considered as a unified management level; Second level: User directory " / home / project / user unique identifier / ", which is divided according to different users; Third level: Random number directory " / home / project / user unique identifier / random number / ", which is the lowest level of division based on different online IDEs for different users. The content of the input parameters, the creation of the user directory and the random number directory have been explained in the above embodiments and will not be repeated here.
[0065] In some embodiments, such as Figure 9 As shown, step 100: Persist the online IDE code under the Docker container, specifically including:
[0066] Step 110: The NAS network storage establishes a connection with the host machine.
[0067] Step 120: Establish the association path for the NAS network storage on the host machine.
[0068] Step 130: Map all read and write operations of the online IDE code in the NAS network storage to the associated path to complete the persistence of the online IDE code.
[0069] Without persistent online IDE code, the local files of the online IDE code deployed within the Docker container will also be destroyed when the Docker container is destroyed. By binding the NAS storage to the container host, a path on the host machine is linked to the associated path of the NAS network storage. This allows developers to map all read and write operations (all read and write operations) when using the online IDE to the NAS storage association, thus isolating the storage device from the server (NAS). When the host machine fails, it can be easily mounted to a new host machine through binding, ensuring that the online IDE code is not lost when the Docker container is destroyed. The newly created Docker container also mounts the original NAS mount directory, achieving persistence of the online IDE code. The associated path can be the mount directory " / home / project / ".
[0070] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.
[0071] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0072] Based on the same inventive concept, and corresponding to any of the above embodiments, this application also provides an online IDE code management device based on NAS storage.
[0073] refer to Figure 10 The NAS-based online IDE code management device includes:
[0074] The persistence module 10 is configured to persist the online IDE code under the Docker container.
[0075] The unified management module 20 is configured to: manage the workspace of online IDE code in a unified manner based on NAS network storage, and obtain the mount directory of NAS network storage;
[0076] The isolation processing module 30 is configured to isolate online IDE code based on the number of users and the mounted directory, thereby obtaining a workspace for the online IDE code corresponding to each user.
[0077] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.
[0078] The apparatus described above is used to implement the corresponding NAS-based online IDE code management method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0079] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the online IDE code management method based on NAS storage as described in any of the above embodiments.
[0080] Figure 11 This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.
[0081] The processor 1010 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.
[0082] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 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 1020 and is called and executed by the processor 1010.
[0083] The input / output interface 1030 is used to connect input / output modules to realize 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.
[0084] The communication interface 1040 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 (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0085] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0086] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, 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.
[0087] The electronic devices described above are used to implement the corresponding NAS-based online IDE code management methods in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0088] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to execute the online IDE code management method based on NAS storage as described in any of the above embodiments.
[0089] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change 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 magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0090] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the online IDE code management method based on NAS storage as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0091] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.
[0092] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0093] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0094] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.
Claims
1. A method for online IDE code management based on NAS storage, characterized in that, The online integrated development environment (IDE) is configured in multiple ways, and each online IDE is deployed using a Docker container. The method includes: Persist the online IDE code under the Docker container; The process of persisting the online IDE code under the Docker container includes: establishing a connection between the NAS network storage and the host machine; establishing an association path for the NAS network storage on the host machine; and mapping all read and write operations of the online IDE code in the NAS network storage to the association path to complete the persistence of the online IDE code. Based on NAS network storage, the workspace of the online IDE code is managed in a unified manner, and the mount directory of the NAS network storage is obtained; Based on the number of users and the mounted directories, the online IDE code is isolated using multi-level directories stored in the NAS network storage, resulting in the workspace for each user's online IDE code.
2. The method according to claim 1, characterized in that, The NAS network storage-based unified management of the online IDE code workspace, resulting in the NAS network storage mount directory, specifically includes: Apply for a unified NAS storage space in the NAS network storage device; Use the download path of the NAS storage space as the mount directory.
3. The method according to claim 2, characterized in that, The method of isolating the online IDE code using multi-level directories stored in the NAS network storage based on the number of users and the mounted directory, thereby obtaining a workspace for the online IDE code corresponding to each user, specifically includes: Create a user directory for each user in the mount directory, wherein the user directory is a subdirectory of the mount directory; Determine the workspace for the online IDE code within the user directory.
4. The method according to claim 3, characterized in that, The step of creating a user directory for each user in the mount directory specifically includes: Retrieve the Git repository address information and the user's unique identifier; Based on the git repository address information and the user's unique identifier, a user directory is created in the mount directory.
5. The method according to claim 4, characterized in that, Creating a user directory in the mount directory specifically includes: In response to determining that a subdirectory corresponding to the unique identifier exists in the mounted directory, the subdirectory is designated as the user directory; In response to determining that there is no subdirectory corresponding to the unique identifier in the mounted directory, a folder corresponding to the user's unique identifier is created as the user directory.
6. The method according to claim 4, characterized in that, The step of determining the workspace for the online IDE code in the user directory specifically includes: Based on the user directory, a random number directory is generated as a subdirectory of the user directory; The workspace is defined as the random number directory as the address of the git repository. The git clone command is executed in the random number directory to download the online IDE code to the workspace.
7. An online IDE code management device based on NAS storage, characterized in that, include: The persistence module is configured to: persist the online IDE code under the Docker container; wherein, persisting the online IDE code under the Docker container includes: establishing a connection between the NAS network storage and the host machine; establishing an association path for the NAS network storage on the host machine; mapping all read and write operations of the online IDE code in the NAS network storage to the association path, thereby completing the persistence of the online IDE code; The unified management module is configured to: manage the workspace of the online IDE code in a unified manner based on the NAS network storage, and obtain the mount directory of the NAS network storage; The isolation processing module is configured to isolate the online IDE code based on the number of users and the mounted directory, thereby obtaining the workspace for the online IDE code corresponding to each user.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the method as claimed in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1 to 6.
Citation Information
Patent Citations
Multi-user online coding implementation system and method based on Docker deployment
CN113918161A