Project mirror volume optimization method, system, terminal device and storage medium

By parsing and compressing the project file package and uploading it to the local area network repository, an image is generated and deployed, which solves the network transmission problem caused by the large image size and achieves efficient image deployment.

CN115599419BActive Publication Date: 2026-04-21SHENZHEN WANWU SECURITY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN WANWU SECURITY TECH CO LTD
Filing Date
2022-10-20
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In private or leased network environments, excessively large image sizes can restrict network transmission and impact service deployment efficiency.

Method used

The project file package is parsed to generate a parsing file, which is then compressed and uploaded to the local area network repository. This triggers the download of project resources, and the server decompresses and builds the image according to the upgrade instructions.

Benefits of technology

The size of the project image has been optimized, avoiding business blockage caused by the transmission of large images on the local area network, and achieving efficient image deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115599419B_ABST
    Figure CN115599419B_ABST
Patent Text Reader

Abstract

This invention discloses a method, system, terminal device, and storage medium for optimizing project image size. The method includes: generating a parsed file of the project by parsing the project's file package, compressing it, and uploading it to a local area network (LAN) repository; triggering the LAN repository to download the corresponding project resource items; sending an upgrade command to the server, so that the server can obtain the compressed parsed file from the LAN repository according to the upgrade command, decompress it, and then download the corresponding project resource items from the LAN repository; and building and deploying the project image based on the project resource items. This application generates the project image by parsing the project into multiple parts, uploading the parsed file to the LAN repository, and then controlling the server to obtain the project resource items from the LAN repository through a client-sent command. This optimizes the size of the project image and avoids business congestion caused by the transmission of large business images on the LAN, achieving the effect of efficiently upgrading the project image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image volume optimization, and more particularly to methods, systems, terminal devices, and storage media for optimizing project image volume. Background Technology

[0002] Currently, in public or private cloud scenarios, users push their completed images to the corresponding repositories. These images are layered, using mostly system-provided files, and under public network bandwidth conditions, there isn't a significant difference in size. However, when carrying business logic, the image size increases several times over. In private networks or dedicated lines, sometimes only partial code modifications are needed, but due to the large size of the business image, network limitations during transmission of large images can cause business congestion, impacting the overall network situation.

[0003] Therefore, how to efficiently deploy business project images in private domain networks or dedicated network environments, and avoid business blockage caused by network limitations when transmitting large image sizes, is an urgent problem to be solved. Summary of the Invention

[0004] The main purpose of this application is to provide a method, system, terminal device and storage medium for optimizing project image size, aiming to solve the problem of efficiently deploying project images in private domain networks or leased network environments, and avoiding business blockage caused by network limitations when transmitting excessively large image sizes.

[0005] To achieve the above objectives, this application provides a method for optimizing image volume, applicable to the field of image volume optimization technology. The method for optimizing project image volume includes the following steps:

[0006] Obtain the project's file package;

[0007] The project's file package is parsed to generate the project's parsed file;

[0008] The parsed file is compressed, and the compressed parsed file is uploaded to a preset local area network repository, triggering the local area network repository to download the corresponding project resource item;

[0009] The upgrade command for the project is sent to the server, so that the server can obtain the compressed parsing file from the preset local area network repository according to the upgrade command, decompress it to obtain the decompressed parsing file; download the corresponding project resource items from the preset local area network repository according to the decompressed parsing file; and build and deploy the image of the project according to the project resource items.

[0010] Optionally, the step of parsing the project's file package to generate the project's parsed file includes:

[0011] The system sequentially checks whether a previous version of the project exists in the project's file package, and obtains the results.

[0012] Based on the judgment result and the project file package, generate a project parsing file;

[0013] When the projects in the project's file package are parsed sequentially, the project's parsing file is generated based on the project parsing file. The project's parsing file includes a dependency description file, a base image description file, source code files, and a version configuration file.

[0014] Optionally, the project parsing file includes newly added information items and / or information items for the project, and the step of generating the project parsing file based on the judgment result and the project in the project's file package includes:

[0015] If a previous version exists, the current version of the project is parsed and compared with the previous version of the project to obtain the new information items of the project.

[0016] If a previous version does not exist, the information items of the project are parsed and obtained.

[0017] Optionally, the preset local area network repository includes a mirror repository, a version configuration repository, and a dependency repository. The step of compressing the parsed file, uploading the compressed parsed file to the preset local area network repository, and triggering the local area network repository to download the corresponding project resource item includes:

