Private dependent packet processing method and device, electronic equipment and storage medium

By updating the private dependency package directory and lock file, and using a static archive file format to store the private dependency packages, the lock file conflict problem caused by inconsistent versions of private dependency packages was resolved, thus improving version consistency and collaboration efficiency.

CN121597243APending Publication Date: 2026-03-03TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511664717.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In collaborative development, inconsistent versions of private dependency packages can lead to lock file conflicts, affecting team collaboration efficiency.

Method used

By receiving update instructions, the private dependency package directory and lock file are updated. The private dependency packages are stored in a static archive file format and installed based on the exact version information of the lock file, ensuring version consistency.

Benefits of technology

It reduces lock file conflicts, improves project development collaboration efficiency, and ensures consistency of private dependency package versions across different developers and environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121597243A_ABST
    Figure CN121597243A_ABST
Patent Text Reader

Abstract

The invention provides a private dependent packet processing method and device, electronic equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: receiving an updating instruction of a first developer to a first private dependent packet; updating a private dependent package directory based on the first private dependent package of the first version, the private dependent package directory being used for storing the private dependent package in a format of a static archived file; on the basis of the first private dependent package directory, updating the lock file of the project to obtain a first lock file, the exact downloading information of the private dependent package in the first lock file pointing to one static archived file in the first private dependent package directory; and installing the first private dependent package of the first version. According to the method, error-prone manual operation is packaged into an automatic process, so that the development and cooperation efficiency can be improved; moreover, the static archived file is a static binary file, and the content is versioned and constant, so that version difference during installation by different developers can be avoided, and the lock file conflict is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for processing private dependency packages. Background Technology Dependencies refer to third-party software packages required for a project to run, including public and private dependencies. Private dependencies are developed internally by an organization, not publicly released, and accessible only within the intranet. Organizations typically manage private dependencies by setting up a private repository on the intranet and specifying the repository address in the configuration so that private dependencies are retrieved from that private repository during installation.

[0002] In collaborative projects, external developers or remote environments often encounter difficulties accessing private repositories on the intranet, leading to installation failures and build interruptions due to the inability to install private dependency packages. In related technologies, developers typically store private dependency packages directly in the project's dependency directory as compiled results and commit them to the version control system along with the project's source code. When other developers clone the project from the version control system, the dependency management tool detects the presence of the private dependency package locally, thus skipping the remote download of that package.

[0003] However, in the above methods, developers can arbitrarily modify local private dependency packages, resulting in inconsistent dependency versions in different developers' environments, increased differences in lock file content, and easy to cause lock file conflicts when merging branches, which requires a lot of time to resolve and significantly affects team collaboration efficiency. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, and storage medium for processing private dependency packages, which can reduce lock file conflicts and improve project development collaboration efficiency. The technical solution of this application is as follows.

[0005] According to a first aspect of the embodiments of this application, a method for processing private dependency packages is provided, the method comprising: Receive an update instruction from the first developer for the first private dependency package of the project, the update instruction instructing the first private dependency package to be updated to the first version, the first developer being the developer among the developers of the project who has the right to update the private dependency package of the project; Based on the first version of the first private dependency package indicated by the update instruction, the private dependency package directory is updated to obtain the first private dependency package directory. The first private dependency package directory is used to store private dependency packages in the format of static archive files. One static archive file in the first private dependency package directory corresponds to one version of the private dependency package. Based on the first private dependency package directory, update the lock file of the project to obtain the first lock file. The first lock file is used to indicate the exact version information of the private dependency package of the project and the exact download information of the private dependency package. The exact download information points to a static archive file in the first private dependency package directory. Based on the first private dependency package directory and the first lock file, install the first version of the first private dependency package.

[0006] According to a second aspect of the embodiments of this application, a method for processing private dependency packages is provided, the method comprising: Receive the installation command for the first private dependency package of the first version of the project; Based on the first lock file of the project, a first static archive file is downloaded from the first private dependency package directory. The first private dependency package directory is used to store private dependency packages in the format of static archive files. The first static archive file in the first private dependency package directory corresponds to the first version of the private dependency package. The first lock file is used to indicate the exact version information of the private dependency package of the project and the exact download information of the private dependency package. The exact download information points to a static archive file in the first private dependency package directory. Extract the first private dependency package of the first version from the first static archive file; Install the first private dependency package of the first version.

[0007] According to a third aspect of the embodiments of this application, a processing apparatus for private dependency packages is provided, the apparatus comprising: A receiving module is used to receive an update instruction from a first developer for a first private dependency package of the project. The update instruction indicates that the first private dependency package should be updated to a first version. The first developer is a developer among the developers of the project who has the right to update the private dependency package of the project. The first update module is used to update the private dependency package directory based on the first version of the first private dependency package to obtain the first private dependency package directory. The first private dependency package directory is used to store private dependency packages in the format of static archive files. One static archive file in the first private dependency package directory corresponds to one version of the private dependency package. The second update module is used to update the lock file of the project based on the first private dependency package directory to obtain a first lock file. The first lock file is used to indicate the exact version information of the private dependency package of the project and the exact download information of the private dependency package. The exact download information points to a static archive file in the first private dependency package directory.

[0008] In one possible implementation, the first update module includes: The generation unit is used to generate the first static archive file corresponding to the first private dependency package of the first version; The first update unit is used to update the static archive file in the private dependency package directory based on the first static archive file, so as to obtain the first private dependency package directory.

[0009] In one possible implementation, the project further includes a dependency directory for storing the project's private dependency packages locally, and the generation unit is used for: If the dependency directory includes the first version of the first private dependency package, the first version of the first private dependency package in the dependency directory will be used to generate the first static archive file; or, If the dependency directory does not include the first version of the first private dependency package, download the first version of the first private dependency package from the private repository and generate the first static archive file from the first version of the first private dependency package.

[0010] In one possible implementation, the second update module includes: The second update unit is used to update the exact version information of the first private dependency package to the first version and the exact download information of the first private dependency package to the first static archive file in the first private dependency package directory, based on the first static archive file in the first private dependency package directory, to obtain the first lock file.

[0011] In one possible implementation, the project further includes a dependency management configuration file, which includes configuration information, such as specified version information and specified download information for the project's private dependency packages, wherein the specified download information points to a static archive file in the private dependency package directory. The apparatus further includes: The third update module is used to update the specified version information of the first private dependency package to the first version in the dependency management configuration file of the project based on the first static archive file in the first private dependency package directory, and update the specified download information of the first private dependency package to the first static archive file in the first private dependency package directory, so as to obtain the first dependency management configuration file.

[0012] In one possible implementation, the configuration information further includes the resolution path of the project's private dependency packages, and the third update module is further configured to: In the dependency management configuration file, the resolution path of the first private dependency package is forced to point to the first static archive file in the directory of the first private dependency package.

[0013] In one possible implementation, the project further includes a dependency directory for locally storing private dependency packages of the project, as well as information indicating the actual version and actual download information of the private dependency packages. The apparatus further includes: The fourth update module is used to update the first private dependency package to the first version of the private dependency package in the dependency directory based on the first static archive file in the first private dependency package directory, update the actual version information of the first private dependency package to the first version, and update the actual download information of the first private dependency package to the first static archive file in the first private dependency package directory, thereby obtaining the first dependency directory.

[0014] In one possible implementation, the device further includes: The error reporting module is used to generate update error messages and exit the update process if any one of the following is updated: the private dependency package directory, the project's dependency management configuration file, the project's lock file, and the project's dependency directory, and any update fails.

[0015] In one possible implementation, the installation module includes: The download unit is configured to download the first static archive file from the first private dependency package directory based on the first lock file; The extraction unit is used to extract the first private dependency package of the first version from the first static archive file; The installation unit is used to install the first private dependency package of the first version.

[0016] In one possible implementation, the update instructions are pre-configured in the project's script.

[0017] In one possible implementation, the static archive file is in the format of an archive compressed package.

[0018] In one possible implementation, the receiving module is configured to: Based on human-computer interaction, the system receives update instructions from the first developer for the first private dependency package of the project.

[0019] In one possible implementation, the device further includes: The upload module is used to upload the first private dependency package directory and the first lock file to the first server, and the developers of the project share the first private dependency package directory and the first lock file in the first server.

[0020] According to a fourth aspect of the embodiments of this application, a processing apparatus for private dependency packages is provided, the apparatus comprising: The receiving module is used to receive installation instructions for the first private dependency package of the first version of the project; The download module is used to download a first static archive file from a first private dependency package directory based on a first lock file of the project. The first private dependency package directory is used to store private dependency packages in the format of static archive files. The first static archive file in the first private dependency package directory corresponds to the first version of the private dependency package. The first lock file is used to indicate the exact version information of the private dependency package of the project and the exact download information of the private dependency package. The exact download information points to a static archive file in the first private dependency package directory. The extraction module is used to extract the first private dependency package of the first version from the first static archive file; The installation module is used to install the first private dependency package of the first version.

[0021] In one possible implementation, the installation instruction is a freeze lock file installation instruction, and the download module is used for: Query the first lock file; If the installation instructions match the exact version information and exact download information of the first private dependency package in the first lock file, the first static archive file is downloaded from the first private dependency package directory.

[0022] In one possible implementation, the device further includes: The error reporting module is used to generate installation error information when the installation instructions do not match the exact version information and exact download information of the first private dependency package in the first lock file.

[0023] According to a fifth aspect of the embodiments of this application, a computing device is provided, the computing device comprising: One or more processors; Memory used to store computer programs that can be executed by the processor; The processor is configured to execute the computer program to implement the private dependency package processing method provided by the first or second aspect of the embodiments of this application.

[0024] According to a sixth aspect of the embodiments of this application, a computer-readable storage medium is provided, the computer-readable storage medium comprising: when a computer program in the computer-readable storage medium is executed by a processor of a computing device, enabling the computing device to execute the private dependency package processing method provided in the first or second aspect.

[0025] According to a seventh aspect of the embodiments of this application, a computer program product is provided, including one or more instructions, which are executed by one or more processors of a computing device, enabling the computing device to perform the private dependency package processing method provided in the first or second aspect.

