Method, apparatus and device for creating a dependency directory

By using a user space file system to directly read and index dependency packages, the method accelerates dependency directory creation and installation, addressing inefficiencies in existing manual indexing methods.

CN113590175BActive Publication Date: 2025-07-15ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110741240.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2025-07-15
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

In the prior art, the creation and installation efficiency of dependency directories are low, and dependency information needs to be manually added after downloading and decompressing the dependency package, resulting in wasting time and resources.

Method used

Use the user space file system to read the index information of the dependent compressed package, create soft links, and add target dependencies to the dependency directory, eliminating the steps of decompression and manually creating inodes.

Benefits of technology

It improves the creation efficiency and installation speed of dependent directories, saves time by about 2 seconds, reduces disk usage and installation time, and improves installation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113590175B_ABST
    Figure CN113590175B_ABST
Patent Text Reader

Abstract

This specification provides a method, apparatus, and device for creating a dependency directory, which directly reads the index information of the dependency package using the user space file system and creates an inode of the dependency directory, eliminating the process of manually creating the dependency inode after dependency installation, saving the creation time of the dependency directory, and improving the creation efficiency of the dependency directory and the installation efficiency of the dependency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification belongs to the field of computer technology, and particularly relates to a method, apparatus, and device for creating a dependency directory. Background Art

[0002] With the development of computer Internet technology, more and more business projects are carried out on the network. A business project usually contains multiple dependency packages, and how to determine the dependency information of the dependency packages of a business project has become the focus of attention.

[0003] Generally, a dependency package manager can be used to manage the dependency information of dependency packages, such as managing the dependency information by creating a dependency tree and a dependency directory that represent the dependency relationships of each project. Usually, the creation of the dependency directory can only manually add new dependencies to the existing dependency directory after the dependency packages are downloaded, decompressed, and installed. Summary of the Invention

[0004] The purpose of the embodiments of this specification is to provide a method, apparatus, and device for creating a dependency directory, which improves the creation efficiency of the dependency directory and the installation efficiency of dependencies.

[0005] On the one hand, the embodiments of this specification provide a method for creating a dependency directory, and the method includes:

[0006] Reading a dependency compressed package of a target dependency by using a user space file system to obtain dependency index information of the target dependency;

[0007] Creating a soft link corresponding to the target dependency according to the dependency index information;

[0008] Adding the target dependency to a dependency directory according to the dependency index information and the soft link.

[0009] On the other hand, this specification provides a device for creating a dependency directory, and the device includes:

[0010] An index reading module, configured to read a dependency compressed package of a target dependency by using a user space file system to obtain dependency index information of the target dependency;

[0011] A soft link creating module, configured to create a soft link corresponding to the target dependency according to the dependency index information;

[0012] A dependency directory adding module, configured to add the target dependency to a dependency directory according to the dependency index information and the soft link.

[0013] In another aspect, an embodiment of the present specification provides a device for creating a dependency directory, including at least one processor and a memory for storing processor-executable instructions. When the processor executes the instructions, the above method for creating a dependency directory is implemented.

[0014] The method, apparatus, and device for creating a dependency directory provided in this specification utilize the user space file system to directly read the index information of the dependency package and create an inode of the dependency directory, eliminating the process of manually creating a dependency inode after dependency installation, saving the creation time of the dependency directory, improving the creation efficiency of the dependency directory and the installation efficiency of the dependency. It has been verified that the speed of dependency installation can be increased by about 2 seconds. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] To more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in this specification. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0016] Figure 1 is a flowchart showing an embodiment of the method for creating a dependency directory provided in an embodiment of this specification;

[0017] Figure 2 is a schematic structural diagram of a dependency directory in an embodiment of this specification;

[0018] Figure 3 is a schematic diagram showing the construction principle of dependency directories of different projects in a scenario example of this specification;

[0019] Figure 4 is a schematic diagram of the module structure of an embodiment of the apparatus for creating a dependency directory provided in this specification;