[0018] The dependency description file and the source code file are compressed and uploaded to the dependency repository;

[0019] Upload the base image description file to the image repository;

[0020] The version configuration file is compressed and uploaded to the version configuration repository.

[0021] Optionally, when applied to a local area network repository, the method for optimizing the project image size further includes the following steps:

[0022] Receive compressed and parsed files uploaded from the client;

[0023] Download the corresponding project resource items based on the compressed parsed file.

[0024] Optionally, when applied to the server side, the method for optimizing the project image size also includes the following steps:

[0025] Receive upgrade instructions for the project sent by the client;

[0026] According to the upgrade instruction, the compressed parsing file is obtained from the preset local area network repository and decompressed to obtain the decompressed parsing file;

[0027] Based on the decompressed parsed file, download the corresponding project resource items from the preset local area network repository;

[0028] Build and deploy a mirror of the project based on the project resource items.

[0029] Optionally, after the step of downloading the project's dependency files from the dependency repository based on the dependency description file in the decompressed parsed file, the method further includes:

[0030] Inject the project's dependency files into the project's architecture.

[0031] Optionally, the step of downloading the corresponding project resource item from the preset local area network repository based on the decompressed parsed file includes:

[0032] Download the project's dependency files from the dependency repository based on the dependency description file in the decompressed parsed file; and / or

[0033] Based on the base image description file in the decompressed parsed file, download the base image of the project from the image repository.

[0034] This application also proposes a project image size optimization system, which includes a client, a local area network repository, and a server. The project image size optimization system includes:

[0035] The client is configured to: acquire the project's file package; parse the project's file package to generate a parsed file for the project; compress the parsed file and upload the compressed parsed file to a preset local area network (LAN) repository, triggering the LAN repository to download the corresponding project resource items; send an upgrade command for the project to the server, so that the server, based on the upgrade command, acquires and decompresses the compressed parsed file from the preset LAN repository to obtain a decompressed parsed file; download the corresponding project resource items from the preset LAN repository based on the decompressed parsed file; and build and deploy an image of the project based on the project resource items.

[0036] The local area network repository is used to receive compressed and parsed files uploaded from the client; and to download the corresponding project resource items based on the compressed and parsed files.

[0037] The server is configured to receive upgrade instructions for a project sent by the client; according to the upgrade instructions, retrieve and decompress a compressed parsing file from the preset local area network repository to obtain a decompressed parsing file; according to the decompressed parsing file, download the corresponding project resource items from the preset local area network repository; and build and deploy an image of the project based on the project resource items.

[0038] This application also proposes a terminal device, which includes a memory, a processor, and a project image volume optimization program stored in the memory and executable on the processor. When the project image volume optimization program is executed by the processor, it implements the steps of the project image volume optimization method.

[0039] This application also proposes a storage medium storing a project image volume optimization program, wherein the project image volume optimization program, when executed by a processor, implements the steps of the project image volume optimization method.

[0040] This application proposes a method, system, terminal device, and storage medium for optimizing project image size. The method involves: acquiring the project's file package; parsing the project's file package to generate a parsed file; compressing the parsed file and uploading the compressed parsed file to a preset local area network (LAN) repository, triggering the LAN repository to download the corresponding project resource items; sending an upgrade command for the project to the server, which then retrieves and decompresses the compressed parsed file from the preset LAN repository according to the upgrade command, obtaining a decompressed parsed file; downloading the corresponding project resource items from the preset LAN repository based on the decompressed parsed file; and constructing and deploying the project image based on the project resource items. Based on this application, by parsing the project into multiple parts, uploading the parsed file to a LAN repository, and then controlling the server to retrieve project resource items from the LAN repository via a client-sent command to generate the project image, the size of the project image is optimized, avoiding business congestion caused by transmitting large business images on the LAN, and achieving efficient project image upgrades. Attached Figure Description

[0041] Figure 1 This is a schematic diagram of the functional modules of the terminal device to which the image volume optimization device of this application belongs;

[0042] Figure 2 This is a flowchart illustrating a first exemplary embodiment of the method for optimizing the image volume of the project in this application.

[0043] Figure 3 This is a flowchart illustrating a second exemplary embodiment of the method for optimizing the image volume of the project in this application.

[0044] Figure 4 This is a flowchart illustrating a third exemplary embodiment of the method for optimizing the image volume of the project in this application.