[0026] The solution in this application provides a method for processing private dependency packages. This method encapsulates multiple manual operations, such as updating the private dependency package directory and updating the lock file, into an update command for the private dependency package. This improves development and collaboration efficiency and reduces the probability of conflicts and errors. Furthermore, since the private dependency package is stored in the private dependency package directory as a static archive file, and the static archive file is a static binary file with versioned and constant content, it fundamentally eliminates the possibility of the package manager tampering with or dynamically parsing the content of the private dependency package during installation. This avoids version differences when different developers install the package and prevents lock file conflicts. In addition, the updated private dependency package directory and the updated lock file can be reused, thereby ensuring version consistency of private dependency packages installed by different developers or different build environments.

[0027] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0028] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application, and do not constitute an undue limitation of this application.

[0029] Figure 1 This is a schematic diagram of the hardware implementation environment for a method for processing private dependency packages provided in an embodiment of this application; Figure 2 This is a flowchart illustrating a method for processing private dependency packages provided in an embodiment of this application; Figure 3 This is a flowchart illustrating a method for processing private dependency packages provided in an embodiment of this application; Figure 4 This is a flowchart illustrating a method for processing private dependency packages provided in an embodiment of this application; Figure 5This is a flowchart illustrating a method for processing private dependency packages provided in an embodiment of this application; Figure 6 This is a flowchart illustrating a method for processing private dependency packages provided in an embodiment of this application; Figure 7 This is a schematic diagram of a method for processing private dependency packages provided in an embodiment of this application; Figure 8 This is a structural block diagram of a private dependency package processing device provided in an embodiment of this application; Figure 9 This is a structural block diagram of a private dependency package processing device provided in an embodiment of this application; Figure 10 This is a structural block diagram of a terminal provided in an embodiment of this application; Figure 11 This is a structural block diagram of a server provided in an embodiment of this application. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0031] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of methods and systems consistent with some aspects of this application as detailed in the appended claims.

[0032] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items that have essentially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor does it limit the quantity or execution order. It should also be understood that although the following description uses the terms "first," "second," etc., to describe various elements, these elements should not be limited by the terms.

[0033] These terms are simply used to distinguish one element from another. For example, without departing from the various examples, a virtual asset can be called an item object, and similarly, an item object can be called a virtual asset.

[0034] Here, "at least one" means one or more. For example, at least one dependency package can be one dependency package, two dependency packages, three dependency packages, or any integer greater than or equal to one dependency package. "Multiple" means two or more. For example, multiple dependency packages can be two dependency packages, three dependency packages, or any integer greater than or equal to two dependency packages.

[0035] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the private dependency packages involved in this application were obtained with full authorization.

[0036] First, let's introduce the relevant terms used in the embodiments of this application.

[0037] Dependency packages: These are third-party software packages required for a project to run; they are also third-party code module packages. Dependency packages include public dependency packages and private dependency packages.

[0038] Private dependency packages: also known as private packages, refer to software packages developed internally by an organization, not publicly released to public software package registries, and accessible only within the internal network.

[0039] Node.js is an open-source, cross-platform JavaScript runtime environment that allows developers to write server-side code using JavaScript.

[0040] CI / CD (Continuous Integration / Continuous Deployment): refers to the development practice of integrating code, running tests, and deploying software through automated pipelines.

[0041] The hardware implementation environment of this application embodiment is described below. Figure 1 This is a schematic diagram illustrating the implementation environment of a method for processing private dependency packages provided in an embodiment of this application. For example... Figure 1 As shown, the implementation environment specifically includes: terminal 101 and server 102. Terminal 101 can connect to server 102 via a wireless network or a wired network.

[0042] Terminal 101 can be at least one of a personal computer, laptop computer, virtual machine instance, or cloud development environment. Terminal 101 has communication functions and can access the Internet or enterprise intranet. Terminal 101 can refer to one of multiple terminals; this embodiment only uses terminal 101 as an example. Those skilled in the art will understand that the number of terminals can be more or less. Indicatively, terminal 101 runs a package management tool that provides a private dependency package update function. This tool can update the private dependency packages that the project depends on according to the developer's update instructions and write the updated private dependency packages to the local dependency directory.

[0043] The package management tool interacts with server 102 over the network, requesting server 102 to store or distribute private dependency packages and synchronize lock files, thereby ensuring dependency version consistency in multi-developer collaboration. In some embodiments, terminal 101 sends the updated lock file to server 102 through the package management tool, whereby server 102 stores, analyzes, or synchronizes the data, and returns the updated information to other terminals 101 when necessary, thus ensuring that the private dependency package versions used by each terminal are consistent.

[0044] Server 102 can be a standalone physical server, a server cluster consisting of multiple physical servers, or a distributed file system. It can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 102 can store project source code, dependency management configuration files, and lock files. It can also handle functions such as storing and distributing private dependency packages, version synchronization, and executing build tasks. In some embodiments, different functions can be implemented by the same server or multiple servers, without limitation. Server 102 collaborates with package management tools to receive, return, or distribute private dependency packages and lock files through a network interface, achieving dependency package updates and version consistency in a multi-developer collaborative environment.

[0045] It should be noted that, in this embodiment, server 102 can be implemented as an independent physical server, server cluster, distributed file system, or cloud server, capable of receiving requests and returning data. However, its primary purpose is to store and provide third-party dependency packages required for project construction, essentially acting as a dependency source or artifact repository for the project. Server 102 interacts with the package management tool on terminal 101 via the network, providing terminal 101 with dependency package download, acquisition, and lock file synchronization services to support project construction, installation, and operation. Although it takes the form of a server, it differs from ordinary general-purpose servers; its function and concept focus more on the centralized management and distribution of dependency resources, rather than general-purpose computing or storage services.

[0046] The following describes the process of a method for processing private dependency packages provided in an embodiment of this application. Figure 2 This is a flowchart illustrating a method for processing private dependency packages provided in an embodiment of this application, such as... Figure 2 As shown, taking the method as an example of being executed by the first terminal, the method includes the following steps 201 to 204.

[0047] Step 201: The first terminal receives an update instruction from the first developer for the first private dependency package of the project. The update instruction indicates that the first private dependency package should be updated to the first version. The first developer is the developer among the developers of the project who has the right to update the private dependency package of the project.

[0048] Private dependency packages are those used only within a specific organization, team, or project and are not exposed to the public dependency repository. The version of a private dependency package indicates a specific code state or functional implementation of that package. For example, a private dependency package can reference a released stable version using a semantic version number (e.g., "1.0.0"), or it can uniquely identify a specific, unreleased code state by directly specifying a commit hash value.

[0049] The first developer can be determined based on actual needs. For example, the developer with access to the private repository can be designated as the first developer, meaning that the developer with access to the private repository has the right to update the project's private dependency packages. Alternatively, the developer with access to the internal network can be designated as the first developer, meaning that the developer with access to the internal network has the right to update the project's private dependency packages. Another example is the developer who manages project collaboration; the developer who manages project collaboration has the right to update the project's private dependency packages. The number of first developers can also be determined based on actual needs; for example, one or more developers from the project can be designated as first developers. It should be noted that the above descriptions of the methods and numbers for determining the first developer are merely illustrative and do not limit the scope of this application's embodiments.

[0050] The update instructions for the project's first private dependency package include the following three cases: the first case is to add a new first version of the first private dependency package to the project; the second case is to update other existing versions of the first private dependency package in the project to the first version.

[0051] In some embodiments, the update instruction received by the first terminal is an instruction input by the first developer through a local input device to update the first private dependency package to the first version. The first terminal receives the corresponding input signal from the input device and parses the input signal into the update instruction.

[0052] In other embodiments, the update instruction received by the first terminal is an update request sent by the first developer through a remote system. The update request indicates that the first private dependency package be updated to the first version. The first terminal receives the update request from the remote server through a network communication module and determines it as the update instruction based on the content of the update request.

[0053] In other embodiments, the first terminal receives an update event triggered by the first developer through a message queue or application programming interface. The update event carries a package name and a first version for identifying the first private dependency package. After receiving the update event, the first terminal recognizes the update event as an update instruction for the first version of the first private dependency package.

[0054] In other embodiments, during the process of the first terminal receiving the update instruction, the source of the update instruction is also identified and confirmed based on the developer's identity information. After confirming that the update instruction does not originate from the first developer, update error information is generated, thereby ensuring the legality of the source of the update instruction and the security of the private dependency package update operation.

[0055] The update instruction includes multiple instruction parameters, such as the dependency package name and the target update version. The first private dependency package is updated to version 1 by setting the dependency package name in the update instruction to the name of a first private dependency package and setting the target update version in the update instruction to version 1. In some embodiments, the instruction parameters of the update instruction may also include the dependency type, whether it is a sub-dependency package, etc., which are not limited in this embodiment.

[0056] Step 202: The first terminal updates the private dependency package directory based on the first version of the first private dependency package indicated by the update instruction, and obtains the first private dependency package directory. The first private dependency package directory is used to store private dependency packages in the format of static archive files. One static archive file in the first private dependency package directory corresponds to one version of the private dependency package.

[0057] In some embodiments, the static archive is an archive compressed package format. For example, the static archive is a dependency package in .tgz format created using the tar module built into Node.js. The static archive is a static, immutable binary file.

[0058] The first private dependency package directory is used to store private dependency packages in the format of static archive files. This means that the first private dependency package directory includes multiple static archive files, where each static archive file is archived and compressed from a private dependency package.

[0059] In some embodiments, the private dependency package directory includes a local private dependency package directory and a remote private dependency package directory. The local private dependency package directory is stored in the storage space of the first terminal, and the remote private dependency package directory is stored on the first server. The developers of the project share the remote private dependency package directory stored on the first server. Updating the private dependency package directory on the first terminal includes updating both the local and remote private dependency package directories.

