An offline media packaging method and related device

By obtaining the configuration information of the data to be packaged, and performing mirror construction or source code compilation processing, the problem of inefficient packaging in the existing technology is solved, and an automated and efficient packaging process is realized.

CN114281355BActive Publication Date: 2025-07-08ZHENGZHOU YUNHAI INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111447720.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2025-07-08
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

In the prior art, when Jenkins builds multiple tasks, each module builds tasks separately, resulting in inefficient packaging and manual switching operations are required, and packaging operations in different situations cannot be supported in one process.

Method used

By obtaining the configuration information of the data to be packaged, performing image construction or source code compilation processing, it realizes that different process operations are supported in a packaging process, including image construction and source code compilation processing.

Benefits of technology

It improves packaging efficiency, reduces the cost of packaging operations, and realizes an automated packaging process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114281355B_ABST
    Figure CN114281355B_ABST
Patent Text Reader

Abstract

The present application discloses an offline medium packaging method, including: obtaining data to be packaged; if the configuration information of the data to be packaged is image building, performing image building processing on the data to be packaged to obtain offline medium data; if the configuration information of the data to be packaged is source code compilation, performing source code compilation processing on the data to be packaged to obtain offline medium data. By first obtaining the data to be packaged and performing different packaging processes based on the configuration information in the data to be packaged, including performing image building processing on the data to be packaged and performing source code compilation processing on the data to be packaged, it realizes the support for different process operations in one packaging process, improves the packaging efficiency, and reduces the cost of performing packaging operations. The present application also discloses an offline medium packaging device, a server, and a computer-readable storage medium, which have the above beneficial effects.
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 particularly relates to an offline media packaging method, an offline media packaging device, a server, and a computer-readable storage medium. Background Art

[0002] Deploying cloud products requires processes such as installing an operating system, uploading an installation package, and deploying the product. To simplify the process and save labor and time costs, Jenkins can be used for deployment. Among them, Jenkins is an open-source software project and a continuous integration tool developed based on Java, which is used to monitor continuously repeated tasks and aims to provide an open and easy-to-use software platform for software projects to perform continuous integration. The functions of Jenkins include: continuously releasing / testing software versions; monitoring externally called executed tasks.

[0003] In related technologies, the current deployment solution is to build multiple tasks from Jenkins, including building source code, building images, building offline installation packages, and deploying. However, building tasks separately for each module is not conducive to viewing, and different operations need to be manually switched in different situations, reducing the efficiency of packaging.

[0004] Therefore, how to achieve automatic packaging operations in different situations and improve the efficiency of packaging offline media is a key issue that those skilled in the art are concerned about. Summary of the Invention

[0005] The purpose of this application is to provide an offline media packaging method, an offline media packaging device, a server, and a computer-readable storage medium to achieve packaging operations in different situations and improve the efficiency of packaging offline media.

[0006] To solve the above technical problems, this application provides an offline media packaging method, including:

[0007] Obtain data to be packaged;

[0008] If the configuration information of the data to be packaged is image building, perform image building processing on the data to be packaged to obtain offline media data;

[0009] If the configuration information of the data to be packaged is source code compilation, perform source code compilation processing on the data to be packaged to obtain offline media data.

[0010] Optionally, obtaining data to be packaged includes:

[0011] Receive corresponding packaging parameters;

[0012] Pull corresponding binary data from the database;

[0013] Use the binary data and the packaging parameters as the data to be packaged.

[0014] Optionally, perform mirror building processing on the data to be packaged to obtain offline media data, including:

[0015] Determine whether old mirror data is configured in the data to be packaged;

[0016] If so, obtain the old mirror data and perform mirror building processing based on the old mirror data to obtain the offline media data;

[0017] If not, perform mirror building processing based on the data to be packaged to obtain the offline media data.

[0018] Optionally, perform mirror building processing based on the data to be packaged to obtain the offline media data, including:

[0019] Obtain a build trigger sequence;

[0020] Perform mirror building processing on multiple mirror data in the data to be packaged based on the build trigger sequence to obtain the offline media data.

[0021] Optionally, perform source code compilation processing on the data to be packaged to obtain offline media data, including:

[0022] Determine whether the corresponding source code in the data to be packaged is updated;

[0023] If so, compile the binary data in the data to be packaged to obtain the offline media data.

[0024] This application also provides an offline media packaging device, including:

[0025] A data acquisition module, configured to acquire data to be packaged;

[0026] A mirror building module, configured to perform mirror building processing on the data to be packaged to obtain offline media data if the configuration information of the data to be packaged is mirror building;

