Dependence integrity determination method and device of npm component, equipment and medium

By matching the complete dependency component information and initial component introduction information in software package development, the problem of incomplete dependency of npm components is solved, ensuring dependency integrity and improving software development efficiency.

CN119536796APending Publication Date: 2025-02-28AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411686979.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

During the software package development process, the developers cannot link to the official source in real time, resulting in incomplete dependence of npm components, affecting the efficiency of software development.

Method used

By obtaining the target software's package, determining its dependency component file, determining the complete dependency component information based on the direct dependency component information, and matching the initial component introduction information and the component offline library to obtain the dependency integrity result.

Benefits of technology

Ensure that npm dependency is complete, avoid the repeated introduction of components that already exist in the offline library of components, improve software development efficiency, and reduce package building failures caused by missing dependent components.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119536796A_ABST
    Figure CN119536796A_ABST
Patent Text Reader

Abstract

The invention discloses a dependency integrity determination method and device of an npm component, equipment and a medium. The method comprises the steps of obtaining a program package of target software, and determining a dependent component file in the program package; determining complete dependent component information according to direct dependent component information in the dependent component file; and matching the complete dependency component information, the initial component introduction information and the component offline library to obtain a dependency integrity result of the program package. According to the technical scheme provided by the embodiment of the invention, for a scene that an offline warehouse manages the npm component, dependency check is performed before the component is introduced, and matching is performed through complete dependency component information, initial component introduction information and the component offline library, so that repeated introduction of existing components in the component offline library is avoided while dependency completeness is ensured, and the user experience is improved. The missing dependency information is prevented from being checked according to the downloading error log, the missing dependency component information is directly determined according to the matching result, the npm dependency completeness is ensured, and the software development efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software development, and in particular to a method, device, equipment and medium for determining dependency integrity of an npm component. Background Art

[0002] Currently, when developers build packages for front-end software, in order to ensure that the npm components used in the packages have been evaluated and security scanned, the download source of the npm components configured in the build environment is the component offline library in the intranet environment. The components in the component offline library need to be downloaded in advance and then uploaded to the component offline library. When developers are developing packages, they cannot link to the official source in real time to download and install missing components.

[0003] Therefore, it often happens that the component dependencies introduced by developers are incomplete, resulting in package building failure, that is, the components on which the components introduced by developers depend are missing in the component offline library, affecting software development efficiency. Summary of the invention

[0004] The present invention provides a method, device, equipment and medium for determining the dependency integrity of an npm component, so as to solve the problem of incomplete npm component dependencies caused by components introduced by developers during the development of a software package.

[0005] According to one aspect of the present invention, a method for determining dependency integrity of an npm component is provided, comprising:

[0006] Obtain a program package of the target software, and determine dependent component files in the program package;

[0007] Determine complete dependent component information according to the direct dependent component information in the dependent component file;

[0008] The complete dependent component information is matched with the initial component introduction information and the component offline library to obtain the dependency integrity result of the program package.

[0009] According to another aspect of the present invention, there is provided a device for determining dependency integrity of an npm component, comprising:

[0010] A program package determination module, used to obtain a program package of the target software and determine dependent component files in the program package;

[0011] A complete dependent component determination module, used to determine complete dependent component information according to direct dependent component information in the dependent component file;

[0012] The dependency integrity determination module is used to match the complete dependency component information with the initial component introduction information and the component offline library to obtain the dependency integrity result of the program package.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] at least one processor; and

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

[0016] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the dependency integrity determination method of the npm component described in any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for determining the dependency integrity of an npm component described in any embodiment of the present invention when executed.

[0018] The technical solution of the embodiment of the present invention is aimed at the scenario of managing npm components in an offline warehouse. A dependency check is performed before the component is introduced. The complete dependency component information is matched with the initial component introduction information and the component offline library. While ensuring the completeness of the dependency, the components already existing in the component offline library are avoided from being repeatedly introduced, and the missing dependency information is avoided from being checked based on the download error log. The missing dependency component information is directly determined based on the matching result, thereby ensuring the completeness of the npm dependency and improving the software development efficiency.

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

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 This is a flowchart of a method for determining dependency integrity of an npm component provided according to Embodiment 1 of the present invention;