[0060] In some embodiments, the first terminal first updates its local private dependency package directory and then uploads the updated local private dependency package directory to the first server to update the remote private dependency package directory. For example, the first terminal updates its private dependency package directory based on the first version of the first private dependency package indicated by the update instruction, obtaining a first private dependency package directory. This includes: the first terminal updating its local private dependency package directory based on the first version of the first private dependency package indicated by the update instruction to obtain a first local private dependency package directory; and the first terminal uploading this first local private dependency package directory to the first server to update the remote private dependency package directory on the first server using this first private dependency package directory, obtaining a first remote private dependency package directory. In the above embodiments, updating the private dependency package directory using a local update followed by uploading method ensures that the first developer's local update does not directly affect other developers, reducing the risk of global state corruption due to erroneous operations. Furthermore, local updates do not rely on the network and can be modified and tested offline, with unified uploading when the network is available. Additionally, when the first developer uploads the locally updated private dependency package directory to the server, a version control system can be used to record and roll back different versions of the private dependency package directory, improving reliability. In other embodiments, the first terminal updates both the local private dependency package directory and the remote private dependency package directory simultaneously, thereby improving update efficiency.

[0061] In some embodiments, the first server is a version control server, used to manage the version of the project's private dependency packages, lock files, etc. After receiving the first local private dependency package directory uploaded by the first terminal, the version control server uses the first local private dependency package directory as the latest version of the remote private dependency package directory, so that other developers can access the latest version of the remote private dependency package directory.

[0062] In some embodiments, the process of the first terminal updating the local private dependency package directory based on the first version of the first private dependency package indicated by the update instruction includes: if the local private dependency package directory includes static archive files corresponding to other versions of the first private dependency package, the first terminal adds the first version of the first private dependency package to the local private dependency package directory, deletes or invalidates the static archive files corresponding to other versions of the first private dependency package from the local private dependency package directory, and obtains the first local private dependency package directory; if the local private dependency package directory does not include static archive files corresponding to any version of the first private dependency package, the first terminal adds the first version of the first private dependency package to the local private dependency package directory, and obtains the first local private dependency package directory.

[0063] In other embodiments, the first server includes a first shared memory where the private dependency package directory is stored, and the developers of the project can jointly access the first shared memory. For example, a developer of the project updates the private dependency package directory stored in the first shared memory using a first terminal based on the first version of the first private dependency package indicated by an update instruction, thus obtaining the first private dependency package directory. In some embodiments, the first shared memory can be implemented using a file-based memory mapping method. Specifically, the first server creates a file in the file system for storing shared data and maps this file to the physical address of the first shared memory, enabling multiple developers to read and write data based on the same physical storage area, thereby achieving the sharing of the private dependency package directory. In the above embodiments, the first shared memory of the first server can provide real-time, low-latency data access. Updates to the private dependency package directory by the first developer can be immediately perceived by other developers, reducing network transmission burden, avoiding potential transmission errors, improving the update efficiency of the private dependency package directory and the version consistency of the private dependency packages, and improving collaborative development efficiency.

[0064] Step 203: The first terminal updates the lock file of the project based on the first private dependency package directory to obtain the first lock file. The first lock file is used to indicate the exact version information of the private dependency package of the project and the exact download information of the private dependency package. The exact download information points to a static archive file in the first private dependency package directory.

[0065] The lock file is a file used in the project to record the exact version and download information of dependency packages, ensuring consistency across different developers or build environments. The project's lock file includes multiple dependency records, each corresponding to a dependency package. Each dependency record includes the dependency package name, exact version information, and exact download information. The exact version information uniquely identifies the version of the project's dependency package, ensuring repeatable installation and execution results. The exact download information indicates the source from which the project's dependency package was obtained, ensuring that the downloaded and installed dependency package matches the exact version information. The exact download information points to a static archive file in the first private dependency package directory; that is, this exact download information indicates that the first version of the first private dependency package is obtained from the first static archive file in the first private dependency package directory.

[0066] For example, when the package manager being run is npm (Node Package Manager), the lock file is package-lock.json; when the package manager being run is pnpm (PerformantNode Package Manager), the lock file is pnpm-lock.yaml.

[0067] In some embodiments, the lock file of the project includes a local lock file and a remote lock file. The local lock file is stored in the storage space of the first terminal, and the remote lock file is stored on the first server. The developers of the project share the remote lock file stored on the first server. Updating the lock file on the first terminal includes updating the local lock file and updating the remote lock file.

[0068] In some embodiments, the first terminal first updates the local lock file and then uploads the updated local lock file to the first server to update the remote lock file. For example, the first terminal updates the lock file based on the first version of the first private dependency package indicated by the update instruction, obtaining a first lock file, including: the first terminal updating the local lock file based on the first private dependency package directory to obtain a first local lock file; and the first terminal uploading the first local lock file to the first server to use the first lock file to update the remote lock file on the first server, obtaining a first remote lock file. In the above embodiments, updating the lock file using a local update followed by uploading ensures that the first developer's local update does not directly affect other developers, reducing the risk of global state corruption due to erroneous operations. Furthermore, local updates are not network-dependent, allowing modification and testing in an offline environment, with unified uploading when the network is available. Additionally, when the first developer uploads the locally updated lock file to the server, a version control system can be used to record and roll back different versions of the lock file, improving reliability. In other embodiments, the first terminal updates both the local lock file and the remote lock file simultaneously, thereby improving update efficiency.

[0069] In some embodiments, the first server is a version control server, used to manage the version of the project's private dependency packages, lock files, etc. After receiving the first local lock file uploaded by the first terminal, the version control server uses the first local lock file as the latest version of the remote lock file, so that other developers can access the latest version of the remote lock file.

[0070] In some embodiments, the process of the first terminal updating the local lock file based on the first private dependency package directory includes: if the local lock file includes dependency records for other versions of the first private dependency package, the first terminal updates the exact version information in the dependency record to the first version, and updates the exact download information in the dependency record to the static archive file in the first private dependency package directory corresponding to the first version of the first private dependency package; if the local lock file does not include dependency records for any version of the first private dependency package, the first terminal adds a dependency record to the local lock file, wherein the package name in the added dependency record is the name of the first private dependency package, the exact version information in the added dependency record is the first version, and the exact download information in the added dependency record points to the static archive file in the first private dependency package directory corresponding to the first version of the first private dependency package.

[0071] In other embodiments, the first server includes a second shared memory where the lock file is stored, and the developers of the project can collectively access this second shared memory. For example, a developer updates the lock file stored in the second shared memory via a first terminal, based on a first private dependency package directory, to obtain the first lock file. In some embodiments, the second shared memory can be implemented using a file-based memory mapping method. In the above embodiments, the second shared memory of the first server can provide real-time, low-latency data access. Updates to the lock file by the first developer can be immediately perceived by other developers, reducing network transmission burden, avoiding potential transmission errors, improving the update efficiency of the lock file and the version consistency of private dependency packages, and improving collaborative development efficiency.

[0072] Step 204: The first terminal installs the first version of the first private dependency package based on the first private dependency package directory and the first lock file.

[0073] Specifically, the first terminal downloads the static archive file corresponding to the first version of the first private dependency package from the first private dependency package directory based on the exact version information and exact download information of the first private dependency package recorded in the first lock file, and installs the first version of the first private dependency package based on the downloaded static archive file.

[0074] Steps 201 to 204 above encapsulate multiple manual operations, such as updating the private dependency package directory and updating the lock file, into an update command for the private dependency package. This improves development and collaboration efficiency and reduces the probability of conflicts and errors. Furthermore, since the private dependency package is stored in the private dependency package directory as a static archive file, and the static archive file is a static binary file with versioned and constant content, it fundamentally eliminates the possibility of the package manager tampering with or dynamically parsing the metadata of the private dependency package during installation. This avoids version differences when different developers install the package and prevents lock file conflicts. In addition, the updated private dependency package directory and the updated lock file can be reused, thereby ensuring version consistency of private dependency packages installed by different developers or different build environments.

[0075] The above Figure 2 The diagram shows the basic flow of a method for processing private dependency packages provided in an embodiment of this application. The method will be described in detail below. Figure 3 This is a flowchart illustrating a method for processing private dependency packages provided in an embodiment of this application, such as... Figure 3 As shown, taking the method as an example of being executed by the first terminal, it includes the following steps 301 to 310.

[0076] Step 301: The first terminal receives an update instruction from the first developer for the first private dependency package of the project. The update instruction indicates that the first private dependency package should be updated to the first version.

[0077] In some embodiments, the update instruction is pre-configured in the project's script. For example, the update instruction is pre-configured in the project's script by defining the following content under the `script` field in the project's dependency management configuration file (`package.json`): `"upgrade-local": "node scripts / upgrade-local.js`. This content configures a instruction named `upgrade-local` and defines that when this instruction is executed, Node.js will be called to run the `upgrade-local.js` file in the `scripts` subdirectory of the project directory. The `upgrade-local.js` file defines the specific execution logic of the `upgrade-local` instruction. It should be noted that the above example does not limit the embodiments of this application. In the above embodiments, by pre-configuring the update instruction in the project's script, manual operations are encapsulated into script instructions, enabling automation, standardization, reusability, and easy integration of update operations, reducing the risk of errors in manual operations, thereby reducing the time spent processing errors and improving update efficiency.

[0078] In some embodiments, the first terminal receives an update instruction from the first developer for the first private dependency package of the project via human-computer interaction. This means that the first terminal provides a user interface through which the first developer inputs text commands, and the first terminal receives and parses these text commands into the update instruction. In the above embodiments, receiving the update instruction via human-computer interaction by the first terminal can automate, standardize, and repeat the operation, improving the developer's operational efficiency and accuracy, and reducing human error.

[0079] Step 302: The first terminal updates the private dependency package directory based on the first version of the first private dependency package indicated by the update instruction, and obtains the first private dependency package directory.

[0080] Updating the private dependency package directory means updating the static archive files stored in that directory. For example, the private dependency package directory is a file named `local-package / `, which includes multiple static archive files, including `package-a-2.2.9.tgz` and `package-b-0.1.185.tgz`. `package-a-2.2.9.tgz` corresponds to the private dependency package `package-a` with version number "2.2.9", and `package-b-0.1.185.tgz` corresponds to the private dependency package `package-b` with version number "0.1.185". If the update command instructs that the private dependency package package-b be updated to version "0.1.186", then the static archive file package-b-0.1.186.tgz corresponding to the "0.1.186" version of package-b will be stored in the local-package / file, and the static archive file corresponding to the old version of package-b (i.e., package-b-0.1.185.tgz) will be deleted from the local-package / file, thus updating the local-package / file.