[0027] A source code compilation module, configured to perform source code compilation processing on the data to be packaged to obtain offline media data if the configuration information of the data to be packaged is source code compilation.

[0028] Optionally, the data acquisition module is specifically configured to receive corresponding packaging parameters; pull corresponding binary data from a database; and use the binary data and the packaging parameters as the data to be packaged.

[0029] Optionally, the image building module is specifically configured to determine whether old image data is configured in the data to be packaged; if so, obtain the old image data and perform image building processing based on the old image data to obtain the offline media data; if not, perform image building processing based on the data to be packaged to obtain the offline media data.

[0030] The present application also provides a server, including:

[0031] A memory for storing a computer program;

[0032] A processor for implementing the steps of the offline media packaging method as described above when executing the computer program.

[0033] The present application also provides a computer-readable storage medium, on which a computer program is stored, and the computer program implements the steps of the offline media packaging method as described above when executed by a processor.

[0034] An offline media packaging method provided by the present application includes: obtaining data to be packaged; if the configuration information of the data to be packaged is image building, performing image building processing on the data to be packaged to obtain offline media data; if the configuration information of the data to be packaged is source code compilation, performing source code compilation processing on the data to be packaged to obtain offline media data.

[0035] By first obtaining the data to be packaged and performing different packaging processes based on the configuration information in the data to be packaged, including performing image building processing on the data to be packaged and performing source code compilation processing on the data to be packaged, it realizes the support for different process operations in one packaging process, improves the packaging efficiency, and reduces the cost of performing packaging operations.

[0036] The present application also provides an offline media packaging device, a server, and a computer-readable storage medium, which have the above beneficial effects and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.

[0038] Figure 1 It is a flowchart of an offline media packaging method provided by an embodiment of the present application;

[0039] Figure 2The structural schematic diagram of an offline medium packaging device provided by an embodiment of the present application. Detailed implementation manners

[0040] The core of the present application is to provide an offline medium packaging method, an offline medium packaging device, a server, and a computer-readable storage medium to implement packaging operations in different situations and improve the efficiency of packaging offline media.

[0041] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0042] In the related art, the currently used deployment solution is to build multiple tasks from Jenkins, including building source code, building images, building offline installation packages, and deploying. However, building tasks separately for each module is not conducive to viewing, and different operations need to be manually switched in different situations, reducing the efficiency of packaging.

[0043] Therefore, the present application provides an offline medium packaging method. By first obtaining the data to be packaged and performing different packaging processes based on the configuration information in the data to be packaged, including performing image building processing on the data to be packaged and performing source code compilation processing on the data to be packaged, it realizes the support for different process operations in one packaging process, improves the packaging efficiency, and reduces the cost of packaging operations.

[0044] The following illustrates an offline medium packaging method provided by the present application through an embodiment.

[0045] Please refer to Figure 1 , Figure 1 which is the flowchart of an offline medium packaging method provided by an embodiment of the present application.

[0046] In this embodiment, the method may include:

[0047] S101, obtain the data to be packaged;

[0048] This step aims to obtain the data to be packaged.

[0049] Among them, the data to be packaged is the data used for data packaging. This data includes the code data to be packaged, as well as the parameters and configuration data used for packaging.

[0050] Further, this step may include:

[0051] Step 1: Receive the corresponding packaging parameters;

[0052] Step 2: Retrieve the corresponding binary data from the database;

[0053] Step 3: Use the binary data and the packaging parameters as the data to be packaged.

[0054] It can be seen that this alternative solution mainly describes how to obtain the data to be packaged. In this alternative solution, the corresponding packaging parameters are received, the corresponding binary data is retrieved from the database, and the binary data and the packaging parameters are used as the data to be packaged.

[0055] S102: If the configuration information of the data to be packaged is image building, perform image building processing on the data to be packaged to obtain offline media data;

[0056] Based on S101, this step aims to perform image building processing on the data to be packaged to obtain offline media data if the configuration information of the data to be packaged is image building. Among them, image building is performed based on the already compiled source code data to obtain each packaged image data.

[0057] Furthermore, this step may include:

[0058] Step 1: Determine whether there is old image data configured in the data to be packaged;

[0059] Step 2: If so, obtain the old image data and perform image building processing based on the old image data to obtain offline media data;

[0060] Step 3: If not, perform image building processing based on the data to be packaged to obtain offline media data.