[0020] Figure 5 is a block diagram of the hardware structure of a dependency directory creation server in an embodiment of this specification. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0021] In order to enable those skilled in the art to better understand the technical solutions in this specification, the following will clearly and completely describe the technical solutions in the embodiments of this specification with reference to the drawings in the embodiments of this specification. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this specification without creative efforts shall fall within the scope of protection of this specification.

[0022] Almost all current front-end development is inseparable from the node package manager npm (node pkgmakeinst, front-end dependency package manager). Npm is usually called the node package manager, and its main functions can include managing node packages (dependency packages), such as: installation, uninstallation, update, viewing, searching, publishing, etc. After the dependencies are installed, npm can generate a dependency directory file, namely node_modules. The dependency directory can be understood as the final running directory of the dependency packages. When generating the user node_modules solution, after all dependencies are installed, symlinks will be manually created based on the existing dependency directory to simulate and construct the dependency directory structure required by npm for compatibility with the npm ecosystem.

[0023] In the embodiments of this specification, the user space file system, namely FUSE (Filesystem in Userspace), is used to directly read the compressed packages of the dependencies, obtain the dependency index information of the dependencies, and create soft links corresponding to the indexes. Without decompressing and installing the dependency packages, the creation of the dependency directory can be directly completed, realizing the installation of the dependencies and improving the installation efficiency of the dependencies.

[0024] Figure 1 It is a schematic flowchart of the method embodiment for creating a dependency directory provided by the embodiments of this specification. Although this specification provides method operation steps or device structures as shown in the following embodiments or drawings, based on routine or non-creative labor, more or fewer operation steps or module units may be included in the method or device. In steps or structures where there is no necessary causal relationship logically, the execution order of these steps or the module structure of the device is not limited to the execution order or module structure shown in the embodiments of this specification or drawings. When the method or module structure is applied to an actual device, server or terminal product, it can be executed sequentially or in parallel according to the method or module structure shown in the embodiments or drawings (for example, in an environment with parallel processors or multi-threaded processing, or even including distributed processing and server cluster implementation environments).

[0025] The method for creating a dependency directory provided in the embodiments of this specification can be applied to terminal devices such as a server or a client, such as: servers, computers, smart phones, tablets, etc. The embodiments of this specification do not make specific limitations. As Figure 1 shown, the method may include the following steps:

[0026] Step 102: Use the user space file system to read the dependency compressed package of the target dependency and obtain the dependency index information of the target dependency.

[0027] In a specific implementation process, a target dependency can be understood as a dependency or dependency package to be installed. For example, it can be an application, a mini-program, a plugin, a component, etc. Generally, to install a dependency, the dependency package needs to be obtained first. The dependency package is usually in the format of a compressed package, such as a tgz package. When the client needs to install a project or a dependency, it can request the server to download the corresponding dependency package. A project can be understood as a type of business. For example, a payment business. A project can include one or more dependencies. It is possible to request to download the dependency compressed packages corresponding to all the dependencies of a project at once, or to request to download the dependency compressed package of one of the dependencies. That is, the target dependency can be one or more. The user space file system, i.e., the fuse system, refers to a file system that is completely implemented in the user space. Users can customize and implement their own file systems in the user space through fuse. In the embodiments of this specification, when constructing the dependency directory of a dependency, the fuse system can be used to construct a custom file system, and the custom file system can be used to directly read the dependency compressed package to obtain the dependency index information of the target dependency, without the need to decompress the dependency package. The dependency index information can be understood as the information used to define the specific location of the dependency in the compressed package.

[0028] Step 104: Create a soft link corresponding to the target dependency according to the dependency index information.

[0029] In a specific implementation process, a soft link is a symlink. Generally, there is no symlink in the dependency package. In the embodiments of this specification, the fuse system can be used to create a soft link corresponding to the target dependency based on the dependency index information. A soft link (also called a symbolic link) is different from a hard link. The content stored in the file user data block is the pointer to the path name of another file. A soft link is just an ordinary file, but the content of the data block is a bit special. Soft links can be created for files or directories. In this way, when constructing the node_modules, i.e., the dependency directory, based on fuse, the inode nodes that simulate the npm directory structure can be constructed in advance, which can save the process of manually creating symlinks after the dependencies are installed.