[0081] In some embodiments, step 302 includes steps 3021 to 3022 described below.

[0082] Step 3021: The first terminal generates the first static archive file corresponding to the first private dependency package of the first version.

[0083] In some embodiments, the static archive file is in archive compressed package format. In the above embodiments, using archive compressed package format for the static archive file can effectively reduce storage space usage, facilitate versioned management, transmission, and distribution of private dependency packages, ensure the integrity of private dependency packages, and improve the cloning and retrieval speed of private dependency packages.

[0084] The project also includes a dependency directory, which stores the project's private dependency packages locally. This dependency directory is the source of dependency packages at runtime; the program loads these packages from this directory. For example, in the case of npm or pnpm package managers, this dependency directory is a `node_modelus` file.

[0085] In some embodiments, the process of generating the first static archive file includes any of the following cases.

[0086] The first scenario: If the project's dependency directory includes the first version of the first private dependency package, then generate the first static archive file from the first version of the first private dependency package in that dependency directory. This first scenario essentially involves packaging the first version of the first private dependency package originally stored in the dependency directory to obtain the first static archive file. For example, taking the first version of the first private dependency package as package-b, with npm as the package manager, the command to package package-b in the dependency directory into the first static archive file is: `cd packages / @private / package-b; npm pack`. With pnpm as the package manager, the command to package package-b in the dependency directory into the first static archive file is: `cd packages / @private / package-b; pnpm pack`. It should be noted that the above examples are merely illustrative and do not limit the scope of this application's embodiments.

[0087] In the first scenario described above, if the first version of the first private dependency package is stored locally, packaging it directly can improve packaging efficiency and reduce network transmission costs.

[0088] The second scenario: If the dependency directory does not include the first version of the first private dependency package, download the first version of the first private dependency package from the private repository and generate the first static archive file from the first version of the first private dependency package.

[0089] For example, the command to package package-b in the dependency directory as the first static archive is npmpack @private / package-b@0.1.181–registry=https: / / privite.com / npm / .

[0090] https: / / privite.com / npm / is the address of the private repository.

[0091] It should be noted that the above examples are merely illustrative and do not limit the embodiments of this application.

[0092] In the second scenario described above, if the first version of the first private dependency package is not stored locally, obtaining the private dependency package from the private repository for packaging can ensure the integrity and correctness of the first private dependency package, improve the packaging success rate and consistency, and reduce manual intervention.

[0093] Step 3022: The first terminal updates the static archive file in the private dependency package directory based on the first static archive file to obtain the first private dependency package directory.

[0094] In steps 3021 and 3022 above, the private dependency packages are stored in the private dependency package directory in the format of static archive files. The static archive files are static binary files, and their content is versioned and constant. This fundamentally cuts off the possibility of the package manager tampering with or dynamically parsing the content of the private dependency packages when installing them, thereby avoiding version differences when different developers install them and avoiding lock file conflicts. In addition, the updated private dependency package directory can be reused, thereby ensuring the version consistency of private dependency packages installed by different developers or different build environments.

[0095] In some embodiments, if an update to the private dependency package directory fails, an update error message is generated and the update process is terminated. In the above embodiments, immediately stopping the update process when an update error occurs in the private dependency package directory prevents subsequent operations from causing erroneous changes to the private dependency package directory, thereby ensuring the reliability and stability of the private dependency package directory.

[0096] It should be noted that the project also includes a dependency management configuration file, which includes configuration information, including the specified version information and specified download information of the project's private dependency packages. The specified download information points to a static archive file in the private dependency package directory. The method also includes updating the dependency management configuration file, including step 303 below.

[0097] Step 303: Based on the first static archive file in the first private dependency package directory, the first terminal updates the specified version information of the first private dependency package to the first version in the dependency management configuration file of the project, and updates the specified download information of the first private dependency package to the first static archive file in the first private dependency package directory, thus obtaining the first dependency management configuration file.

[0098] In this context, the dependency management configuration file is a file used to declare the dependency packages required by the project and specify the versions of those packages. It tells the package management tool which dependencies need to be installed or updated. For example, when the package manager is npm or pnpm, the dependency management configuration file is a package.json file.

[0099] In the dependency management configuration file, the `dependencies` or `devDependencies` fields specify the static archive file in the directory of the first private dependency package via the `file:` protocol, thus enabling version locking of the private dependency package. Updating the dependency management configuration file involves updating the `file:` protocol path corresponding to the first private dependency package in the configuration file. The `file:` protocol is a dependency declaration protocol supported by Node.js's package management tools, allowing dependency packages to be referenced via local file system paths, for example: `"dependency": "file:.. / path / to / package"`. For example, taking the first private dependency package as package-b and the first static archive file as package-b-0.1.186.tgz in the local-packages / file as an example, the way to point the first private dependency package to the specific static file in the first private dependency directory through the file: protocol is as follows: Define the following content under the dependencies field of the package.json file: "@private / package-b" "file: .local-packages / package-b-0.1.186.tgz". This content indicates that a private dependency package package-b with dependency type dependencies is defined, and a static reference is established between package-b and package-b-0.1.181.tgz in local-packages through the file: protocol, thereby updating the specified version information of package-b in the package.json file to 0.1.186, and updating the specified download information of package-b to the package-b-0.1.186.tgz file in the local-packages / file. It should be noted that the above example does not limit the embodiments of this application.

[0100] In step 303 above, the project's dependency management configuration file, `package.json`, was enhanced, defining mandatory configuration specifications and forming a strong contract between the developer and the package manager. Specifically, in the `dependencies` or `devDependencies` field of the dependency management configuration file, all private dependency packages point to the specific static archive file in the first private dependency package directory via the `file:` protocol. This achieves version locking of private dependency packages. Since the static archive file format is a content-addressed static binary snapshot, its content hash value is fixed once generated. Therefore, it completely avoids the behavior of package managers (npm or pnpm) recursively processing the dependency tree and modifying metadata fields (such as `_args`, `_where`) within the `package.json` of child dependencies when treating the `file:` protocol path as a "live link" during installation. This eliminates the primary factor causing the lock file to fluctuate due to metadata changes. Furthermore, compared to the source code directory, the static archive file has a coarser update granularity and more stable content, significantly reducing redundant change records in the Git repository on the first server, thereby alleviating the problem of remote repository bloat and improving cloning and pulling efficiency. Furthermore, updates to static archives are manifested as the replacement of a single file, making dependency upgrades clearly traceable during code reviews, which greatly reduces the complexity and pressure of reviews.

[0101] In some embodiments, the configuration information also includes the resolution path of the project's private dependency packages. The method updates the resolution path of the first private dependency package, including the following step 304.

[0102] Step 304: The first terminal forces the resolution path of the first private dependency package to point to the first static archive file in the directory of the first private dependency package in the dependency management configuration file.

[0103] The pnpm package manager provides an overrides feature, which allows you to force the resolution of a dependency package (including all its nested dependencies) in a project's dependency management configuration file, thus overriding the default dependency resolution rules. In some embodiments, when pnpm is the package manager, the dependency management configuration file includes a `pnpm.overrides` field. This field acts as an arbitrator at the top level of dependency resolution, forcing that regardless of where in the dependency tree or with what version range the specified dependency package is requested, it must be redirected to the precise location defined in the `pnpm.overrides` field, thereby enforcing uniformity in the versions of private dependency packages throughout the dependency tree. Therefore, if the first private dependency package directory already includes static archives corresponding to its child dependency packages, it can be ensured that the child dependency packages of the first private dependency package correctly reuse the first private dependency package, rather than downloading it from a remote location. For example, taking package-b as the first private dependency package, the way to force the resolution path of the first private dependency package to point to the first static archive file is as follows: Define the following content under the pnpm.overrides field of the package.json file: "@private / package-b" "file: .local-packages / package-b-0.1.186.tgz". This content is used to force that regardless of where in the dependency tree or with what version range the private dependency package package-b is requested, it must be redirected to the precise location local-package / package-b-0.1.186.tgz defined in the pnpm.overrides field. It should be noted that the above example does not limit the embodiments of this application.

[0104] In step 304 above, declaring the forced resolution rule in pnpm.overrides is the core configuration switch to solve the problem of dependency resolution failure of nested private dependency packages in pnpm. It can ensure the reuse of sub-dependency private packages within a local private dependency package, thereby ensuring the absolute consistency of the dependency tree, ensuring that all local private dependency packages and their sub-dependencies are correctly resolved, completely eliminating the "dual package" problem, ensuring the determinism of runtime behavior, and achieving absolute consistency of the dependency tree across environments and collaborators.

[0105] It should be noted that step 304 above is illustrated using pnpm as the package manager. In some embodiments, the package manager is npm, and step 304 is not executed. The first terminal configures all local sub-dependencies at all levels in the dependency tree with static references based on the file: protocol and static archive files to ensure that the dependency tree is completely and correctly locked, thereby avoiding the default dynamic resolution behavior of the package manager.

[0106] In some embodiments, if an update to the project's dependency management configuration file fails, an update error message is generated and the update process exits. In the above embodiments, immediately stopping the update process when an update error occurs in the dependency management configuration file prevents subsequent operations from causing erroneous changes to the dependency management configuration file, thereby ensuring the reliability and stability of the dependency management configuration file.

[0107] It should be noted that the project also includes a dependency directory, which is used to store the project's private dependency packages locally, as well as the actual version information and actual download information of the project's private dependency packages. The method also includes an update process for the dependency directory, which includes step 305 below.

[0108] Step 305: Based on the first static archive file in the first private dependency package directory, the first terminal updates the first private dependency package to the first version of the private dependency package in the dependency directory, updates the actual version information of the first private dependency package to the first version, and updates the actual download information of the first private dependency package to the first static archive file in the first private dependency package directory, thereby obtaining the first dependency directory.