[0045] Figure 5 This is a flowchart illustrating the fourth exemplary embodiment of the method for optimizing the image volume of the project in this application.

[0046] Figure 6 This is a flowchart illustrating the fifth exemplary embodiment of the method for optimizing the image volume of the project in this application.

[0047] Figure 7 This is a flowchart illustrating the sixth exemplary embodiment of the method for optimizing the image volume of the project in this application.

[0048] Figure 8 This is a flowchart illustrating the seventh exemplary embodiment of the method for optimizing the image volume of the project in this application.

[0049] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0050] It should be understood that the specific implementation examples described herein are merely for illustrative purposes and are not intended to limit the scope of this application.

[0051] The main solution of this application embodiment is to obtain the project file package; parse the project file package to generate a parsed file for the project; compress the parsed file and upload the compressed parsed file to a preset local area network (LAN) repository, triggering the LAN repository to download the corresponding project resource items; send an upgrade command for the project to the server, so that the server can obtain the compressed parsed file from the preset LAN repository and decompress it according to the upgrade command to obtain a decompressed parsed file; download the corresponding project resource items from the preset LAN repository according to the decompressed parsed file; and build and deploy the project image according to the project resource items. Based on this application solution, by parsing the project into multiple parts, uploading the parsed file to the LAN repository, and then controlling the server to generate the project image through a client-sent command, the size of the image during project upgrade is optimized, avoiding the business blocking problem caused by the transmission of large-volume business images on the LAN, and achieving the effect of efficiently upgrading the project image.

[0052] Specifically, refer to Figure 1 , Figure 1This is a schematic diagram of the functional modules of the terminal device to which the image size optimization device for this application belongs. The image size optimization device is a terminal device that can split the project and send project upgrade instructions to the server, so that the server can download project dependency files, base image, and source code from the local area network to build and deploy the image, thereby achieving efficient upgrade of the project image. It can be carried on the terminal device in the form of hardware or software.

[0053] In this embodiment, the terminal device to which the image volume optimization device belongs includes at least an output module 110, a processor 120, a memory 130, and a communication module 140.

[0054] The memory 130 stores an operating system and an image size optimization program. The image size optimization device can: acquire the project's file package; parse the project's file package to generate a parsed file; compress the parsed file; upload the compressed parsed file to a preset local area network (LAN) repository, triggering the LAN repository to download the corresponding project resource items; send an upgrade command for the project to the server, so that the server can obtain the compressed parsed file from the preset LAN repository and decompress it according to the upgrade command to obtain a decompressed parsed file; download the corresponding project resource items from the preset LAN repository according to the decompressed parsed file; and store information such as building the project image and deployment according to the project resource items in the memory 130. The output module 110 may be a display screen, etc. The communication module 140 may include a WIFI module, a mobile communication module, and a Bluetooth module, etc., and communicates with external terminal devices or servers through the communication module 140.

[0055] The project image volume optimization program in memory 130, when executed by the processor, performs the following steps:

[0056] Obtain the project's file package;

[0057] The project's file package is parsed to generate the project's parsed file;

[0058] The parsed file is compressed, and the compressed parsed file is uploaded to a preset local area network repository, triggering the local area network repository to download the corresponding project resource item;

[0059] The upgrade command for the project is sent to the server, so that the server can obtain the compressed parsing file from the preset local area network repository according to the upgrade command, decompress it to obtain the decompressed parsing file; download the corresponding project resource items from the preset local area network repository according to the decompressed parsing file; and build and deploy the image of the project according to the project resource items.

[0060] Furthermore, when the processor executes the program to optimize the size of the project image in memory 130, it also performs the following steps:

[0061] The system sequentially checks whether a previous version of the project exists in the project's file package, and obtains the results.

[0062] Based on the judgment result and the project file package, generate a project parsing file;

[0063] When the projects in the project's file package are parsed sequentially, the project's parsing file is generated based on the project parsing file. The project's parsing file includes a dependency description file, a base image description file, source code files, and a version configuration file.

[0064] Furthermore, when the processor executes the program to optimize the size of the project image in memory 130, it also performs the following steps:

[0065] If a previous version exists, the current version of the project is parsed and compared with the previous version of the project to obtain the new information items of the project.

[0066] If a previous version does not exist, the information items of the project are parsed and obtained.

[0067] Furthermore, the preset local area network repository includes a mirror repository, a version configuration repository, and a dependency repository. When the program for optimizing the size of the project image in the storage 130 is executed by the processor, it also performs the following steps:

[0068] The dependency description file and the source code file are compressed and uploaded to the dependency repository;

[0069] Upload the base image description file to the image repository;

[0070] The version configuration file is compressed and uploaded to the version configuration repository.

[0071] Based on, but not limited to, the terminal device architecture described above, this application proposes method embodiments.

[0072] Reference Figure 2 , Figure 2 This is a flowchart illustrating a first exemplary embodiment of a method for optimizing project image size. Applied to a client, the method for optimizing project image size includes:

[0073] Step S110: Obtain the project's file package;

[0074] Specifically, the project can be a newly created project or a previously existing project. A project is divided into multiple project files, and the project's file package is obtained from the local directory.

[0075] Step S120: Parse the file package of the project to generate a parsed file for the project;

[0076] Specifically, the parsing of project file packages is obtained during the CI build process. This parsing process yields the project's dependency files and their relationships, the base image description file for the runtime environment, version configuration files such as server-side encryption private keys or passwords, and source code files. Based on these dependency files and relationships, a dependency description file is generated. This dependency description file describes the download addresses and dependencies of the dependencies.

[0077] Step S130: Compress the parsed file, upload the compressed parsed file to a preset local area network repository, and trigger the local area network repository to download the corresponding project resource item;

[0078] Specifically, to ensure the speed of uploading to the local area network (LAN) repository, the parsed file obtained above is compressed before uploading. The corresponding project resource items are downloaded to the LAN repository based on the compressed parsed file. The compression tool used is existing technology and will not be discussed further here. The preset LAN repository includes a mirror repository, a version configuration repository, and a dependency repository. The dependency description file and the source code file are compressed and uploaded to the dependency repository; the base image description file is uploaded to the image repository; and the version configuration file is compressed and uploaded to the version configuration repository.

[0079] Step S140: Send the upgrade instruction for the project to the server, so that the server can obtain the compressed parsing file from the preset local area network repository according to the upgrade instruction and decompress it to obtain the decompressed parsing file; download the corresponding project resource items from the preset local area network repository according to the decompressed parsing file; build the image of the project according to the project resource items and deploy it.

[0080] Specifically, the upgrade command for the project is sent to the server. After receiving the request command, the server retrieves and decompresses the corresponding compressed files from the image repository, version configuration repository, and dependency repository according to the project version, respectively, to obtain the dependency description file, base image description file, and version configuration file. Based on the dependency description file and base image description file, the server downloads the required dependency files, source code files, and base image from the local area network repository to build the project image. The project image is then generated into a container and deployed to the server to complete the project upgrade.

[0081] This embodiment, through the above-described scheme, specifically involves: acquiring the project's file package; parsing the project's file package to generate a parsed file; compressing the parsed file and uploading the compressed parsed file to a preset local area network (LAN) repository, triggering the LAN repository to download the corresponding project resource items; sending an upgrade command for the project to the server, so that the server, according to the upgrade command, retrieves the compressed parsed file from the preset LAN repository and decompresses it to obtain a decompressed parsed file; downloading the corresponding project resource items from the preset LAN repository based on the decompressed parsed file; and constructing and deploying the project image based on the project resource items. Based on this scheme, by parsing the project into multiple parts, uploading the parsed file to the LAN repository, and then controlling the server through a client-sent command to download the parsed file from the preset LAN repository, thereby downloading the required project resource items, generating the project image, and deploying it, the size of the image during project upgrades is optimized, avoiding business congestion caused by transmitting large business images on the LAN, and achieving the effect of efficiently upgrading project images.

[0082] Furthermore, referring to Figure 3 , Figure 3 The flowchart illustrates a second exemplary embodiment of a method for optimizing project image size. The step of parsing the project's file package to generate a parsed file for the project includes:

[0083] Step S1201: Sequentially determine whether the project in the file package of the project has a previous version, and obtain the determination result;

[0084] Specifically, if there are multiple projects in the project, it is determined in turn whether each project in the project has a previous version.

[0085] Step S1202: Generate a project parsing file based on the judgment result and the project file package of the project;

[0086] Specifically, if a previous version exists, the current version of the project is parsed and compared with the previous version of the project to obtain the new information items of the project; if a previous version does not exist, the information items of the project are parsed and obtained.

[0087] Step S1203: When the projects in the project's file package are parsed sequentially, the parsing file of the project is generated based on the project parsing file. The parsing file of the project includes a dependency description file, a base image description file, a source code file, and a version configuration file.