[0030] Step 106: Add the target dependency to the dependency directory according to the dependency index information and the soft link.

[0031] In a specific implementation process, after creating the soft link, the target dependency can be added to the dependency directory based on the dependency index information and the soft link, thereby completing the installation of the target dependency. Figure 2 It is a schematic diagram of the structure of the dependency directory in an embodiment of this specification, such as Figure 2As shown in the figure, in the embodiments of this specification, the dependency directory in the dependency catalog may include dependent files, directories, and symlinks. Among them, files may refer to dependent data information, and directories may represent dependency relationships, etc. In the usual node_modules structure, symlinks are created after downloading and decompressing the dependency compressed package. The node_modules directory in the embodiments of this specification is a custom file system based on the fuse structure, and a symlink is also a type of file. When constructing the files and directories of the file system, the symlink can be constructed at the same time, rather than later, so that parallel construction can be carried out, saving the construction time of node_modules.

[0032] If the method in the embodiments of this specification is applied to the server side, the server side can send the generated dependency directory to the client after generating it, so that the client can manage the dependencies.

[0033] The method for creating a dependency directory provided by the embodiments of this specification directly reads the index information of the dependency package using the user space file system, and creates an inode of the dependency directory, eliminating the process of manually creating a dependency inode after dependency installation, saving the creation time of the dependency directory, improving the creation efficiency of the dependency directory and the installation efficiency of the dependencies. It has been verified that the speed of dependency installation can be increased by about 2 seconds.

[0034] In some embodiments, the reading of the dependency compressed package of the target dependency using the user space file system includes:

[0035] Query whether the dependency compressed package of the target dependency exists in the cache. If it does not exist, download the dependency compressed package of the target dependency, and use the user space file system to read the dependency compressed package of the target dependency to obtain the dependency index information of the target dependency.

[0036] In the specific implementation process, during the installation of npm dependency packages, we will cache the tgz installation package of each dependency to the user's disk. When installing dependencies each time, we can pre-judge whether the dependencies to be downloaded are already cached with ready-made data locally. If so, there is no need to download repeatedly, otherwise we will download to avoid repeated data downloads and improve data processing efficiency.

[0037] In addition, in some embodiments of this specification, the reading of the dependency compressed package of the target dependency using the user space file system includes:

[0038] Query whether the dependency compressed package of the target dependency exists in the cache. If it exists, directly read the dependency compressed package of the target dependency in the cache to obtain the dependency index information of the target dependency.

[0039] In a specific implementation process, the embodiments of this specification adopt the form of a reusable cache. After determining that the dependency compressed package of the target dependency already exists in the cache, the fuse system and a custom file system can be used to directly read the cached dependency compressed package to build the node_modules, that is, directly read the dependency compressed package in the cache to obtain the dependency index information of the target dependency, without copying the tgz package to the project directory, saving the time of file copying, and directly saving the disk space occupied by copying files.

[0040] In some embodiments of this specification, the method further includes:

[0041] Save the downloaded dependency compressed package of the target dependency to the cache.

[0042] In a specific implementation process, each downloaded dependency compressed package can be saved in the cache, such as: cached to the user's disk for backup, reducing the space occupied by the dependency installation disk.

[0043] Figure 3 It is a schematic diagram of the construction principle of the dependency directories of different projects in a scenario example of this specification, such as Figure 3 As shown, when the user installs the dependencies of "Project One", since there is no data in the neutralized dependency cache, dependencies 1-5 will be downloaded to the cache directory. At the same time, based on these five dependency packages (in tgz format), the node_modules directory of "Project One" is constructed through a custom file system. When the user installs the dependencies of "Project Two", since there is already cached data of "Dependency 3" locally, only dependencies 6-8 need to be downloaded to the cache directory additionally. At the same time, based on Dependency 3 and Dependencies 6-8, the node_modules directory of "Project Two" is constructed. The node_modules directory of the project is also constructed through a custom file system, rather than copying all the required dependencies to the project directory. Omitting the copying action can reduce the installation time. At the same time, the same dependency packages are continuously reused, which can reduce the time for downloading the same dependency package each time and also reduce the additional disk space occupied by the same dependency.