[0109] The process of the first terminal updating the dependency directory based on the first static archive file in the first private dependency package directory is as follows: if the dependency directory includes the first private dependency package, the original first private dependency package is deleted, the first version of the first private dependency package is stored in the dependency directory, and the first private dependency package is linked to the first static archive file in the first private dependency package directory; if the dependency directory does not include the first private dependency package, the first version of the first private dependency package is added to the dependency directory, and the first private dependency package is linked to the first static archive file in the first private dependency package directory. For example, taking the node_modules file as the dependency directory, the .pnpm / folder in node_modules stores the contents of the project's dependency packages, such as private dependency packages package-a and package-b. The actual version information of the private dependency package package-a is 2.2.9, and the actual download information points to the package-a-2.2.9.tgz file in the local-packages file; the actual version information of the private dependency package package-b is 0.1.186, and the actual download information points to the package-b-0.1.186.tgz file in the local-packages file. It should be noted that the above examples do not limit the embodiments of this application.

[0110] In step 305 above, by synchronously updating the local dependency directory during the update of the private dependency package, the updated dependency directory enables subsequent build, compilation, or testing processes to be executed directly based on the latest local dependencies. Furthermore, the updated local dependency directory can be used directly in an offline environment, thus supporting offline development and rapid environment reproduction. Further, since both the dependency directory and the lock file are updated based on the updated private dependency package directory, the consistency between the updated dependency directory and the lock file is guaranteed, thereby avoiding dependency version conflicts between different developers.

[0111] In some embodiments, if an update to the project's dependency directory fails, an update error message is generated and the update process exits. In the above embodiments, immediately stopping the update process when an update error occurs in the dependency directory prevents subsequent operations from causing erroneous changes to the dependency directory, thereby ensuring the reliability and stability of the dependency directory.

[0112] Step 306: The first terminal updates the exact version information of the first private dependency package to the first version in the lock file based on the first static archive file in the first private dependency package directory, and updates the exact download information of the first private dependency package to the first static archive file in the first private dependency package directory, thus obtaining the first lock file.

[0113] In step 306 above, the lock file is updated based on the updated first private dependency package directory, and the exact download information of the first private dependency package in the lock file points to the static archive file in the first private dependency package directory. That is, the dependency reference in the lock file points to the static binary file, which can achieve zero change of metadata during installation and make the lock file extremely stable, so that the generated results are completely consistent in different environments, fundamentally solving the lock file conflict problem when merging development branches.

[0114] In some embodiments, if an update to the lock file of the project fails, an update error message is generated and the update process is terminated. In the above embodiments, immediately stopping the update process when an update error occurs in the lock file prevents subsequent operations from causing erroneous changes to the lock file, thereby ensuring the reliability and stability of the lock file.

[0115] In some embodiments, the update process for the first private package further includes an installation process for the first version of the first private package based on the first private dependency package directory and the first lock file, which includes steps 307 to 309 below.

[0116] Step 307: The first terminal downloads the first static archive file from the first private dependency package directory based on the first lock file.

[0117] Specifically, the first terminal downloads the first static archive file from the first private dependency package directory, based on the exact version information of the first private dependency package recorded in the first lock file (which is the first version) and the exact download information of the first private dependency package recorded in the first lock file (which is the first static archive file in the first private dependency package directory). Since the first terminal locally stores the first private dependency package directory, downloading the first static archive file from the first private dependency package directory is equivalent to obtaining the first static archive file from the first private dependency package directory.

[0118] Step 308: The first terminal extracts the first version of the first private dependency package from the first static archive file.

[0119] The first static archive file is in archive compressed package format. The first terminal extracts the first private dependency package of the first version from the first static archive file, that is: the first terminal decompresses the first static archive file to obtain the first private dependency package of the first version.

[0120] Step 309: Install the first private dependency package of the first version on the first terminal.

[0121] Through steps 307 to 309 above, the first terminal installs the first private dependency package based on the updated first private dependency package directory and the first lock file. Since the exact download information in the first lock file points to the static archive file in the first private dependency package directory, and the static archive file is a static binary file with versioned and constant content, the possibility of the package manager tampering with or dynamically parsing the private dependency package content during installation is fundamentally cut off, thereby avoiding version differences when different developers install and avoiding lock file conflicts.

[0122] In some embodiments, after the first terminal completes the update of the first version of the first private dependency package locally, it also uploads the updated dependency management configuration file of the project, the updated private dependency package directory, and the updated lock file to the first server for other developers to share. This process includes the following step 310.

[0123] Step 310: The first terminal uploads the first dependency management configuration file, the first private dependency package directory, and the first lock file to the first server.

[0124] In some embodiments, the first server is a version control server, which runs a distributed version control system (Global Information Tracker, Git) for managing version changes of the first dependency management configuration file, the first private dependency package directory, and the first lock file uploaded by the first terminal.

[0125] In step 310 above, the first terminal uploads the first dependency management configuration file, the first private dependency package directory, and the first lock file to the first server. This allows other developers to reuse the files uploaded by the first terminal when installing dependency packages, ensuring the consistency of dependency versions installed by different developers. Furthermore, since the first private dependency package directory stores private dependency packages in the format of static archive files, which is a binary file, it occupies less storage space and does not require intervention in the code review process. Each update of the private dependency package only results in one version change, making the growth of data volume in the remote repository more controllable. In addition, the Git version change history is clear and readable, and code review only needs to focus on version number changes, which can reduce the pressure of code review. Therefore, it can greatly improve the efficiency of repository management and code review.

[0126] The following provides examples to illustrate steps 301 to 310 above.

[0127] First, let's illustrate the command interaction process between the first developer and the first terminal with an example. Taking pnpm as the package manager and package-b as the first private dependency package, the interaction process includes: The first developer executes the command "pnpm view@private / package-b versions" in the first terminal to view the current version number of package-b and confirm the updated version number; The first developer executes the command "pnpm run upgrade-local" (i.e., the update command) in the first terminal to trigger the update step for the private dependency package, obtaining the updated first dependency management configuration file "package.json", the first private dependency package directory "local-packages / ", and the first lock file "pnpm-local.yaml". The first developer executes the command "git add package.json local-packages / pnpm-local.yaml" in the first terminal to upload the first dependency management configuration file, the first private dependency package directory, and the first lock file to the Git system on the first server; The first developer executes the command "git commit -m "chore": update XXX to version vX.XX" in the first terminal to commit the version change information of this update to the Git system on the first server. It should be noted that the above examples are merely illustrative and do not limit the embodiments of this application.

[0128] The following example further illustrates the process of the first terminal receiving and executing an update command. This process includes: the first terminal executing the command "pnpm run upgrade-local" (i.e., the update command), displaying an interactive interface. This interface prompts the first developer to enter the local dependency package name, target version number, and whether it is a sub-dependency package. Upon receiving the first developer's input of "package-b" (local dependency package name), "latest" (target version number), and "No" (…), the first terminal… After confirming that it is not a sub-dependency package, the latest version number is 0.1.186 (corresponding to step 301 above); then download package-b@0.1.186 from the private repository; package the downloaded 0.1.186 version of package-b into a package-b-0.1.186.tgz file and store it in the private dependency package directory (local-packages / ), and delete the old version (package-b-0.1.185.tgz) in the private dependency package directory (this process corresponds to step 302 above); the first terminal updates the configuration of the pnpm.overrides field based on the updated local-packages / file, displays the interaction interface with the first developer, and updates the first terminal when the first developer inputs the target projects as projectA and projectB. The dependency management configuration files for projectA and projectB are updated (corresponding to steps 303 and 304 above). The first terminal updates the dependency directory (node_modules) based on the updated local-packages / file (corresponding to step 305 above). The first terminal updates the lock file (pnpm.lock.yaml) based on the updated local-packages / file (corresponding to step 306 above). The first terminal installs the project's dependency packages based on the updated local-packages / file and the updated pnpm.lock.yaml to install the updated version 0.1.186 of package-b (corresponding to steps 307 to 309 above). Thus, package-b is successfully updated to version 0.1.186. It should be noted that the above examples are merely illustrative and do not limit the scope of this application.

[0129] Figure 4 This is a flowchart illustrating a method for processing private dependency packages provided in an embodiment of this application, as shown below. Figure 4 As shown, the process includes: (1) The first terminal receives the update instruction input by the first developer. The input parameters of the update instruction include package name, version number and dependency type. If the input parameters are complete, step (2) is executed. If the input parameters are incorrect or incomplete, step (10) is executed. (2) The first terminal creates or checks the local-packages / file (wherein, if the local-packages / file already exists, it is checked, and if the local-packages / file does not exist, it is created). If the creation or check is successful, step (3) is executed. If the creation or check fails, step (10) is executed. (3) The first terminal downloads and packages the private dependency package of the specified version from the private repository and generates the static archive file corresponding to the private dependency package of the version. If the download and packaging operation is completed, step (4) is executed. If the download or packaging operation fails, step (10) is executed. (4) The first terminal stores the generated static archive file in the local-packages / file. If the process is completed, step (5) is executed. If the process fails, step (10) is executed. (5) The first terminal cleans up the old version of the static archive files in the local-packages / file; (6) The first terminal updates the package.json file of the project and configures the static reference method in the package.json file through the file: protocol.

[0130] (7) The first terminal updates the configuration of the pnpm.overrides field in the package.json file of the project.

[0131] (8) The first terminal updates the node_modules file and the pnpm.lock.yaml file; (9) The first terminal installs the specified version of the private dependency package. If the version of the private dependency package installed is inconsistent with the exact version information indicated by the pnpm.lock.yaml file, then proceed to step (10). (10) Generate error messages and exit the update process.

[0132] It should be noted that the above Figure 4 The examples shown are merely illustrative and do not limit the scope of the embodiments described in this application.

[0133] Steps 301 to 310 above provide a one-click script interface. By pre-setting standardized update instructions in the script, a minimalist user interface is provided, facilitating developers to automate local package version upgrades, packaging, updating references, ensuring dependency reuse, reinstallation verification, and other operations. This shields complex underlying operations, reduces the probability of manual errors, and transforms dependency package upgrades from a "technical task" into a "standard operation," enabling team members to collaboratively maintain project dependencies more efficiently and securely. Furthermore, because private dependency packages are stored in the private dependency package directory as static archive files, and these static archive files are static binary files with versioned and constant content, the possibility of the package manager tampering with or dynamically parsing the content of private dependency packages during installation is fundamentally eliminated. This avoids version differences during installation by different developers and prevents file lock conflicts. In addition, after the update... The private dependency package directory and updated lock file can be reused, ensuring version consistency of private dependency packages installed by different developers or different build environments. Furthermore, the project's dependency management configuration file, package.json, has been enhanced, defining mandatory configuration specifications and forming a strong contract between developers and the package manager. Specifically, in the dependencies or devDependencies field of the dependency management configuration file, all private dependency packages point to the specific static archive file in the first private dependency package directory via the file: protocol, thus achieving version locking of private dependency packages. Moreover, it does not rely on specific network infrastructure (such as private repositories), making it suitable for any collaborative development scenario with network isolation and access control. It has broad applicability and scalability, providing a best practice model for the industry.