[0022] Figure 2 2 is a schematic diagram of a structure of a device for determining dependency integrity of an npm component provided according to Embodiment 3 of the present invention;

[0023] Figure 3 It is a structural schematic diagram of an electronic device that implements the method for determining the dependency integrity of an npm component according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "candidate", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] Embodiment 1

[0027] Figure 1 A flowchart of a method for determining the dependency integrity of an npm component is provided for the first embodiment of the present invention. This embodiment is applicable to the case of determining the integrity of an npm component in a software package. The method can be performed by a device for determining the dependency integrity of an npm component. The device for determining the dependency integrity of an npm component can be implemented in the form of hardware and / or software. The device for determining the dependency integrity of an npm component can be configured in a server with computing capabilities. Figure 1 As shown, the method includes:

[0028] S110: Obtain a program package of the target software, and determine dependent component files in the program package.

[0029] Among them, the target software refers to the software that is being developed by developers and has not been officially released for external use. The program package refers to the file package that includes all program information that supports the current functions of the target software. The dependency component file refers to the folder in the program package that is used to store the directly dependent components required for the current functions of the target software. For example, the directly dependent component is the directly dependent npm component. Npm is a package management tool installed with nodejs, which can solve many problems in nodejs code deployment and allow users to download third-party packages from the npm repository to local use. For example, the dependency component file is a pre-defined folder with a fixed location and a fixed name, and the information of all npm components currently required by the target software is stored in this folder, such as the name, size, and version information of the dependent npm component.

[0030] Specifically, the program package of the target software is obtained, and the dependent component file is determined from the program package according to the file name or file location of the predefined dependent component file. Exemplarily, the package.json file is the name of the dependent component file, and the program package is searched according to the name.

[0031] S120. Determine complete dependent component information according to the direct dependent component information in the dependent component file.

[0032] Since the direct dependency component information in the dependency component file is the relevant information of the direct dependency component of the target software, the normal startup of the relevant functions of the target software also requires indirect dependency component information, that is, the component information on which the direct dependency component depends. For example, the dependency component file includes npm component 1 information and npm component 2 information, which are the component information directly used by the target software, but npm component 1 needs to rely on npm component 3 to run normally, so npm component 3 is the direct dependency component of npm component 1 and the indirect dependency component of the target software.

[0033] Specifically, the corresponding indirect dependent component information is determined according to the direct dependent component information in the dependent component file, and all complete dependent component information of the target software is determined according to the direct dependent component information and the indirect dependent component information.

[0034] In a feasible embodiment, S120 includes:

[0035] Determine all indirect dependent component information corresponding to the directly dependent component step by step according to the directly dependent component information;

[0036] The complete dependent component information is determined according to the direct dependent component information and the indirect dependent component information.

[0037] Since the dependent components of the directly dependent components may also have dependent components, in order to ensure the integrity and accuracy of the complete dependent component information, the dependent component relationships of the directly dependent components are queried level by level until it is determined that the last level of indirect dependent components has no dependent components. All the indirect dependent component information and direct dependent component information obtained by the level by level query are determined as the complete dependent component information.

[0038] For example, based on the above example, the dependent component of npm component 2 is npm component 4, the dependent component of npm component 3 is npm component 5, and npm component 4 and npm component 5 have no dependent components, then npm component 3, npm component 4 and npm component 5 are all corresponding indirect dependent components, plus npm component 1 and npm component 2 for complete dependent component information. For example, the npm-remote-ls function can be used to recursively scan the package.json file of the npm component and return all dependent component information of the npm component to obtain complete dependent component information.

[0039] The complete dependent component information can be quickly checked out through centralized level-by-level scanning, which improves the accuracy and efficiency of determining the complete dependent components.

[0040] S130: Match the complete dependent component information with the initial component introduction information and the component offline library to obtain a dependency integrity result of the program package.