[0044] The method for creating a dependency directory provided by the embodiments of this specification innovatively uses the fuse solution to optimize the original usage method of decompressing the npm tgz package into a method that does not require decompression. At the same time, a central cache is used to cache the tgz package locally for the user, reducing the dependency installation time and the disk space occupied by the installation. It has been verified that the disk space occupied by the installation is reduced by 90%, and the installation time is reduced by 54%. As the number of projects installed by the user increases, the more dependencies can be reused, and the optimization effect will be more obvious.

[0045] In the embodiments of the above method in this specification, each embodiment is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. For the relevant parts, reference can be made to the corresponding descriptions in the method embodiments.

[0046] Based on the above-described method for creating a dependency directory, one or more embodiments of this specification also provide an apparatus for creating a dependency directory. The apparatus may include devices (including distributed systems), software (applications), modules, plugins, servers, clients, etc. that use the method described in the embodiments of this specification, and an apparatus combined with necessary implementation hardware. Based on the same inventive concept, the apparatuses in one or more embodiments provided in the embodiments of this specification are as described in the following embodiments. Since the implementation solutions for the apparatus to solve problems are similar to those of the method, the implementation of the specific apparatus in the embodiments of this specification can refer to the implementation of the foregoing method, and the repeated parts will not be elaborated. As used hereinafter, the term "unit" or "module" may be a combination of software and / or hardware that can implement a predetermined function. Although the apparatuses described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0047] Specifically, Figure 4 is a schematic diagram of the module structure of an embodiment of the apparatus for creating a dependency directory provided in this specification. As Figure 4 shown, the apparatus for creating a dependency directory provided in this specification may include:

[0048] An index reading module 41, configured to read a dependency compression package of a target dependency by using a user space file system, and obtain dependency index information of the target dependency;

[0049] A soft link creation module 42, configured to create a soft link corresponding to the target dependency according to the dependency index information;

[0050] A dependency directory adding module 43, configured to add the target dependency to a dependency directory according to the dependency index information and the soft link.

[0051] In some embodiments of this specification, the index reading module is specifically configured to:

[0052] Query whether a dependency compression package of the target dependency exists in the cache. If not, download the dependency compression package of the target dependency, and read the dependency compression package of the target dependency by using a user space file system to obtain the dependency index information of the target dependency.

[0053] In some embodiments of this specification,

[0054] The index reading module is specifically configured to:

[0055] Check whether the dependency compressed package of the target dependency exists in the query cache. If it exists, directly read the dependency compressed package of the target dependency in the cache and obtain the dependency index information of the target dependency.

[0056] In some embodiments of this specification, the device further includes a data cache module for:

[0057] Save the downloaded dependency compressed package of the target dependency to the cache.

[0058] The embodiments of this specification innovatively use the fuse scheme to optimize the original way of decompressing the npm tgz package into a way that does not require decompression. At the same time, the tgz package is cached locally by the user using the central cache, reducing the installation time of dependencies and the occupation of installation disk space.

[0059] It should be noted that the above-mentioned device may also include other implementation manners according to the description of the corresponding method embodiments. The specific implementation manners can be referred to the description of the corresponding method embodiments above and will not be elaborated here one by one.

[0060] The embodiments of this specification also provide a device for creating a dependency directory, including: at least one processor and a memory for storing processor-executable instructions. When the processor executes the instructions, the method for creating the dependency directory in the above embodiments is implemented, such as:

[0061] Download the dependency compressed package of the target dependency;

[0062] Use the user space file system to read the dependency compressed package and obtain the dependency index information of the target dependency;