[0088] Specifically, after parsing the project's code sequentially, the resulting parsed files contain new information items or project information items, including new dependencies, dependency relationships, source code files, and the runtime environment's base image description file. Based on the new dependencies and dependency relationships of all projects under the current project, a dependency description file for the project is generated. Based on the runtime environment's base image, a base image description file is generated. Then, combining the parsed project source code files and version configuration information such as the server-side encryption private key configured for the project, the project's dependency description file, base image description file, source code files, and version configuration file are generated.

[0089] This embodiment, through the above-described scheme, specifically determines whether a previous version exists in the project's file package, obtaining a determination result; based on the determination result and the projects in the project's file package, a project parsing file is generated; when the projects in the project's file package are parsed sequentially, a project parsing file is generated based on the project parsing file. The project parsing file includes a dependency description file, a base image description file, source code files, and a version configuration file. Based on this scheme, by determining whether a project has a previous version, a new base image description file and / or a new dependency description file and source code file, or a complete dependency description file, base image description file, source code files, and version configuration file, are obtained based on the newly added information items. This achieves the goal of splitting the project, uploading the resource items required for building the project image and deployment to the repository, and by determining whether a project has a previous version, only the newly added information items need to be filtered out to generate the corresponding base image description file and / or dependency description file, avoiding the transmission of useless information items and providing convenience for reducing the image size of subsequent project upgrades.

[0090] Furthermore, referring to Figure 4 , Figure 4 This is a flowchart illustrating a third exemplary embodiment of a method for optimizing project image size. The project parsing file includes newly added information items and / or information items of the project, source code files, and dependencies. The step of generating the project parsing file based on the judgment result and the project files in the project's file package includes:

[0091] Step S12021: If a previous version exists, the current version of the project is parsed and compared with the previous version of the project to obtain the new information items of the project.

[0092] Specifically, if a previous version exists, the project version needs to be compared with the previous version to identify updated items and avoid downloading previously existing project resources. The project version is parsed and compared with the previous version to generate new information items and source code files. The source code files include language-dependent source code files and business logic source code files. New information items mainly include newly added dependency files and their dependencies, and / or newly added base image description files. The base image description file mainly records the current dependent environment image version, and the newly added dependency files mainly record the download addresses of updated plugins required by the project, the source code files corresponding to the programming language dependencies, etc.

[0093] Step S12022: If there is no previous version, the information items of the project are parsed and obtained.

[0094] Specifically, if a previous version does not exist, it is necessary to generate source code files and dependency description files for the project based on the complete dependencies and dependency relationships of the project. The source code files here include source code files for language dependencies and business source code files.

[0095] This embodiment, through the above-described scheme, specifically compares the current project version with the previous version if a previous version exists, obtaining the newly added information items for the project; otherwise, it parses and obtains the project's information items. Based on this scheme, by determining whether a project has a previous version, only information items not previously present in the project need to be filtered out to generate corresponding base image description files and / or dependency description files, avoiding the transmission of useless information items and facilitating the reduction of image size for subsequent project upgrades.

[0096] Furthermore, referring to Figure 5 , Figure 5 This is a flowchart illustrating a fourth exemplary embodiment of a method for optimizing project image size. The preset local area network (LAN) repository includes an image repository, a version configuration repository, and a dependency repository. The steps of compressing the parsed file, uploading the compressed parsed file to the preset LAN repository, and triggering the LAN repository to download the corresponding project resource item include:

[0097] Step S1301: Compress the dependency description file and the source code file and upload them to the dependency repository;

[0098] Specifically, compressing the dependency description file and the source code file reduces file size and avoids business blockage during upload.

[0099] Step S1302: Upload the base image description file to the image repository;

[0100] Specifically, the base image description file records the environment image and version required for the business code to run.

[0101] Step S1303: Compress the version configuration file and upload it to the version configuration repository;

[0102] This embodiment, through the above-described scheme, specifically uploads the dependency description file and the source code file to the dependency repository after compression; uploads the base image description file to the image repository; and uploads the version configuration file to the version configuration repository after compression. Based on this scheme, by uploading the parsed files of the project, a large project is broken down into multiple parts, thereby preparing for the subsequent download of project resources from the local area network and the construction of the project image, avoiding the problem of local area network service congestion caused by the excessive size of the subsequent project image.

[0103] Furthermore, referring to Figure 6 , Figure 6 This is a flowchart illustrating a fifth exemplary embodiment of a method for optimizing project image size, applied to a local area network repository. The method for optimizing project image size further includes the following steps:

[0104] Step S1305: Receive the compressed and parsed file uploaded from the client;

[0105] Step S1306: Download the corresponding project resource items according to the compressed parsed file.

[0106] Specifically, after uploading the base image description file and the dependency description file, the dependency files and base image that need to be downloaded from the external network are downloaded to the corresponding repository according to the uploaded parsing file, in preparation for downloading project resources from the local area network and building the project image.

[0107] This embodiment, through the above-described scheme, specifically receives a compressed and parsed file uploaded from the client; and downloads the corresponding project resource items based on the compressed and parsed file. Based on this scheme, the base image and dependency files required for the corresponding version of the project are downloaded from the external network to the local area network repository in advance, preparing for subsequent downloading of project resource items from the local area network and building the project image.

[0108] Furthermore, referring to Figure 7 , Figure 7 This is a flowchart illustrating a sixth exemplary embodiment of a method for optimizing project image size, applied to the server side. The method for optimizing project image size further includes the following steps:

[0109] Step S1400: Receive the project upgrade instruction sent by the client;

[0110] Specifically, the project upgrade instruction informs the server of the project and version to be generated, as well as the version configuration repository.

[0111] Step S1401: According to the upgrade instruction, obtain the compressed parsing file from the preset local area network repository and decompress it to obtain the decompressed parsing file;

[0112] Specifically, after completing the above preparations, the project upgrade instruction is sent to the server that needs to build the image. After receiving the instruction, the server retrieves the source code files, base image description files, version configuration files, and dependency description files from the image repository, version configuration repository, and dependency repository, and decompresses them.

[0113] Step S1402: Download the corresponding project resource items from the preset local area network repository according to the decompressed parsed file;

[0114] Specifically, based on the decompressed parsing files, which include the base image description file, version configuration file, and dependency description file, the necessary dependency files and base image source code files are downloaded from the local area network repository. When a previous version of the project exists, the downloaded parsing file is generated on the client by comparing the latest version of the project with the previous version. Therefore, when building the image through the parsing file, there are no resource items that already exist in the previous architecture of the project. The base image description file and dependency description file only download updated project resource items.

[0115] Step S1403: Build and deploy the image of the project based on the project resource items.

[0116] Specifically, an image of the project is built on a server based on the project resource items. The server building the image can be a server that receives instructions sent by the client, or any server on the project's cluster, depending on the instructions sent. If the project has a previous version, the project's dependency files are injected into the project's architecture.

[0117] This embodiment, through the above-described scheme, specifically involves receiving an upgrade command for a project sent by a client; according to the upgrade command, retrieving and decompressing a compressed parsing file from a preset local area network (LAN) repository to obtain a decompressed parsing file; downloading the corresponding project resource items from the preset LAN repository based on the decompressed parsing file; and constructing and deploying the project image based on the project resource items. Based on this scheme, by downloading the resource files required for the project from the LAN, the goal of breaking down the project and completing the image construction on the server side is achieved, avoiding the business blockage problem caused by excessively large project image transmission volume on the LAN, and improving the efficiency of project image upgrades.

[0118] Furthermore, referring to Figure 8 , Figure 8 The flowchart of the seventh exemplary embodiment of the method for optimizing project image size is shown. The step of downloading the corresponding project resource item from the preset local area network repository based on the decompressed parsed file includes:

[0119] Step S14021: Download the project's dependency files from the dependency repository based on the dependency description file in the decompressed parsed file; and / or

[0120] Specifically, if the dependency description file is not obtained, it means that the previous version of the project did not add any new dependencies compared to the current version. If there are, then the dependency file of the project needs to be downloaded from the dependency repository according to the dependency description file in the decompressed parsed file.

[0121] Step S14022: Download the base image of the project from the image repository based on the base image description file in the decompressed parsed file.

[0122] Specifically, if the base image description file is not obtained, it means that the previous version of the project did not add a base image to the current version. If it did, the base image of the project needs to be downloaded from the image repository according to the decompressed base image description file.

[0123] This embodiment, through the above-described scheme, specifically downloads the project's dependency files from the dependency repository based on the dependency description file in the decompressed parsed file; and / or downloads the project's base image from the image repository based on the base image description file in the decompressed parsed file; and injects the project's dependency files into the project's architecture. Based on this scheme, by receiving instructions sent by the client and downloading the project parsing file, the project resource items are downloaded from the server according to the project parsing file, constructing a project image. The project is broken down into multiple parts, and files already existing in the project architecture do not need to be downloaded, avoiding business congestion caused by the large size of the project image during local area network transmission, and improving the efficiency of upgrading the project image.