[0041] Among them, during the software development process, developers can connect to the npm official warehouse to download open source components at will, so there will be no lack of dependencies and errors when performing packaging verification. However, since some components have not been security scanned, there may be high-risk vulnerabilities that affect system stability and security, and are not suitable for use when the program is officially released to the outside world. Therefore, when building the final online release package, it is necessary to use the component offline library to download components that have been security scanned. That is, the component offline library is an npm component warehouse in the intranet environment. It is necessary to pre-download the npm components and upload them to the warehouse before providing them to the target software for startup and use. It is impossible to link to the official source in real time for download and installation. The initial component introduction information is the component information required for the normal operation of the target software determined by the developer. Since the component offline library is a public warehouse, the npm components used by other software are also obtained from the component offline library. Therefore, there is a situation where multiple software use the same component. The initial component introduction information is the component information that the developer preliminarily determines to be added to the component offline library based on the specific implementation function dependency components of the component offline library and the target software, that is, the initial component introduction information is the component information that does not exist in the component offline library determined by the developer, but the target software needs to use the corresponding component information.

[0042] The initial component introduction information is the component information that does not exist in the component offline library, but exists in the complete dependent component information. Therefore, according to this logic, if it exists in the complete dependent component information and does not exist in the initial component introduction information and the component offline library, the dependency is incomplete. At the same time, according to this logic, the initial component introduction information can be checked for download duplication, that is, it is determined that the initial component introduction information exists and the duplicate component information also exists in the component offline library, and the duplicate component information is deleted from the initial component introduction information to avoid repeated downloading of shared components, resulting in memory waste in the component offline library.

[0043] In a feasible embodiment, S130 includes:

[0044] According to the matching results, the missing dependent component information that exists in the complete dependent component information and does not exist in the initial component introduction information and the component offline library is determined;

[0045] If the missing dependent component information is empty, the dependency integrity result is determined to be that the initial component introduction information dependency is complete;

[0046] Otherwise, the dependency completeness result is determined to be incomplete for the initial component introduction information.

[0047] According to the matching results of the complete dependent component information, the initial component introduction information, and the component offline library, if the target dependent component exists in the complete dependent component information, and the target dependent component does not exist in the initial component introduction information and the component offline library, then the target dependent component is determined to be the missing dependent component information, that is, the missing dependent component information is not empty, and the dependency integrity result is determined to be incomplete initial component introduction information. The initial component introduction information needs to be re-determined to avoid the problem of expanding the scope of influence caused by incomplete shared component dependencies when the target software is used normally. If the target dependent component does not exist, that is, the initial component introduction information is consistent with the complete dependent component information, or the summary results of the initial component introduction information and some components in the component offline library are consistent with the complete dependent component information.

[0048] In a feasible embodiment, after obtaining the dependency integrity result of the program package, the method further includes:

[0049] The target download component is determined according to the dependency integrity result, and the target download component is added to the component offline library.

[0050] The target download component is a dependent component that is required to be downloaded and added to the component offline library for the target software to run, that is, the target download component is a component that does not exist in the component offline library but has a dependency relationship with the target software.

[0051] All target download components are determined based on the dependency integrity results to ensure the accuracy of the target download components and avoid the problem of expanding the impact scope due to incomplete shared component dependencies during normal use of the target software.

[0052] In a feasible embodiment, determining the target download component according to the dependency integrity result includes:

[0053] If the dependency integrity result is that the initial component introduction information dependency is complete, the target download component is determined based on the initial component introduction information.

[0054] If the dependency integrity result is that the initial component introduction information dependency is complete, that is, the initial component introduction information is consistent with the complete dependent component information, or the comprehensive result of the initial component introduction information and some components in the component offline library are consistent with the complete dependent component information, then all components in the initial component introduction information are target download components.

[0055] In a feasible embodiment, determining the target download component according to the dependency integrity result includes:

[0056] If the dependency integrity result is that the initial component introduction information is incomplete, the target download component is determined based on the initial component introduction information and the missing dependent component information.

[0057] If the dependency integrity result is that the initial component introduction information is incomplete, it means that the target dependent component exists in the complete dependent component information, and the target dependent component does not exist in the initial component introduction information and the component offline library. The target dependent component is the missing dependent component information, and all components in the initial component introduction information plus the actual dependent components are the target downloaded components.

[0058] In a feasible embodiment, before determining the target download component according to the initial component introduction information and the missing dependent component information, the method further includes:

[0059] The initial component introduction information is updated according to the missing dependent component information to obtain updated component introduction information;

[0060] Match the complete dependency component information, updated component import information, and component offline library again to obtain the update dependency integrity result of the package;

[0061] If the update dependency integrity result is that the update component introduction information dependency is complete, the target download component is determined according to the update component introduction information.

[0062] Since the missing dependency component information is the missing part in the initial component introduction information, the missing dependency component information is added to the initial component introduction information to obtain the updated component introduction information, and the dependency integrity is determined again for the updated component introduction information. If the updated component introduction information has complete dependencies and there are no duplicate components in the component offline library, the target download component is determined based on the updated component introduction information.

[0063] The updated component introduction information obtained by the missing dependent component information is used to determine the dependency integrity of the updated component introduction information again, further improving the accuracy of the npm component dependency integrity.

[0064] Optionally, an automated check method is used, by pre-setting a pipeline and configuring dependency check steps in the build definition. The dependency check steps include but are not limited to: obtaining the program package of the target software and determining the dependent component files in the program package; determining the complete dependent component information based on the direct dependent component information in the dependent component file; matching the complete dependent component information with the initial component introduction information and the component offline library to obtain the dependency integrity result of the program package.

[0065] Through pipeline settings, the system is not restricted by differences in software systems. The pipeline can be configured once and applied to the npm component dependency integrity check of all software packages. Through one-time configuration, it is ensured that the dependency check step can be automatically triggered before all software storage operations are executed, and the execution of the inspection task method and the return format are consistent, which ensures the stability of the dependency check and facilitates developers to obtain new lists.

[0066] The technical solution of the embodiment of the present invention is aimed at the scenario of managing npm components in an offline warehouse. A dependency check is performed before the component is introduced. The complete dependency component information is matched with the initial component introduction information and the component offline library. While ensuring the completeness of the dependency, the components already existing in the component offline library are avoided from being repeatedly introduced, and the missing dependency information is avoided from being checked based on the download error log. The missing dependency component information is directly determined based on the matching result, thereby ensuring the completeness of the npm dependency and improving the software development efficiency.

[0067] Embodiment 2

[0068] Figure 2 A schematic diagram of the structure of a device for determining the dependency integrity of an npm component provided in the second embodiment of the present invention. Figure 2 As shown, the device comprises:

[0069] A program package determination module 210 is used to obtain a program package of the target software and determine dependent component files in the program package;

[0070] A complete dependent component determination module 220, configured to determine complete dependent component information according to direct dependent component information in the dependent component file;

[0071] The dependency integrity determination module 230 is used to match the complete dependency component information with the initial component import information and the component offline library to obtain the dependency integrity result of the program package.

[0072] The technical solution of the embodiment of the present invention is aimed at the scenario of managing npm components in an offline warehouse. A dependency check is performed before the component is introduced. The complete dependency component information is matched with the initial component introduction information and the component offline library. While ensuring the completeness of the dependency, the components already existing in the component offline library are avoided from being repeatedly introduced, and the missing dependency information is avoided from being checked based on the download error log. The missing dependency component information is directly determined based on the matching result, thereby ensuring the completeness of the npm dependency and improving the software development efficiency.

[0073] Optional, complete dependency component determination module, specifically used for:

[0074] Determine all indirect dependent component information corresponding to the directly dependent component step by step according to the directly dependent component information;

[0075] Complete dependent component information is determined according to the directly dependent component information and the indirectly dependent component information.

[0076] Optional, dependency integrity determination module, including:

[0077] A missing dependent component information determining unit, configured to determine, based on the matching result, missing dependent component information that exists in the complete dependent component information and does not exist in the initial component introduction information and the component offline library;

[0078] A dependency completeness determination unit, configured to determine that the dependency completeness result is that the initial component introduction information dependency is complete if the missing dependency component information is empty;

[0079] The dependency incomplete determination unit is used to determine that the dependency completeness result is that the initial component introduction information is incomplete if the missing dependency component information is not empty.

[0080] Optionally, the device further comprises a component download module, which is used to, after obtaining the dependency integrity result of the program package,

[0081] A target download component is determined according to the dependency integrity result, and the target download component is added to the component offline library.