[0061] It can be seen that this alternative solution mainly describes how to perform image building processing. In this alternative solution, it is determined whether there is old image data configured in the data to be packaged. If so, the old image data is obtained and image building processing is performed based on the old image data to obtain offline media data. If not, image building processing is performed based on the data to be packaged to obtain offline media data.

[0062] Furthermore, step 3 in the previous alternative solution may include:

[0063] Step 1: Obtain the build trigger sequence;

[0064] Step 2: Perform image building processing on multiple image data in the data to be packaged based on the build trigger sequence to obtain offline media data.

[0065] It can be seen that this alternative solution mainly describes how to perform mirror packaging based on constructing a build trigger sequence. In this alternative solution, a build trigger sequence is obtained, and multiple mirror data in the data to be packaged are processed for mirror construction based on the build trigger sequence to obtain offline media data. This can improve the efficiency of packaging multiple mirrors.

[0066] Among them, the build trigger sequence records information about packaging multiple mirrors, and based on this information, automated packaging operations for multiple mirrors can be realized.

[0067] S103, if the configuration information of the data to be packaged is source code compilation, perform source code compilation processing on the data to be packaged to obtain offline media data.

[0068] Based on S101, this step aims to perform source code compilation processing on the data to be packaged to obtain offline media data if the configuration information of the data to be packaged is source code compilation. That is, this step aims to compile the binary data in the data to be packaged to obtain the corresponding source code data, namely offline media data, when performing source code compilation.

[0069] Furthermore, this step may include:

[0070] Step 1, determine whether the corresponding source code in the data to be packaged is updated;

[0071] Step 2, if so, compile the binary data in the data to be packaged to obtain offline media data.

[0072] It can be seen that this alternative solution mainly describes how to perform source code compilation. In this alternative solution, it is determined whether the corresponding source code in the data to be packaged is updated. If so, the binary data in the data to be packaged is compiled to obtain offline media data.

[0073] In summary, in this embodiment, by first obtaining the data to be packaged and performing different packaging processes based on the configuration information in the data to be packaged, including performing mirror construction processing on the data to be packaged and performing source code compilation processing on the data to be packaged, it supports different process operations in one packaging process, improves the packaging efficiency, and reduces the cost of performing packaging operations.

[0074] The following further illustrates a method for packaging offline media provided by this application through a specific embodiment.

[0075] In this embodiment, mainly, the source code of k8s (Kubernetes, container orchestration engine) is first compiled through a pipeline to build a k8s mirror as infrastructure; another pipeline is responsible for packaging the installation package, and the optional parameters are architecture and artifact.

[0076] Among them, the following basic transformations need to be carried out in this embodiment. The k8s source code and docker images are built through the Jenkins file and pushed to the remote image repository. Each project builds its own module images in the way of multi-branch construction. Another pipeline is used for packaging. The architecture can be selected from amd64 / arm64 / mips64le, and the artifacts can be selected from all / iapp / cloudship.

[0077] Among them, the process of offline media packaging can include:

[0078] To build the offline media, the binaries and images compiled from the source code will be pulled. The images of each module have been pulled. In this pipeline, parameters, architecture, and artifacts will be given. The optional content of the parameter arch is amd64 / arm64 / mips64le, and the content of the parameter module is / all / iapps / cloudship. Selecting all will generate a full package, selecting iapps will only generate an offline image package, and selecting cloudship will generate an offline package, including rpm packages, pip packages, binaries, and related images, etc.

[0079] To build module images, if it is necessary to build module images, the construction of each module's images will be triggered according to the image.list (build trigger sequence), otherwise the previously generated images will be used. These images will be pushed to a common harbor repository. The released images and images within 7 days are retained in the repository, and the other images are deleted regularly.

[0080] To compile the k8s source code, if the k8s source code is updated, all binaries will be recompiled, the k8s image will be made and pushed to the harbor repository. When building the offline media, the content will be directly obtained from the harbor repository.

[0081] It can be seen that in this embodiment, by first obtaining the data to be packaged and performing different packaging processes based on the configuration information in the data to be packaged, including performing image construction processing on the data to be packaged and performing source code compilation processing on the data to be packaged, it realizes the support for different process operations in one packaging process, improves the packaging efficiency, and reduces the cost of packaging operations.

[0082] Next, the offline media packaging device provided by the embodiment of the present application will be introduced. The offline media packaging device described below can be correspondingly referred to the offline media packaging method described above.

[0083] Please refer to Figure 2 , Figure 2 which is a schematic structural diagram of an offline media packaging device provided by the embodiment of the present application.

[0084] In this embodiment, the device may include:

[0085] A data acquisition module 100, configured to acquire data to be packaged;