[0124] Furthermore, this application also proposes a project image size optimization system, which includes:

[0125] The client is configured to: acquire the project's file package; parse the project's file package to generate a parsed file for the project; compress the parsed file and upload the compressed parsed file to a preset local area network (LAN) repository, triggering the LAN repository to download the corresponding project resource items; send an upgrade command for the project to the server, so that the server, based on the upgrade command, acquires and decompresses the compressed parsed file from the preset LAN repository to obtain a decompressed parsed file; download the corresponding project resource items from the preset LAN repository based on the decompressed parsed file; and build and deploy an image of the project based on the project resource items.

[0126] The local area network repository is used to receive compressed and parsed files uploaded from the client; and to download the corresponding project resource items based on the compressed and parsed files.

[0127] The server is configured to receive upgrade instructions for a project sent by the client; according to the upgrade instructions, retrieve and decompress a compressed parsing file from the preset local area network repository to obtain a decompressed parsing file; according to the decompressed parsing file, download the corresponding project resource items from the preset local area network repository; and build and deploy an image of the project based on the project resource items.

[0128] Furthermore, this application also proposes a terminal device, which includes a memory, a processor, and a project image volume optimization program stored in the memory and executable on the processor. When the project image volume optimization program is executed by the processor, it implements the steps of the project image volume optimization method.

[0129] Since the optimization program for the image size of this project adopts all the technical solutions of all the aforementioned embodiments when it is executed by the processor, it has at least all the beneficial effects brought about by all the technical solutions of all the aforementioned embodiments, which will not be repeated here.

[0130] Furthermore, this application embodiment also proposes a storage medium storing a project image volume optimization program, wherein when the project image volume optimization program is executed by a processor, it implements the steps of the project image volume optimization method.

[0131] Since the optimization program for the image size of this project adopts all the technical solutions of all the aforementioned embodiments when it is executed by the processor, it has at least all the beneficial effects brought about by all the technical solutions of all the aforementioned embodiments, which will not be repeated here.

[0132] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0133] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0134] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, controlled terminal, or network terminal device, etc.) to execute the methods of each embodiment of this application.

[0135] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for optimizing the size of a project image, characterized in that, When applied to the client side, the method for optimizing the project image size includes the following steps: Obtain the project's file package; The project's file package is parsed to generate the project's parsed file; The step of parsing the project's file package to generate the project's parsed file includes: The system sequentially checks whether a previous version of the project exists in the project's file package, and obtains the results. Based on the judgment result and the project file package, generate a project parsing file; When the projects in the project's file package are parsed sequentially, the project's parsing file is generated based on the project parsing file. The project's parsing file includes a dependency description file, a base image description file, source code files, and a version configuration file. The parsed file is compressed, and the compressed parsed file is uploaded to a preset local area network repository, triggering the local area network repository to download the corresponding project resource item; The preset local area network repository includes a mirror repository, a version configuration repository, and a dependency repository. The step of compressing the parsed file, uploading the compressed parsed file to the preset local area network repository, and triggering the local area network repository to download the corresponding project resource item includes: The dependency description file and the source code file are compressed and uploaded to the dependency repository; Upload the base image description file to the image repository; The version configuration file is compressed and then uploaded to the version configuration repository; An upgrade command for the project is sent to the server, which then retrieves and decompresses the compressed parsing file from a preset local area network repository based on the upgrade command, obtaining a decompressed parsing file; downloads the corresponding project resource items from the preset local area network repository based on the decompressed parsing file; and builds and deploys an image of the project based on the project resource items.

2. The method for optimizing project image volume according to claim 1, characterized in that, The project parsing file includes newly added information items or information items for the project. The step of generating the project parsing file based on the judgment result and the project file package includes: If a previous version exists, the current version of the project is parsed and compared with the previous version of the project to obtain the new information items of the project. If a previous version does not exist, the information items of the project are parsed and obtained.