[0063] Create a soft link corresponding to the target dependency according to the dependency index information;

[0064] Add the target dependency to the dependency directory according to the dependency index information and the soft link.

[0065] It should be noted that the above-mentioned device or system may also include other implementation manners according to the description of the method embodiments. The specific implementation manners can be referred to the description of the relevant method embodiments above and will not be elaborated here one by one.

[0066] The directory-dependent creation device and equipment provided in this specification can also be applied in various data analysis and processing systems. The system, server, terminal, or device can be a single server or can include a server cluster, system (including a distributed system), software (application), actual operating device, logic gate circuit device, quantum computer, etc. that use one or more of the methods or one or more embodiments of this specification, and a terminal device combined with necessary implementation hardware. The detection system for checking differential data can include at least one processor and a memory storing computer-executable instructions. When the processor executes the instructions, it implements the steps of the method in any one or more of the above embodiments.

[0067] The method embodiments provided in the embodiments of this specification can be executed on a mobile terminal, computer terminal, server, or similar computing device. Taking running on a server as an example, Figure 5 is a hardware structure block diagram of a directory-dependent creation server in an embodiment of this specification. This computer terminal can be the directory-dependent creation server or directory-dependent creation device in the above embodiments. As Figure 5 shown, the server 10 can include one or more (only one is shown in the figure) processors 100 (the processor 100 can include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a non-volatile memory 200 for storing data, and a transmission module 300 for communication functions. Those of ordinary skill in the art can understand that Figure 5 the structure shown is only schematic and does not limit the structure of the above electronic device. For example, the server 10 may further include more or fewer plugins than Figure 5 shown, such as other processing hardware, such as a database or multi-level cache, GPU, or have a different configuration from Figure 5 shown.

[0068] The non-volatile memory 200 can be used to store software programs and modules of application software, such as the program instructions / modules corresponding to the directory-dependent creation method in the embodiments of this specification. The processor 100 executes various functional applications and resource data updates by running the software programs and modules stored in the non-volatile memory 200. The non-volatile memory 200 can include high-speed random access memory and can also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the non-volatile memory 200 can further include a memory remotely set relative to the processor 100, and these remote memories can be connected to the computer terminal through a network. Examples of the above network include, but are not limited to, the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.

[0069] The transmission module 300 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission module 300 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 300 can be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0070] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0071] The method or device described in the above embodiments provided in this specification can implement the business logic through a computer program and record it on a storage medium. The storage medium can be read and executed by a computer to achieve the effects of the solutions described in the embodiments of this specification, such as:

[0072] Download the dependency compressed package on which the target depends;

[0073] Use the user space file system to read the dependency compressed package and obtain the dependency index information of the target dependency;

[0074] Create a soft link corresponding to the target dependency according to the dependency index information;

[0075] Add the target dependency to the dependency directory according to the dependency index information and the soft link.

[0076] The storage medium may include a physical device for storing information, usually storing the information after digitization and then using media such as electrical, magnetic, or optical means. The storage medium can include: devices for storing information using electrical energy, such as various memories, such as RAM, ROM, etc.; devices for storing information using magnetic energy, such as hard disks, floppy disks, magnetic tapes, magnetic core memories, magnetic bubble memories, USB flash drives; devices for storing information using optical means, such as CDs or DVDs. Of course, there are also other types of readable storage media, such as quantum memories, graphene memories, and so on.

[0077] The above method or device for creating a dependency directory provided by the embodiments of this specification can be implemented by a processor executing corresponding program instructions in a computer. For example, it can be implemented in a PC using the C++ language with the Windows operating system, in a Linux system, or in other ways such as using programming languages for Android or iOS systems on intelligent terminals, and also implemented based on the processing logic of quantum computers, etc.

[0078] The embodiments of this specification are not limited to those that must conform to industry communication standards, standard computer resource data update and data storage rules, or the situations described in one or more embodiments of this specification. Some industry standards or implementation schemes slightly modified based on the implementation described by using a custom method or embodiment can also achieve the same, equivalent, or similar, or predictable implementation effects after deformation as those of the above embodiments. The embodiments obtained by applying these modified or deformed data acquisition, storage, judgment, processing methods, etc. still fall within the scope of the optional implementation schemes of the embodiments of this specification.