[0086] An image building module 200, configured to perform image building processing on the data to be packaged to obtain offline media data if the configuration information of the data to be packaged is image building;

[0087] A source code compilation module 300, configured to perform source code compilation processing on the data to be packaged to obtain offline media data if the configuration information of the data to be packaged is source code compilation.

[0088] Optionally, the data acquisition module 100 is specifically configured to receive corresponding packaging parameters; pull corresponding binary data from a database; and use the binary data and the packaging parameters as the data to be packaged.

[0089] Optionally, the image building module 200 is specifically configured to determine whether old image data is configured in the data to be packaged; if so, obtain the old image data and perform image building processing based on the old image data to obtain offline media data; if not, perform image building processing based on the data to be packaged to obtain offline media data.

[0090] Optionally, the source code compilation module 300 is specifically configured to determine whether old image data is configured in the data to be packaged; if so, obtain the old image data and perform image building processing based on the old image data to obtain offline media data; if not, perform image building processing based on the data to be packaged to obtain offline media data.

[0091] This application embodiment also provides a server, including:

[0092] A memory, configured to store a computer program;

[0093] A processor, configured to implement the steps of the offline media packaging method as described in the above embodiments when executing the computer program.

[0094] This application embodiment also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the offline media packaging method as described in the above embodiments are implemented.

[0095] The various embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0096] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of this application.

[0097] The steps of the methods or algorithms described in combination with the embodiments disclosed herein can be directly implemented by hardware, software modules executed by a processor, or a combination of the two. The software modules can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.

[0098] The above has introduced in detail an offline medium packaging method, an offline medium packaging device, a server, and a computer-readable storage medium provided by this application. Specific examples are used herein to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. An offline media packaging method, characterized in that, Including: Obtain data to be packaged; wherein, the data to be packaged includes code data to be packaged, as well as parameters and configuration data for packaging. If the configuration information of the data to be packaged is image building, perform image building processing on the data to be packaged to obtain offline medium data. If the configuration information of the data to be packaged is source code compilation, perform source code compilation processing on the data to be packaged to obtain offline medium data. Among them, performing image building processing on the data to be packaged to obtain offline medium data includes: Judge whether old image data is configured in the data to be packaged. If so, obtain the old image data and perform image building processing based on the old image data to obtain the offline medium data. If not, obtain a build trigger sequence and perform image building processing on multiple image data in the data to be packaged based on the build trigger sequence to obtain the offline medium data. Among them, performing source code compilation processing on the data to be packaged to obtain offline medium data includes: Judge whether the corresponding source code in the data to be packaged is updated. If so, compile the binary data in the data to be packaged to obtain the corresponding source code data as the offline medium data.

2. The offline media packaging method according to claim 1, wherein Obtaining data to be packaged includes: Receive corresponding packaging parameters. Pull corresponding binary data from the database. Use the binary data and the packaging parameters as the data to be packaged.

3. An offline media packaging device, characterized in that, Including: A data acquisition module for obtaining data to be packaged; wherein, the data to be packaged includes code data to be packaged, as well as parameters and configuration data for packaging. An image building module for performing image building processing on the data to be packaged to obtain offline medium data if the configuration information of the data to be packaged is image building. A source code compilation module for performing source code compilation processing on the data to be packaged to obtain offline medium data if the configuration information of the data to be packaged is source code compilation. Among them, the image building module is specifically used to judge whether old image data is configured in the data to be packaged; if so, obtain the old image data and perform image building processing based on the old image data to obtain the offline medium data; if not, obtain a build trigger sequence and perform image building processing on multiple image data in the data to be packaged based on the build trigger sequence to obtain the offline medium data. Among them, the source code compilation module is specifically used to judge whether the corresponding source code in the data to be packaged is updated; if so, compile the binary data in the data to be packaged to obtain the corresponding source code data as the offline medium data.

4. The offline media packaging device according to claim 3, wherein, The data acquisition module is specifically used to receive corresponding packaging parameters; pull corresponding binary data from the database; and use the binary data and the packaging parameters as the data to be packaged.

5. A server, characterized in that, Including: A memory for storing computer programs. A processor for implementing the steps of the offline medium packaging method as claimed in claim 1 or 2 when executing the computer program.

6. A computer-readable storage medium, characterized in that A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the offline medium packaging method described in claim 1 or 2 are implemented.

Citation Information

Patent Citations

  • Project code automatic construction and packaging method, device and system and medium

    CN113326481A

  • Continuous integration method and device, computer equipment and storage medium

    CN113703730A