[0134] The above describes the process of the first developer updating the first version of the first private dependency package. The following describes the process of installing the updated first version of the first private dependency package. This installation process includes two scenarios: In the first scenario, the developer enters the installation command into the terminal, and the terminal receives the command and performs the installation. In the second scenario, during the integration of development branches provided by multiple developers, the server receives a build task for the project, executes the installation command for the private dependency package, and then performs the installation. These two scenarios will be described in detail below.

[0135] Let's take the first installation scenario as an example. Figure 5 This is a flowchart illustrating a method for processing private dependency packages provided in an embodiment of this application, such as... Figure 5 As shown, taking the method as an example of being executed by a second terminal, the method includes the following steps 501 to 504.

[0136] Step 501: The second terminal receives the installation instructions from the project developer for the first private dependency package of the first version of the project.

[0137] The process of the second terminal receiving the installation instruction is the same as the process of the first terminal receiving the update instruction in step 301 above, and will not be described again.

[0138] It should be noted that step 501 is one implementation of receiving the installation instruction for the first private dependency package of the first version of the project. In some embodiments, the process is also implemented in other ways, and this application embodiment does not limit this.

[0139] Step 502: The second terminal downloads the first static archive file from the first private dependency package directory based on the first lock file of the project.

[0140] The second terminal downloads the first static archive file from the first private dependency package directory in the first server to the first terminal.

[0141] In some embodiments, the installation command is a frozen lockfile installation command. Frozen lockfile installation is a strict installation mode of the package manager. In this mode, the installer will strictly install dependencies according to the exact version information and exact download information in the lockfile. If a mismatch is detected between the package.json file and the lockfile, or if the lockfile does not exist, an error will be reported and the installation will be aborted, thus ensuring the absolute certainty of the installation result. For example, when the package manager is npm, the frozen lockfile installation command is the npm ci command; when the package manager is pnpm, the frozen lockfile installation command is the pnpm install --frozen-lockfile command. The core logic of this frozen lockfile installation command is verification rather than solving. It is used to strictly compare the dependency record of the first lockfile and check whether the current installation environment can reproduce a dependency tree that is exactly the same as the first lockfile. This process is the frozen lockfile installation.

[0142] For example, step 502 includes: the second terminal querying the first lock file; and the second terminal downloading a first static archive file from the first private dependency package directory if the installation instruction matches the first lock file. The second terminal obtains the first lock file from the first server. In the above embodiment, by using the frozen lock file installation instruction, a high degree of consistency between different developers' local environments is ensured. Any mismatch in lock files or incomplete dependencies will cause the private dependency package to fail, thereby guaranteeing the repeatability and reliability of the private dependency package installation process.

[0143] In some embodiments, the installation instruction is a freeze lock file installation instruction. If the second terminal does not match the installation instruction with the first lock file, it generates an installation error message. In the above embodiments, by generating an installation error message when the installation instruction and the lock file do not match, it is possible to detect dependency version inconsistencies in a timely manner and prevent incorrect dependencies from being installed, thereby ensuring the consistency of the dependency environment and the stability of the build across multiple developer terminals.

[0144] In some embodiments, the freezelock file installation instruction can be a first installation instruction, which is an installation instruction for the first private dependency package of the first version. That is, it performs freezelock file installation for a single private dependency package. Developers pre-configure this first installation instruction in a script. When a second terminal receives the first installation instruction for the first private dependency package of the first version, it performs freezelock file installation on that first private dependency package. In the above embodiments, by pre-setting the first installation instruction to perform freezelock file installation on specific dependency packages in the project, critical dependency versions can be precisely controlled without affecting updates to other dependency packages, thereby supporting the stability and predictability of project construction and operation.

[0145] In other embodiments, the freeze lock file installation instruction is a second installation instruction, which is an installation instruction for all dependency packages of the project. That is, it performs freeze lock file installation on all dependency packages of the project. Upon receiving the second installation instruction, the second terminal cleans up the already installed dependency packages of the project and, based on the first lock file, performs freeze lock file installation on all dependency packages of the project, including freezing lock file installation on the first version of the first private dependency package. In the above embodiments, by executing the second installation instruction, it can be ensured that all dependency packages in the project are installed strictly according to the exact version information recorded in the lock file. Furthermore, uniformly installing all dependency packages ensures that different terminals obtain the same dependency version combination, thereby supporting consistent management of cross-environment development, testing, and deployment.

[0146] Step 503: The second terminal extracts the first version of the first private dependency package from the first static archive file.

[0147] Step 504: Install the first private dependency package of the first version on the second terminal.

[0148] Steps 503 and 504 are the same as steps 308 and 309, and will not be repeated here.

[0149] In steps 501 to 504 above, the updated private dependency package directory and the updated lock file of the first terminal can be reused by the second terminal, thereby ensuring the consistency of the version of the private dependency package installed by different developers; furthermore, by using the freeze lock file installation command to ensure the high consistency of the local environment of different developers, any lock file mismatch or incomplete dependency will cause the private dependency package to fail, thereby ensuring the repeatability and reliability of the private dependency package installation process.

[0150] The second installation method will be described below. Figure 6 This is a flowchart illustrating a method for processing private dependency packages provided in an embodiment of this application, such as... Figure 6 As shown, taking the method as an example where the method is executed by the second server, the method includes the following steps 601 to 604.

[0151] Step 601: Based on the received build task, the second server executes the installation instruction for the first private dependency package of the first version of the project.

[0152] In some embodiments, the second server can be a CI / CD server, used to perform dependency installation, building, testing, and deployment operations for the project in an automated build process. For example, when the second server receives a build task, it can execute an installation instruction for a first private dependency package for the first version of the project based on the project and version information contained in the build task. This allows it to retrieve the corresponding dependency package from the first private dependency package directory on the first server and complete the installation, thereby providing dependency environment support for subsequent project builds. In the above embodiments, by using a CI / CD server to automatically perform dependency installation and build operations, the build process can be automated and standardized, reducing manual intervention and avoiding dependency inconsistencies caused by differences in development environments, thereby improving the efficiency and stability of project builds.

[0153] It should be noted that step 601 is one implementation of receiving the installation instruction for the first private dependency package of the first version of the project. In some embodiments, the process is also implemented in other ways, and this application embodiment does not limit this.

[0154] Step 602: The second server downloads the first static archive file from the first private dependency package directory based on the first lock file of the project.

[0155] In some embodiments, the installation command is a frozen lock file installation command. For example, the frozen lock file installation command is the command: "pnpm install --frozen-lockfile". The core logic of this installation command is verification rather than solving; it strictly compares the dependency records of the first lock file to check whether the current installation environment can reproduce a dependency tree exactly the same as the first lock file. This process is the frozen lock file installation. For example, step 602 includes: the second server querying the first lock file; and, if the installation command matches the first lock file, the second server downloading the static archive file corresponding to the first lock file from the first private dependency package directory. In the above embodiments, by using the frozen lock file installation command, a high degree of consistency between the build environment and the developer's local environment is ensured. Any mismatch in lock files or incomplete dependencies will cause the private dependency package to fail, thus guaranteeing the repeatability and reliability of the private dependency package installation process.

[0156] In some embodiments, the installation instruction is a freeze lock file installation instruction. If the installation instruction does not match the first lock file, the second server generates an installation error message. In the above embodiments, by generating installation error messages when the installation instruction and lock file do not match, dependency version inconsistencies can be detected promptly, preventing the installation of incorrect dependencies and ensuring consistency and stability between the build environment and the developer's local environment.

[0157] In some embodiments, the freezelock file installation instruction can be a first installation instruction, which is an installation instruction for the first private dependency package of the first version. That is, it performs freezelock file installation on a single private dependency package. Developers pre-configure this first installation instruction in a script. When the second server receives a build task for the project, it executes the first installation instruction for the first private dependency package of the first version, performing freezelock file installation on that package. In the above embodiments, by pre-setting the first installation instruction to perform freezelock file installation on specific dependency packages in the project, critical dependency versions can be precisely controlled without affecting updates to other dependency packages, thereby supporting the stability and predictability of project builds and operations.

[0158] In other embodiments, the freezelock file installation instruction is a second installation instruction, which is an installation instruction for all dependency packages of the project. That is, it performs freezelock file installation on all dependency packages of the project. When the second server receives a build task for the project, it cleans up the dependency packages of the project already installed in the build environment, and based on the first lock file, performs freezelock file installation on all dependency packages of the project, including the freezelock file installation of the first version of the first private dependency package. In the above embodiments, by executing the second installation instruction, it can be ensured that all dependency packages in the project are installed strictly according to the exact version information recorded in the lock file. Furthermore, uniformly installing all dependency packages ensures that different build environments obtain the same dependency version combination, thereby supporting consistent management of cross-environment development, testing, and deployment.

[0159] Step 603: The second server extracts the first version of the first private dependency package from the first static archive file.

[0160] Step 604: The second server installs the first private dependency package of the first version.

[0161] Steps 603 to 604 above are the same as steps 502 to 504 above, and will not be repeated here.

[0162] In steps 601 to 604 above, the updated private dependency package directory and the updated lock file of the first terminal can be reused by the second server, thereby ensuring the consistency of the version of the private dependency package installed in different build environments; furthermore, by using the freeze lock file installation instruction to ensure the high consistency of different build environments, any lock file mismatch or incomplete dependency will cause the private dependency package to fail, thereby ensuring the repeatability and reliability of the private dependency package installation process.

