Cross-platform dependency packet management method, system and device and storage medium
Through the cross-platform dependency package management method, a dependency package structure containing source code packages and build packages is generated, and a diversified warehouse scenario is supported, which solves the complexity of dependency package management in cross-platform development and achieves a more efficient and convenient dependency package. manage.
Patent Information
- Application Number
- CN202411448220.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2024-11-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In a cross-platform development environment, the management of dependency packages is complex, resulting in inconsistent construction systems, poor environmental reproducibility, and difficult to manage platform-specific configurations.
Using cross-platform dependency package management method, generate a dependency package structure containing source code packages, construction packages and other files, and communicate with the response module through the interactive interface to support diversified application scenarios of local warehouses, remote warehouses and virtual warehouses, and unify Manage dependency packages for different platforms.
It improves the flexibility and consistency of dependency package management, reduces the complexity of developers switching and adapting between different platforms, improves user operation convenience and management efficiency, and enhances compatibility and adaptability.
Smart Images

Figure CN118963822A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a platform dependent package management method, system, device and storage medium. Background Art
[0002] In modern software development, especially in a cross-platform development environment, the management of dependency packages has become particularly complex. Due to differences between different platforms, such as operating systems, hardware architectures, and compilers, developers often need to build and maintain specific versions of dependency packages for each platform. This leads to complex dependency management, inconsistent build systems, poor environment reproducibility, and difficulty managing platform-specific configurations. Summary of the invention
[0003] The embodiments of the present application provide a cross-platform dependency package management method, system, device and storage medium to solve the problems existing in the related technologies. The technical solutions are as follows:
[0004] In a first aspect, an embodiment of the present application provides a cross-platform dependency package management method, including: Generate a cross-platform dependency package structure, including source packages, build packages and other files; In the interactive interface, commands are interacted with the response module based on the dependency package, including search, upload, and download; Get the response results of the command in the local warehouse, remote warehouse and virtual warehouse.
[0005] Preferably, generating a cross-platform dependency package structure includes: Determine, in the first interaction module, a dependent package template based on the project file, wherein the dependent package template includes a user name, a package name, a version, and environment information; Using the build instruction, generating a dependency package file based on the dependency package template and the project file; Using the generation instruction, according to the changes of the dependent package file, other folders and files in the dependent package structure are determined, and the dependent package is organized and generated according to the dependent package structure.
[0006] Preferably, the instruction interaction with the response module based on the dependency package in the interactive interface includes: In response to the upload instruction, based on the generated dependency package, the directory structure and files are transmitted to the response module, and after receiving the response module, the file is stored according to the warehouse type and the upload information is saved to the database; In response to the download instruction, according to the pattern in the instruction information, a list of versions matching the pattern is obtained, the corresponding version number is selected to obtain a list of revision numbers, the latest revision number is selected to obtain build information, the component number generated by the platform information is determined according to the first interactive module, the component number is matched from the obtained build information, the list of revision numbers under the matching component number is obtained, and finally the latest revision number under the component number is selected to obtain the build file and source code file.
[0007] Preferably, the determining of other folders and files in the dependent package structure includes: Generate a new revision number and source code file based on the changes in the project file; A new build package name, a revision number under the build package, a build file and an info file are generated based on the environment information of the dependent package template.
[0008] Preferably, the response results of the acquisition instruction in the local warehouse, the remote warehouse and the virtual warehouse include: The local warehouse responds to search, upload, and download instructions and stores uploaded files in the first warehouse module; The remote warehouse agent remote address, obtains remote address results in response to search and download instructions, and caches the download results to the first warehouse module; The virtual warehouse is associated with several local warehouses and remote warehouses, and aggregates the associated warehouse results to respond to search and download instructions.
[0009] Preferably, the virtual warehouse aggregating the associated warehouse results in response to the search and download instructions includes: In response to the search instruction, the first response module traverses the virtual warehouse associated warehouse, obtains version information, and aggregates the results; Cache the version information and corresponding warehouse information in a distributed cache center; In response to the download instruction, the corresponding warehouse information is obtained from the distributed cache center according to the package information in the instruction, and the corresponding warehouse download logic is executed.
[0010] In a second aspect, the embodiment of the present application further provides a cross-platform dependency package management system, which is characterized by comprising: A first interaction module, used to generate a cross-platform dependency package structure, process instruction input and interact with a first response module; A first response module, in response to the search, upload, and download instructions, stores the files according to the warehouse type and saves the uploaded information to the database, and returns the results to the first interaction module; The first warehouse module is used to obtain the response results of the command in the local warehouse, remote warehouse and virtual warehouse; Wherein, the first warehouse module includes: A first warehouse unit, used to store files uploaded by the local warehouse; A second warehouse unit is used to process the remote warehouse proxy remote address, obtain remote address results to respond to search and download instructions, and cache download results; The third warehouse unit is used to process the response result of the virtual warehouse.
[0011] In a third aspect, an embodiment of the present application further provides a computer device, comprising: a memory and a processor. The memory stores instructions, and the instructions are loaded and executed by the processor to implement the method in any of the above-mentioned embodiments. The memory and the processor communicate with each other through an internal connection path.
[0012] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a computer, the method in any one of the above-mentioned embodiments is implemented.
[0013] The advantages or beneficial effects of the above technical solution include at least:
[0014] This application uses a cross-platform dependency package structure, which improves the flexibility of dependency package management and reduces the complexity of developers switching and adapting between different platforms. Through the dependency package structure that includes source packages, build packages and other files, it is possible to uniformly manage dependency packages of different platforms, avoiding the problem of inconsistent versions of multiple platforms under traditional dependency management methods, and improving the maintainability and consistency of dependency packages.
[0015] This application interacts with the response module through an interactive interface, which improves the convenience of user operation and reduces the workload of manually managing dependent packages. Users can easily search, upload and download through the interactive interface, and the system automatically handles the storage and retrieval of dependent packages, significantly improving the efficiency of dependent package management.
[0016] This application takes into account the diverse application scenarios of local warehouses, remote warehouses, and virtual warehouses, and uses a unified dependency package management method to improve the compatibility and adaptability of dependency package management. By supporting different types of warehouses, the system can run efficiently in various complex development and deployment environments, reducing compatibility issues and adaptation difficulties in the dependency package management process.
[0017] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present application will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the accompanying drawings required for use in the embodiments will be briefly introduced below. In the accompanying drawings, unless otherwise specified, the same reference numerals throughout multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that the following drawings only illustrate certain embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can also be obtained based on these drawings without paying creative work.
[0019] Figure 1 This is a flowchart of a cross-platform dependency package management method; Figure 2 This is a schematic diagram of a cross-platform dependency package structure; Figure 3 A schematic diagram of the remote warehouse command interaction and proxy remote address; Figure 4 It is a schematic diagram of the interaction of virtual warehouse instructions and the aggregation of results; Figure 5 This is a schematic diagram of the structure of a cross-platform dependency package management system; Figure 6 The figure is a schematic diagram of the structure of a cross-platform dependency package management device. DETAILED DESCRIPTION
[0020] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.
[0021] The present application discloses a cross-platform dependency package management method, the flow chart of which is as follows Figure 1 As shown, at least steps S101-S103 may be included:
[0022] Step S101: Generate a cross-platform dependency package structure, including source code packages, build packages and other files.
[0023] In actual applications, it is necessary to determine the dependency package template based on the project file. The dependency package template contains the user name, package name, version, and environment information.
[0024] Using a build instruction, a dependency package file is generated based on the dependency package template and the project file; using a generate instruction, the dependency package file is used to determine other folders and files in the dependency package structure according to the change of the dependency package file, and the dependency package is generated according to the dependency package structure; It should be noted that the project file is usually a code project file. The user name, package name, and version in the dependency package template are defined by the user's input, and the environment information is determined based on the actual platform information such as the operating system, hardware architecture, and compiler.
[0025] Step S102: Performing command interaction with the response module based on the dependency package in the interactive interface, including but not limited to searching, uploading, and downloading.
[0026] In actual applications, in response to an upload instruction, based on the generated dependency package, the directory structure and files are transmitted to the response module. After receiving the files, the response module stores the files according to the warehouse type and saves the uploaded information to the database. In response to a download instruction, according to the pattern in the instruction information, a version list matching the pattern is obtained, the corresponding version number is selected to obtain a revision number list, the latest revision number is selected to obtain the build information, the component number generated according to the platform information determined by the interaction module is matched from the obtained build information, the revision number list under the matching component number is obtained, and finally the latest revision number under the component number is selected to obtain the build file and source code file.
[0027] Step S103: Obtain the response results of the command in the local, remote and virtual warehouses.
[0028] In actual applications, the local warehouse responds to search, upload, and download instructions, and stores uploaded files in the first warehouse module; the remote warehouse proxy remote address, obtains remote address results to respond to search and download instructions, and caches download results to the first warehouse module; the virtual warehouse associates several local warehouses and remote warehouses, and aggregates the associated warehouse results to respond to search and download instructions.
[0029] In one possible implementation, the dependency package structure is as follows Figure 2 As shown, the dependent package structure needs to determine the folder and file information, including: generating a new revision number and source code file based on the changes in the project file; generating a new build package name, revision number under the build package, build file and info file based on the environment information of the dependent package template.
[0030] It should be noted that the build package name is usually generated by concatenating strings based on platform information, and then using a hash algorithm to generate a hash value for the string. The build package name is a summary of the hash value. Hash algorithms include but are not limited to SHA-1, SHA-256, and MD5. This ensures that packages with the same configuration have the same build package name, while packages with different configurations have different build package names. Even small configuration changes will result in different build package names.
[0031] It should be noted that the revision number under the build package is a new revision number generated when the build file changes, and the generation method is the hash value of the build file. The info file is a text file that records platform information, configuration files, and file hash information. The recording method can be selected as a key-value pair with one line of information.
[0032] In a cross-platform dependency package management method provided by an embodiment of the present application, when the interactive interface performs command interaction with the response module based on the dependency package, the interface layer provides an HTTP type interface for the interactive interface to call, so that the user can input commands for data interaction. The command usually contains multiple http requests to transmit text information and file streams.
[0033] In a cross-platform dependency package management method provided in an embodiment of the present application, the response results of the command in the local, remote and virtual warehouses are obtained. Specifically, for different types of warehouses:
[0034] Local warehouse: When the user executes the upload instruction in the local warehouse, the system will store the file in the specified storage location. The storage location can be a local storage device, a network file system (such as NFS), a cloud storage service (such as AWS S3), etc. During the upload process, the system will generate relevant metadata and save this information to the database. The database can be a relational database (such as MySQL, PostgreSQL), a NoSQL database (such as MongoDB), etc., for subsequent query and management.
[0035] Remote warehouse such as Figure 3 :The remote repository provides a proxy mechanism to forward the user's request to the actual remote service address and obtain the response result. When obtaining the version list, the server will proxy and forward the user's request to the remote repository and return the version list to the user. When the user selects a specific version to download, the server will obtain the file stream through the download stream and cache it during the file transfer process to improve download efficiency.
[0036] Virtual warehouse Figure 4 :The virtual warehouse responds to user requests by aggregating data from multiple local warehouses and remote warehouses. When a user searches, the virtual warehouse will traverse all its associated warehouses and summarize the version information of each warehouse. Then, the system caches this aggregated version information and the corresponding warehouse information to the distributed cache center to speed up subsequent queries. The distributed cache center can be implemented using a variety of technologies, such as Redis, Memcached, etc. For download operations, the system will obtain the corresponding warehouse information from the cache based on the user's package information and execute the corresponding download logic.
[0037] It should be noted that the process of caching files in the remote warehouse is the same as the process of saving files transmitted by upload instructions in the local warehouse, that is, the remote warehouse has the ability to save files in the local warehouse.
[0038] Reference Figure 5 , shows a schematic diagram of the structure of a cross-platform dependency package management system according to an embodiment of the present application, the system may include: A first interaction module, used to generate a cross-platform dependency package structure, process instruction input and interact with a first response module; A first response module, in response to the search, upload, and download instructions, stores the files according to the warehouse type and saves the uploaded information to the database, and returns the results to the first interaction module; The first warehouse module is used to obtain the response results of the command in the local warehouse, remote warehouse and virtual warehouse;
[0039] Wherein, the first warehouse module includes: A first warehouse unit, used to store files uploaded by the local warehouse; A second warehouse unit is used to process the remote warehouse proxy remote address, obtain remote address results to respond to search and download instructions, and cache download results; The third warehouse unit is used to process the response result of the virtual warehouse.
[0040] Reference Figure 6 , shows a structural block diagram of an electronic device according to an embodiment of the present application, the electronic device includes: a memory 310 and a processor 320, the memory 310 stores instructions that can be run on the processor 320, and the processor 320 loads and executes the instructions to implement the cross-platform dependency package management method in the above embodiment. The number of the memory 310 and the processor 320 can be one or more.
[0041] In one embodiment, the electronic device further includes a communication interface 330 and a display unit 340. The communication interface 330 is used to communicate with external devices and perform data exchange transmission. The display unit 340 is used to display the processing results of the processor 320 to the outside world. If the memory 310, the processor 320, the communication interface 330 and the display unit 340 are implemented independently, the memory 310, the processor 320, the communication interface 330 and the display unit 340 can be interconnected through a bus and complete mutual communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0042] The embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a computer, the method in any one of the above-mentioned embodiments is implemented.
[0043] The computer-readable storage medium involved in the present application includes random access memory (RAM), internal memory, read-only memory (ROM), a hard disk, a removable disk or any other form of storage medium known in the technical field.
[0044] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0045] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0046] Any process or method description in the flow chart or otherwise described herein can be understood to represent a module, fragment or portion of a code including one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.
[0047] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, and the program, when executed, includes one of the steps of the method embodiment or a combination thereof.
[0048] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A cross-platform dependency package management method, characterized in that: include: Generate a cross-platform dependency package structure, including source packages, build packages and other files; In the interactive interface, commands are interacted with the response module based on the dependency package, including search, upload, and download; Get the response results of the command in the local warehouse, remote warehouse and virtual warehouse; The generating of a cross-platform dependency package structure includes: Determine, in the first interaction module, a dependent package template based on the project file, wherein the dependent package template includes a user name, a package name, a version, and environment information; Using the build instruction, generating a dependency package file based on the dependency package template and the project file; Using the generation instruction, according to the changes of the dependent package file, other folders and files in the dependent package structure are determined, and the dependent package is organized and generated according to the dependent package structure; The step of performing command interaction with the response module based on the dependency package in the interactive interface includes: In response to the upload instruction, based on the generated dependency package, the directory structure and files are transmitted to the response module, and after receiving the response module, the file is stored according to the warehouse type and the upload information is saved to the database; In response to the download instruction, according to the pattern in the instruction information, a list of versions matching the pattern is obtained, the corresponding version number is selected to obtain a list of revision numbers, the latest revision number is selected to obtain build information, the component number generated by the platform information is determined according to the first interactive module, the component number is matched from the obtained build information, the list of revision numbers under the matching component number is obtained, and finally the latest revision number under the component number is selected to obtain the build file and source code file.
2. The method according to claim 1, characterized in that The other folders and files in the determined dependent package structure include: Generate a new revision number and source code file based on the changes in the project file; A new build package name, a revision number under the build package, a build file and an info file are generated based on the environment information of the dependent package template.
3. The method according to claim 1, characterized in that The response results of the acquisition instruction in the local warehouse, remote warehouse and virtual warehouse include: The local warehouse responds to search, upload, and download instructions and stores uploaded files in the first warehouse module; The remote warehouse agent remote address, obtains remote address results in response to search and download instructions, and caches the download results to the first warehouse module; The virtual warehouse is associated with several local warehouses and remote warehouses, and aggregates the associated warehouse results to respond to search and download instructions.
4. The method according to claim 3, characterized in that The virtual warehouse aggregates the associated warehouse results in response to the search and download instructions including: In response to the search instruction, the first response module traverses the virtual warehouse associated warehouse, obtains version information, and aggregates the results; Cache the version information and corresponding warehouse information in a distributed cache center; In response to the download instruction, the corresponding warehouse information is obtained from the distributed cache center according to the package information in the instruction, and the corresponding warehouse download logic is executed.
5. A cross-platform dependency package management system, characterized in that: Executing the method according to any one of claims 1 to 4, comprising: A first interaction module, used to generate a cross-platform dependency package structure, process instruction input and interact with a first response module; A first response module, in response to the search, upload, and download instructions, stores the files according to the warehouse type and saves the uploaded information to the database, and returns the results to the first interaction module; The first warehouse module is used to obtain the response results of the command in the local, remote and virtual warehouses; Wherein, the first warehouse module includes: A first warehouse unit, used to store files uploaded by the local warehouse; A second warehouse unit is used to process the remote warehouse proxy remote address, obtain remote address results to respond to search and download instructions, and cache download results; The third warehouse unit is used to process the response result of the virtual warehouse.
6. A cross-platform dependency package management device, characterized in that: include: A processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: include: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Software package warehouse on-demand mirroring method, device and system
CN110908703A
Projection multi-platform service adaptation method
CN110955415A
Third-party library management method and device based on Artifactory
CN116302050A
Three-party library management method and system and readable storage medium
CN118227121A
Cited By
Packet function implementation method and system based on PostgreSQL database and medium
CN120353823A
A package function implementation method, system and medium based on PostgreSQL database
CN120353823B
Cocopods proxy and cache management method and device of product storage system, equipment and medium
CN120596138A
Binary dependent packet management method, device and equipment
CN121187595A
A binary dependency package management method, device and equipment
CN121187595B