[0082] Optionally, the component download module includes a first target download component determination unit, which is used to:

[0083] If the dependency integrity result is that the initial component introduction information dependency is complete, the target download component is determined according to the initial component introduction information.

[0084] Optionally, the component download module includes a second target download component determination unit, which is used to:

[0085] If the dependency integrity result is that the initial component introduction information is incomplete, a target download component is determined according to the initial component introduction information and the missing dependency component information.

[0086] Optionally, the device further comprises a dependency integrity redetermining module, which is used to, before determining the target download component according to the initial component introduction information and the missing dependency component information,

[0087] The initial component introduction information is updated according to the missing dependent component information to obtain updated component introduction information;

[0088] Matching the complete dependency component information with the updated component introduction information and the component offline library again to obtain an update dependency integrity result of the program package;

[0089] If the update dependency integrity result is that the update component introduction information dependency is complete, the target download component is determined according to the update component introduction information.

[0090] The device for determining the dependency integrity of an npm component provided in an embodiment of the present invention can execute the method for determining the dependency integrity of an npm component provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method.

[0091] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations and do not violate public order and good morals.

[0092] Embodiment 3

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

[0094] Figure 3A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0095] like Figure 3 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0096] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0097] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the dependency integrity determination method of the npm component.

[0098] In some embodiments, the dependency integrity determination method of the npm component may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the dependency integrity determination method of the npm component described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the dependency integrity determination method of the npm component in any other appropriate manner (e.g., by means of firmware).

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

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

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

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

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

[0104] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0105] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0106] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for determining the dependency integrity of an npm component, characterized in that: The method includes: Obtain a program package of the target software, and determine dependent component files in the program package; Determine complete dependent component information according to the direct dependent component information in the dependent component file; The complete dependent component information is matched with the initial component introduction information and the component offline library to obtain the dependency integrity result of the program package.

2. The method according to claim 1, characterized in that Determine the complete dependent component information according to the direct dependent component information in the dependent component file, including: Determine all indirect dependent component information corresponding to the directly dependent component step by step according to the directly dependent component information; Complete dependent component information is determined according to the directly dependent component information and the indirectly dependent component information.

3. The method according to claim 1, characterized in that The complete dependent component information is matched with the initial component introduction information and the component offline library to obtain the dependency integrity result of the program package, including: Determine, according to the matching result, missing dependent component information that exists in the complete dependent component information and does not exist in the initial component introduction information and the component offline library; If the missing dependent component information is empty, determining that the dependency integrity result is that the initial component introduction information dependency is complete; Otherwise, it is determined that the dependency integrity result is that the initial component import information is incomplete.

4. The method according to claim 3, characterized in that After obtaining the dependency integrity result of the program package, the method further includes: A target download component is determined according to the dependency integrity result, and the target download component is added to the component offline library.

5. The method according to claim 4, characterized in that Determining a target download component according to the dependency integrity result includes: If the dependency integrity result is that the initial component introduction information dependency is complete, the target download component is determined according to the initial component introduction information.

6. The method according to claim 4, characterized in that Determining a target download component according to the dependency integrity result includes: If the dependency integrity result is that the initial component introduction information is incomplete, a target download component is determined according to the initial component introduction information and the missing dependency component information.

7. The method according to claim 6, characterized in that Before determining the target download component according to the initial component introduction information and the missing dependent component information, the method further includes: The initial component introduction information is updated according to the missing dependent component information to obtain updated component introduction information; Matching the complete dependency component information with the updated component introduction information and the component offline library again to obtain an update dependency integrity result of the program package; If the update dependency integrity result is that the update component introduction information dependency is complete, the target download component is determined according to the update component introduction information.

8. A device for determining the dependency integrity of an npm component, characterized in that: The device includes: A program package determination module, used to obtain a program package of the target software and determine dependent component files in the program package; A complete dependent component determination module, used to determine complete dependent component information according to direct dependent component information in the dependent component file; The dependency integrity determination module is used to match the complete dependency component information with the initial component introduction information and the component offline library to obtain the dependency integrity result of the program package.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the dependency integrity determination method of the npm component described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for determining the dependency integrity of an npm component according to any one of claims 1 to 7 when executed.