[0163] The following is through Figure 7 Regarding the above Figure 3 , Figure 5 and Figure 6 The process shown is illustrated with an example. Figure 7 This is a schematic diagram illustrating a method for processing private dependency packages provided in an embodiment of this application. For example... Figure 7 As shown, this embodiment of the application encapsulates a complex and error-prone manual process into a secure, controllable, and repeatable "black box" operation through an automated script. The first developer, possessing private dependency package update permissions, triggers the first terminal to execute the update command "pnpm upgrade-local" by inputting the update command into the first terminal. Figure 7The black-box process shown updates the private dependency package directory (local-packages / ) and the lock file (pnpm.lock.yaml). When the second server receives the build task for this project, it executes the command "pnpm install --frozen-lockfile" through the CI / CD system. This command strictly follows the lock file to install the dependency packages, thus successfully completing the build task and ensuring the consistency of the build environment. It should be noted that... Figure 7 The examples shown are merely illustrative and do not limit the scope of the embodiments described in this application.

[0164] Figure 8 This is a structural block diagram of a private dependency package processing device provided in an embodiment of this application. Figure 8 As shown, the device includes: a receiving module 801, a first update module 802, a second update module 803, and an installation module 804.

[0165] The receiving module 801 is used to receive an update instruction from the first developer for the first private dependency package of the project. The update instruction indicates that the first private dependency package is updated to the first version. The first developer is the developer among the developers of the project who has the right to update the private dependency package of the project. The first update module 802 is used to update the private dependency package directory based on the first version of the first private dependency package to obtain the first private dependency package directory. The first private dependency package directory is used to store private dependency packages in the format of static archive files. One static archive file in the first private dependency package directory corresponds to one version of the private dependency package. The second update module 803 is used to update the lock file of the project based on the first private dependency package directory to obtain a first lock file. The first lock file is used to indicate the exact version information of the private dependency package of the project and the exact download information of the private dependency package. The exact download information points to a static archive file in the first private dependency package directory.

[0166] In one possible implementation, the first update module 802 includes: The generation unit is used to generate the first static archive file corresponding to the first private dependency package of the first version; The first update unit is used to update the static archive file in the private dependency package directory based on the first static archive file, so as to obtain the first private dependency package directory.

[0167] In one possible implementation, the project further includes a dependency directory for storing the project's private dependency packages locally, and the generation unit is used for: If the dependency directory includes the first version of the first private dependency package, the first version of the first private dependency package in the dependency directory will be used to generate the first static archive file; or, If the dependency directory does not include the first version of the first private dependency package, download the first version of the first private dependency package from the private repository and generate the first static archive file from the first version of the first private dependency package.

[0168] In one possible implementation, the second update module 803 includes: The second update unit is used to update the exact version information of the first private dependency package to the first version and the exact download information of the first private dependency package to the first static archive file in the first private dependency package directory, based on the first static archive file in the first private dependency package directory, to obtain the first lock file.

[0169] In one possible implementation, the project further includes a dependency management configuration file, which includes configuration information, such as specified version information and specified download information for the project's private dependency packages, wherein the specified download information points to a static archive file in the private dependency package directory. The apparatus further includes: The third update module is used to update the specified version information of the first private dependency package to the first version in the dependency management configuration file of the project based on the first static archive file in the first private dependency package directory, and update the specified download information of the first private dependency package to the first static archive file in the first private dependency package directory, so as to obtain the first dependency management configuration file.

[0170] In one possible implementation, the configuration information further includes the resolution path of the project's private dependency packages, and the third update module is further configured to: In the dependency management configuration file, the resolution path of the first private dependency package is forced to point to the first static archive file in the directory of the first private dependency package.

[0171] In one possible implementation, the project further includes a dependency directory for locally storing private dependency packages of the project, as well as information indicating the actual version and actual download information of the private dependency packages. The apparatus further includes: The fourth update module is used to update the first private dependency package to the first version of the private dependency package in the dependency directory based on the first static archive file in the first private dependency package directory, update the actual version information of the first private dependency package to the first version, and update the actual download information of the first private dependency package to the first static archive file in the first private dependency package directory, thereby obtaining the first dependency directory.

[0172] In one possible implementation, the device further includes: The error reporting module is used to generate update error messages and exit the update process if any one of the following is updated: the private dependency package directory, the project's dependency management configuration file, the project's lock file, and the project's dependency directory, and any update fails.

[0173] In one possible implementation, the installation module 804 includes: The download unit is configured to download the first static archive file from the first private dependency package directory based on the first lock file; The extraction unit is used to extract the first private dependency package of the first version from the first static archive file; The installation unit is used to install the first private dependency package of the first version.

[0174] In one possible implementation, the update instructions are pre-configured in the project's script.

[0175] In one possible implementation, the static archive file is in the format of an archive compressed package.

[0176] In one possible implementation, the receiving module 801 is configured to: Based on human-computer interaction, the system receives update instructions from the first developer for the first private dependency package of the project.

[0177] In one possible implementation, the device further includes: The upload module is used to upload the first private dependency package directory and the first lock file to the first server, and the developers of the project share the first private dependency package directory and the first lock file in the first server.

[0178] It should be noted that the private dependency package processing device provided in the above embodiments is only illustrated by the division of the above functional modules when performing the corresponding steps. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the private dependency package processing device and the private dependency package processing method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0179] Figure 9 This is a structural block diagram of a private dependency package processing device provided in an embodiment of this application. Figure 9 As shown, the device includes: a receiving module 901, a downloading module 902, an extraction module 903, and an installation module 904.

[0180] The receiving module 901 is used to receive an installation instruction for the first private dependency package of the first version of the project; Download module 902 is used to download a first static archive file from a first private dependency package directory based on a first lock file of the project. The first private dependency package directory is used to store private dependency packages in the format of static archive files. The first static archive file in the first private dependency package directory corresponds to the first version of the private dependency package. The first lock file is used to indicate the exact version information of the private dependency package of the project and the exact download information of the private dependency package. The exact download information points to a static archive file in the first private dependency package directory. Extraction module 903 is used to extract the first private dependency package of the first version from the first static archive file; Install module 904 to install the first private dependency package of the first version.

[0181] In one possible implementation, the installation instruction is a freeze lock file installation instruction, and the download module 902 is used for: Query the first lock file; If the installation instructions match the exact version information and exact download information of the first private dependency package in the first lock file, the first static archive file is downloaded from the first private dependency package directory.

[0182] In one possible implementation, the device further includes: The error reporting module is used to generate installation error information when the installation instructions do not match the exact version information and exact download information of the first private dependency package in the first lock file.

[0183] It should be noted that the private dependency package processing device provided in the above embodiments is only illustrated by the division of the above functional modules when performing the corresponding steps. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the private dependency package processing device and the private dependency package processing method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0184] In this embodiment of the disclosure, an electronic device is also provided, which includes a processor and a memory. The memory is used to store at least one computer program, which is loaded and executed by the processor to implement the event context display method described above.

[0185] Taking electronic devices as terminals as an example, Figure 10 This is a structural block diagram of a terminal provided in an embodiment of this application, such as... Figure 10 As shown, terminal 1000 can be: a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. Terminal 1000 may also be referred to as user equipment, portable terminal, laptop terminal, desktop terminal, or other names.

[0186] Typically, terminal 1000 includes a processor 1001 and a memory 1002.

[0187] Processor 1001 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1001 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1001 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1001 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1001 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0188] The memory 1002 may include one or more computer-readable storage media, which may be non-transitory. The memory 1002 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1002 are used to store at least one computer program, which is executed by the processor 1001 to implement the terminal execution process in the tabular data display method provided in the method embodiments of this disclosure.

[0189] In some embodiments, the terminal 1000 may also optionally include a peripheral device interface 1003 and at least one peripheral device. The processor 1001, memory 1002, and peripheral device interface 1003 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1003 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 1004, a display screen 1005, a camera assembly 1006, an audio circuit 1007, and a power supply 1008.

[0190] Peripheral device interface 1003 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1001 and memory 1002. In some embodiments, processor 1001, memory 1002 and peripheral device interface 1003 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1001, memory 1002 and peripheral device interface 1003 can be implemented on separate chips or circuit boards, which is not limited in this disclosure.

[0191] The radio frequency (RF) circuit 1004 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1004 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1004 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. In some embodiments, the RF circuit 1004 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1004 can communicate with other terminals via at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: metropolitan area networks (MANs), various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks (WLANs), and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1004 may also include circuitry related to NFC (Near Field Communication), which is not limited herein.

[0192] Display screen 1005 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1005 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1001 for processing. In this case, display screen 1005 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1005, disposed on the front panel of terminal 1000; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 1000 or in a folded design; in still other embodiments, display screen 1005 may be a flexible display screen, disposed on a curved or folded surface of terminal 1000. Furthermore, display screen 1005 may also be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1005 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).

[0193] The camera assembly 1006 is used to acquire images or videos. In some embodiments, the camera assembly 1006 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1006 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash is a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.

[0194] The audio circuit 1007 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 1001 for processing, or input to the radio frequency circuit 1004 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each positioned at a different location on the terminal 1000. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 1001 or the radio frequency circuit 1004 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 1007 may also include a headphone jack.

[0195] The power supply 1008 is used to power the various components in the terminal 1000. The power supply 1008 can be AC ​​power, DC power, a disposable battery, or a rechargeable battery. When the power supply 1008 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0196] In some embodiments, the terminal 1000 further includes one or more sensors 1009. The one or more sensors 1009 include, but are not limited to: an acceleration sensor 1011, a gyroscope sensor 1011, a pressure sensor 1012, an optical sensor 1013, and a proximity sensor 1014.

[0197] Accelerometer 1011 can detect the magnitude of acceleration along the three coordinate axes of a coordinate system established by terminal 1000. For example, accelerometer 1011 can be used to detect the components of gravitational acceleration along the three coordinate axes. Processor 1001 can control display screen 1005 to display the user page in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 1011. Accelerometer 1011 can also be used for collecting game or user motion data.

[0198] The gyroscope sensor 1011 can detect the orientation and rotation angle of the terminal 1000. The gyroscope sensor 1011 can work in conjunction with the accelerometer sensor 1011 to collect the user's 3D movements on the terminal 1000. Based on the data collected by the gyroscope sensor 1011, the processor 1001 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.