3. A method for optimizing the size of a project image, characterized in that, Applied to a local area network (LAN) repository, which includes an image repository, a version configuration repository, and a dependency repository, the method for optimizing the project image size further includes the following steps: Receive compressed and parsed files uploaded from the client; Prior to the step of receiving the compressed and parsed file uploaded from the client, the method for optimizing the project image size further includes: The client sequentially checks whether a previous version exists in the project's file package, obtains the judgment result, and generates a project parsing file based on the judgment result and the projects in the project's file package. When the projects in the project's file package have been parsed sequentially, the client generates a parsing file for the project based on the project parsing file. The parsing file for the project includes a dependency description file, a base image description file, source code files, and a version configuration file. The client compresses the parsing file and uploads the compressed parsing file to the local area network repository. Download the corresponding project resource items according to the compressed parsed file; The step of downloading the corresponding project resource item based on the compressed parsed file includes: The client compresses the dependency description file and source code file and uploads them to the dependency repository, uploads the base image description file to the image repository, and compresses the version configuration file and uploads it to the version configuration repository.

4. The method for optimizing project image volume according to claim 1, characterized in that, The method for optimizing the project image size also includes the following steps: The server receives the project upgrade command sent by the client; The server retrieves and decompresses the compressed parsing file from a preset local area network repository according to the upgrade instruction, thus obtaining the decompressed parsing file; The server downloads the corresponding project resource items from the preset local area network repository based on the decompressed parsed file; The server constructs and deploys an image of the project based on the project resource items.

5. The method for optimizing the project image volume according to claim 4, characterized in that, The step of downloading the corresponding project resource item from the preset local area network repository based on the decompressed parsed file includes: Based on the dependency description file in the decompressed parsed file, download the project's dependency files from the dependency repository; and / or Based on the base image description file in the decompressed parsed file, download the base image of the project from the image repository.

6. A system for optimizing project image size, characterized in that, The system for optimizing the project image size includes a client, a local area network repository, and a server, wherein: The client is used to obtain the project's file package; parse the project's file package to generate a project parsing file; sequentially determine whether a previous version exists in the project's file package, and obtain the determination result; generate a project parsing file based on the determination result and the projects in the project's file package; when the projects in the project's file package have been parsed sequentially, generate the project parsing file based on the project parsing file, the project parsing file including a dependency description file, a base image description file, source code files, and a version configuration file; compress the parsing file, upload the compressed parsing file to a preset local area network repository, and trigger the local area network repository to download the corresponding item. The project resource items are defined as follows: The preset local area network repository includes an image repository, a version configuration repository, and a dependency repository. The dependency description file and the source code file are compressed and uploaded to the dependency repository; the base image description file is uploaded to the image repository; the version configuration file is compressed and uploaded to the version configuration repository; an upgrade command for the project is sent to the server, so that the server, based on the upgrade command, retrieves and decompresses the compressed parsing file from the preset local area network repository to obtain the decompressed parsing file; based on the decompressed parsing file, the corresponding project resource items are downloaded from the preset local area network repository; and an image of the project is built and deployed based on the project resource items. The local area network repository includes a mirror repository, a version configuration repository, and a dependency repository, used to receive compressed parsing files uploaded from the client. The client sequentially checks whether a previous version exists in the project's file package, obtains a judgment result, and generates a project parsing file based on the judgment result and the projects in the project's file package. When the projects in the project's file package have been parsed sequentially, a parsing file for the project is generated based on the project parsing file. The project parsing file includes a dependency description file, a base image description file, source code files, and a version configuration file. The client compresses the parsing file and uploads the compressed parsing file to the local area network repository. The client downloads the corresponding project resource items based on the compressed parsing file. The client compresses the dependency description file and source code files and uploads them to the dependency repository, uploads the base image description file to the mirror repository, and compresses the version configuration file and uploads it to the version configuration repository. The server is configured to receive upgrade instructions for a project sent by the client; according to the upgrade instructions, retrieve and decompress a compressed parsing file from the preset local area network repository to obtain a decompressed parsing file; according to the decompressed parsing file, download the corresponding project resource items from the preset local area network repository; and build and deploy an image of the project based on the project resource items.

7. A terminal device, characterized in that, The terminal device includes a memory, a processor, and a project image volume optimization program stored in the memory and executable on the processor. When the project image volume optimization program is executed by the processor, it implements the steps of the project image volume optimization method as described in any one of claims 1-5.

8. A storage medium, characterized in that, The storage medium stores an optimization program for the project image size, which, when executed by a processor, implements the steps of the project image size optimization method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Jar packet caching method and device for Maven warehouse and computer equipment

    CN113268224A

  • Java project installation package deployment method and device, terminal equipment and readable medium

    CN114489699A