[0079] For the convenience of description, when describing the above platforms and terminals, various modules are described separately according to their functions. Of course, when implementing one or more of this specification, the functions of each module can be implemented in the same or multiple software and / or hardware, or the modules implementing the same function can be realized by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or plugins can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be in electrical, mechanical, or other forms.

[0080] These computer program instructions can also be loaded onto a computer or other programmable resource data update device, so that a series of operation steps are executed on the computer or other programmable device to generate computer-implemented processing. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one process or multiple processes and / or Figure 1 boxes or multiple boxes.

[0081] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the description of the method embodiment. In the description of this specification, the description of reference terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0082] The above is only the embodiment of one or more embodiments of this specification and is not used to limit one or more embodiments of this specification. For those skilled in the art, various changes and modifications can be made to one or more embodiments of this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included within the scope of the claims.

Claims

1. A method for creating a dependency directory, the method comprising: Constructing a custom file system using a user space file system, and reading a dependency compressed package of a target dependency using the custom file system without decompressing the dependency compressed package, to obtain dependency index information of the target dependency, where the dependency index information is used to define logical path information of the target dependency in the dependency compressed package; Creating, using the custom file system according to the dependency index information, a soft link corresponding to the target dependency that points to a logical path within the dependency compressed package; Adding, using the custom file system according to the dependency index information and the soft link, the target dependency to a dependency directory to complete the installation of the target dependency; The dependency directory includes dependent files, directories, and soft links.

2. The method according to claim 1, where reading the dependency compressed package of the target dependency using the user space file system includes: Querying whether the dependency compressed package of the target dependency exists in a cache, and if not, downloading the dependency compressed package of the target dependency and reading the dependency compressed package of the target dependency using the user space file system to obtain the dependency index information of the target dependency.

3. The method according to claim 1, where reading the dependency compressed package of the target dependency using the user space file system includes: Querying whether the dependency compressed package of the target dependency exists in a cache, and if so, directly reading the dependency compressed package of the target dependency in the cache to obtain the dependency index information of the target dependency.

4. The method according to claim 3, the method further comprising: Saving the downloaded dependency compressed package of the target dependency to the cache.

5. The method according to claim 1, the method is applied to a server or a client.

6. An apparatus for creating a dependency directory, the apparatus comprising: An index reading module, configured to construct a custom file system using a user space file system, and read a dependency compressed package of a target dependency using the custom file system without decompressing the dependency compressed package, to obtain dependency index information of the target dependency, where the dependency index information is used to define logical path information of the target dependency in the dependency compressed package; A soft link creating module, configured to create, using the custom file system according to the dependency index information, a soft link corresponding to the target dependency that points to a logical path within the dependency compressed package; A dependency directory adding module, configured to add, using the custom file system according to the dependency index information and the soft link, the target dependency to a dependency directory to complete the installation of the target dependency; The dependency directory includes dependent files, directories, and soft links.

7. The apparatus according to claim 6, where the index reading module is specifically configured to: Query whether the dependency compressed package of the target dependency exists in a cache, and if not, download the dependency compressed package of the target dependency and read the dependency compressed package of the target dependency using the user space file system to obtain the dependency index information of the target dependency.

8. The apparatus according to claim 6, where the index reading module is specifically configured to: Query whether the dependency package of the target dependency exists in the query cache. If it exists, directly read the dependency package of the target dependency in the cache to obtain the dependency index information of the target dependency.

9. The device according to claim 8, wherein the device further comprises a data cache module for: Save the downloaded dependency package of the target dependency to the cache.

10. A directory-dependent creation device, comprising: At least one processor and a memory for storing processor-executable instructions, wherein the processor, when executing the instructions, implements the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • JavaScript module installation method and apparatus

    CN107391161A