[0199] The pressure sensor 1012 can be disposed on the side bezel of the terminal 1000 and / or on the lower layer of the display screen 1005. When the pressure sensor 1012 is disposed on the side bezel of the terminal 1000, it can detect the user's grip signal on the terminal 1000, and the processor 1001 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 1012. When the pressure sensor 1012 is disposed on the lower layer of the display screen 1005, the processor 1001 can control the operable controls on the UI page based on the user's pressure operation on the display screen 1005. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.

[0200] An optical sensor 1013 is used to collect ambient light intensity. In one embodiment, the processor 1001 can control the display brightness of the display screen 1005 based on the ambient light intensity collected by the optical sensor 1013. Specifically, when the ambient light intensity is high, the display brightness of the display screen 1005 is increased; when the ambient light intensity is low, the display brightness of the display screen 1005 is decreased. In another embodiment, the processor 1001 can also dynamically adjust the shooting parameters of the camera assembly 1006 based on the ambient light intensity collected by the optical sensor 1013.

[0201] The proximity sensor 1014, also known as a distance sensor, is typically installed on the front panel of the terminal 1000. The proximity sensor 1014 is used to detect the distance between the user and the front of the terminal 1000. In one embodiment, when the proximity sensor 1014 detects that the distance between the user and the front of the terminal 1000 is gradually decreasing, the processor 1001 controls the display screen 1005 to switch from a screen-on state to a screen-off state; when the proximity sensor 1014 detects that the distance between the user and the front of the terminal 1000 is gradually increasing, the processor 1001 controls the display screen 1005 to switch from a screen-off state to a screen-on state.

[0202] Those skilled in the art will understand that Figure 10 The structure shown does not constitute a limitation on terminal 1000 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0203] Taking electronic devices as servers as an example, Figure 11This is a structural block diagram of a server provided in an embodiment of this application. The server 1100 can vary considerably due to different configurations or performance. It may include one or more CPUs (Central Processing Units) 1101 and one or more memories 1102. The one or more memories 1102 store at least one computer program, which is loaded and executed by the one or more processors 1101 to implement the event context generation method described above. Of course, the server 1100 may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server 1100 may also include other components for implementing device functions, which will not be elaborated here.

[0204] In this embodiment of the application, a computer-readable storage medium including a computer program is also provided, such as a memory 1002 including a computer program. The computer program can be executed by the processor 1001 of the terminal 1000 to complete the processing method of the private dependency package. In some embodiments, another computer-readable storage medium including a computer program is also provided, such as a memory 1102 including a computer program. The computer program can be executed by the processor 1101 of the server 1100 to complete the processing method of the private dependency package. Optionally, the computer-readable storage medium may be ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact-Disc Read-Only Memory), magnetic tape, floppy disk, and optical data storage device, etc.

[0205] In this application embodiment, a computer program product is also provided, including one or more computer programs, which are executed by one or more processors of a terminal or server, enabling the electronic device to perform the above-described private dependency package processing method.

[0206] In some embodiments, the computer program for the private dependency package processing method involved in the embodiments of this application may be deployed and executed on a computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed in multiple locations and interconnected through a communication network. Multiple computer devices distributed in multiple locations and interconnected through a communication network may form a blockchain system.

[0207] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0208] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for processing private dependency packages, characterized in that, The method includes: Receive an update instruction from the first developer for the first private dependency package of the project, the update instruction instructing the first private dependency package to be updated to the first version, the first developer being the developer among the developers of the project who has the right to update the private dependency package of the project; Based on the first version of the first private dependency package indicated by the update instruction, the private dependency package directory is updated to obtain the first private dependency package directory. The first private dependency package directory is used to store private dependency packages in the format of static archive files. One static archive file in the first private dependency package directory corresponds to one version of the private dependency package. Based on the first private dependency package directory, update the lock file of the project to obtain the first lock file. The first lock file is used to indicate the exact version information of the private dependency package of the project and the exact download information of the private dependency package. The exact download information points to a static archive file in the first private dependency package directory. Based on the first private dependency package directory and the first lock file, install the first version of the first private dependency package.

2. The method according to claim 1, characterized in that, The step of updating the private dependency package directory based on the first version of the first private dependency package indicated by the update instruction to obtain the first private dependency package directory includes: Generate the first static archive file corresponding to the first private dependency package of the first version; Based on the first static archive file, update the static archive file in the private dependency package directory to obtain the first private dependency package directory.

3. The method according to claim 2, characterized in that, The project also includes a dependency directory, which is used to store the project's private dependency packages locally. Generating the first static archive file corresponding to the first version of the first private dependency package includes: If the dependency directory includes the first version of the first private dependency package, the first version of the first private dependency package in the dependency directory will be used to generate the first static archive file; or, If the dependency directory does not include the first version of the first private dependency package, download the first version of the first private dependency package from the private repository and generate the first static archive file from the first version of the first private dependency package.

4. The method according to claim 2, characterized in that, The step of updating the project's lock file based on the first private dependency package directory to obtain the first lock file includes: Based on the first static archive file in the first private dependency package directory, the exact version information of the first private dependency package is updated to the first version in the lock file, and the exact download information of the first private dependency package is updated to the first static archive file in the first private dependency package directory, thus obtaining the first lock file.

5. The method according to claim 2, characterized in that, The project also includes a dependency management configuration file, which includes configuration information, such as version information and download information for the project's private dependency packages. The download information points to a static archive file in the private dependency package directory. The method further includes: Based on the first static archive file in the first private dependency package directory, the specified version information of the first private dependency package is updated to the first version in the dependency management configuration file of the project, and the specified download information of the first private dependency package is updated to the first static archive file in the first private dependency package directory, thus obtaining the first dependency management configuration file.

6. The method according to claim 5, characterized in that, The configuration information also includes the resolution path of the project's private dependency packages, and the method further includes: In the dependency management configuration file, the resolution path of the first private dependency package is forced to point to the first static archive file in the directory of the first private dependency package.

7. The method according to claim 2, characterized in that, The project also includes a dependency directory, which is used to store the project's private dependency packages locally, as well as information indicating the actual version and download details of the private dependency packages. The method further includes: Based on the first static archive file in the first private dependency package directory, the first private dependency package is updated to the first version of the private dependency package in the dependency directory, the actual version information of the first private dependency package is updated to the first version, and the actual download information of the first private dependency package is updated to the first static archive file in the first private dependency package directory, thus obtaining the first dependency directory.

8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: If any one of the following is updated and an error occurs: the private dependency package directory, the project's dependency management configuration file, the project's lock file, or the project's dependency directory, an update error message is generated and the update process is terminated.

9. The method according to claim 1, characterized in that, The installation of the first version of the first private dependency package based on the first private dependency package and the first lock file includes: Based on the first lock file, download the first static archive file from the first private dependency package directory; Extract the first private dependency package of the first version from the first static archive file; Install the first private dependency package of the first version.

10. The method according to claim 1, characterized in that, The update command is pre-configured in the project's script.

11. The method according to claim 1, characterized in that, The static archive file is in the format of an archive compressed package.

12. The method according to claim 1, characterized in that, The method further includes: The first private dependency package directory and the first lock file are uploaded to the first server, and the developers of the project share the first private dependency package directory and the first lock file in the first server.

13. A method for processing private dependency packages, characterized in that, The method includes: Receive the installation command for the first private dependency package of the first version of the project; Based on the first lock file of the project, a first static archive file is downloaded from the first private dependency package directory. The first private dependency package directory is used to store private dependency packages in the format of static archive files. The first static archive file in the first private dependency package directory corresponds to the first version of the private dependency package. The first lock file is used to indicate the exact version information of the private dependency package of the project and the exact download information of the private dependency package. The exact download information points to a static archive file in the first private dependency package directory. Extract the first private dependency package of the first version from the first static archive file; Install the first private dependency package of the first version.

14. The method according to claim 13, characterized in that, The installation instruction is a freeze lock file installation instruction, which, based on the first lock file of the project, downloads the first static archive file from the first private dependency package directory, including: Query the first lock file; If the installation instructions match the exact version information and exact download information of the first private dependency package in the first lock file, the first static archive file is downloaded from the first private dependency package directory.

15. The method according to claim 14, characterized in that, The method further includes: If the installation instructions do not match the exact version information and exact download information of the first private dependency package in the first lock file, an installation error message is generated.

16. A processing apparatus for private dependency packages, characterized in that, The device includes: A receiving module is used to receive an update instruction from a first developer for a first private dependency package of the project. The update instruction indicates that the first private dependency package should be updated to a first version. The first developer is a developer among the developers of the project who has the right to update the private dependency package of the project. The first update module is used to update the private dependency package directory based on the first version of the first private dependency package to obtain the first private dependency package directory. The first private dependency package directory is used to store private dependency packages in the format of static archive files. One static archive file in the first private dependency package directory corresponds to one version of the private dependency package. The second update module is used to update the lock file of the project based on the first private dependency package directory to obtain a first lock file. The first lock file is used to indicate the exact version information of the private dependency package of the project and the exact download information of the private dependency package. The exact download information points to a static archive file in the first private dependency package directory. The installation module is used to install the first version of the first private dependency package based on the first private dependency package directory and the first lock file.

17. A device for processing private dependency packages, characterized in that, The device includes: The receiving module is used to receive installation instructions for the first private dependency package of the first version of the project; The download module is used to download a first static archive file from a first private dependency package directory based on a first lock file of the project. The first private dependency package directory is used to store private dependency packages in the format of static archive files. The first static archive file in the first private dependency package directory corresponds to the first version of the private dependency package. The first lock file is used to indicate the exact version information of the private dependency package of the project and the exact download information of the private dependency package. The exact download information points to a static archive file in the first private dependency package directory. The extraction module is used to extract the first private dependency package of the first version from the first static archive file; The installation module is used to install the first private dependency package of the first version.

18. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory being used to store at least one computer program, the at least one computer program being loaded and executed by the processor to implement the method for processing private dependency packages as described in any one of claims 1 to 12 or 13 to 15.

19. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the method for processing private dependency packages as described in any one of claims 1 to 12 or 13 to 15.

20. A computer program product, characterized in that, The computer program product includes at least one computer program, which is loaded and executed by a processor to implement the method for processing private dependency packages as described in any one of claims 1 to 12 or 13 to 15.