Package automation deployment method and device, electronic equipment and storage medium

CN116166281BActive Publication Date: 2026-10-16DINGDAO ZHILIAN (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211733025.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-10-16
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

其中,步骤1、2、3均需要开发人员进行操作完成,时间成本和经济成本较高,并且,整个流程需要在多个平台进行配置操作,流程复杂,人工操作出错率也比较高

Benefits of technology

[0028] This invention provides an automated deployment method, apparatus, electronic device, and storage medium for software packages. The method involves receiving a software package, generating a domain name identifier for the package, creating a target folder named after the domain name identifier in a first designated directory, decompressing the software package, and storing the decompressed package, which includes a homepage file, in the target folder. Next, a target domain name pointing to the homepage file is generated, containing the domain name identifier. A target configuration file named after the domain name identifier is also generated and stored in a second designated directory. This target configuration file triggers the resolution of the target domain name to retrieve the decompressed software package by accessing the page corresponding to the homepage file. Finally, the target domain name is output. Based on this, developers do not need to build their own servers; they only need to upload the software package to achieve automated deployment and obtain a publicly accessible domain name address for users to access the package. This effectively reduces the time and economic costs for developers and is less prone to errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116166281B_ABST
    Figure CN116166281B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computers, and provides a program package automatic deployment method and device, electronic equipment and a storage medium, which can effectively reduce the time cost and economic cost of developers and are not prone to errors. The method comprises the following steps: receiving a program package; generating a domain name identifier for the program package; creating a target folder with the domain name identifier in a first specified directory; decompressing the program package and storing the decompressed program package in the target folder, wherein the decompressed program package comprises a homepage file; generating a target domain name pointing to the homepage file, wherein the target domain name comprises the domain name identifier; generating a target configuration file with the domain name identifier and storing the target configuration file in a second specified directory, wherein the target configuration file is used for triggering resolution of the target domain name, so that the decompressed program package is obtained by accessing a page corresponding to the homepage file; and outputting the target domain name.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method, apparatus, electronic device, and storage medium for automated deployment of software packages. Background Technology

[0002] Current application package deployment solutions typically involve the following steps: 1. Register a domain name; 2. Apply for an SSL certificate; 3. Set up a private server or purchase cloud services; 4. Deploy the application package to the private server or purchased cloud services; 5. Perform reverse proxying (including SSL certificate deployment, domain name resolution, and other configurations) to enable the application package to be accessed on the public internet. Steps 1, 2, and 3 all require manual operation by developers, resulting in high time and financial costs. Furthermore, the entire process involves configuration on multiple platforms, making it complex and prone to errors due to manual operation. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide a method, apparatus, electronic device and storage medium for automated deployment of packages, which can effectively reduce the time and economic costs of developers and is less prone to errors.

[0004] In a first aspect, embodiments of the present invention provide a method for automated deployment of a software package, the method comprising:

[0005] Receive package;

[0006] Generate a domain name identifier for the package;

[0007] Create a target folder named after the domain name identifier in the first specified directory;

[0008] The program package is decompressed and stored in the target folder. The decompressed program package includes a homepage file.

[0009] Generate a target domain name that points to the homepage file, wherein the target domain name contains the domain name identifier;

[0010] Generate a target configuration file named after the domain name identifier and store it in the second specified directory. The target configuration file is used to trigger the resolution of the target domain name so as to obtain the decompressed program package by accessing the page corresponding to the homepage file.

[0011] Output the target domain name.

[0012] Preferably, the method further includes: receiving the target domain name input by the user; searching for the target configuration file under the second specified directory based on the domain name identifier contained in the target domain name; and executing the configuration file.

[0013] Preferably, after receiving the package, the method further includes storing the package in a third designated directory.

[0014] Preferably, before generating a domain name identifier for the package, the method further includes: verifying whether the format of the package is correct; if correct, generating a domain name identifier for the package.

[0015] In a second aspect, embodiments of the present invention provide an automated package deployment apparatus, the apparatus comprising:

[0016] The first receiving unit is used to receive program packets;

[0017] The first generation unit is used to generate a domain name identifier for the package;

[0018] A creation unit is used to create a target folder named after the domain name identifier in the first specified directory;

[0019] The decompression unit is used to decompress the program package and store the decompressed program package in the target folder. The decompressed program package includes a homepage file.

[0020] The second generation unit generates a target domain name that points to the homepage file, wherein the target domain name contains the domain name identifier;

[0021] The third generation unit is used to generate a target configuration file named after the domain name identifier and store it in the second specified directory. The target configuration file is used to trigger the resolution of the target domain name so as to obtain the decompressed program package by accessing the page corresponding to the homepage file.

[0022] The output unit is used to output the target domain name.

[0023] Preferably, the device further includes: a second receiving unit for receiving the target domain name input by a user; a searching unit for searching the target configuration file in the second specified directory based on the domain name identifier contained in the target domain name; and an execution unit for executing the configuration file.

[0024] Preferably, the device further includes a storage unit for storing the package in a third designated directory.

[0025] Preferably, the device further includes: a verification unit, used to verify whether the format of the package is correct; if correct, the first generation unit generates a domain name identifier for the package.

[0026] In a third aspect, embodiments of the present invention provide an electronic device, the electronic device comprising: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed within a space enclosed by the housing, and the processor and the memory are disposed on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the automated deployment method of the program package described in the first aspect above.

[0027] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement the automated deployment method of the package described in the first aspect.

[0028] This invention provides an automated deployment method, apparatus, electronic device, and storage medium for software packages. The method involves receiving a software package, generating a domain name identifier for the package, creating a target folder named after the domain name identifier in a first designated directory, decompressing the software package, and storing the decompressed package, which includes a homepage file, in the target folder. Next, a target domain name pointing to the homepage file is generated, containing the domain name identifier. A target configuration file named after the domain name identifier is also generated and stored in a second designated directory. This target configuration file triggers the resolution of the target domain name to retrieve the decompressed software package by accessing the page corresponding to the homepage file. Finally, the target domain name is output. Based on this, developers do not need to build their own servers; they only need to upload the software package to achieve automated deployment and obtain a publicly accessible domain name address for users to access the package. This effectively reduces the time and economic costs for developers and is less prone to errors. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 A schematic diagram of the structure of an automated package deployment system provided as an embodiment of the present invention;

[0031] Figure 2 A flowchart illustrating an automated package deployment method provided as an embodiment of the present invention;

[0032] Figure 3 A signaling flow diagram of an automated package deployment method provided as an embodiment of the present invention;

[0033] Figure 4 A schematic diagram of the structure of an automated package deployment device provided in an embodiment of the present invention;

[0034] Figure 5 This is a schematic diagram of the structure of an embodiment of the electronic device of the present invention. Detailed Implementation

[0035] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0036] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0037] This invention provides a system for automating the deployment of application packages. For example... Figure 1 As shown, the system includes an Nginx server 1 and Kubernetes software. The smallest / simplest basic unit for creating or deploying Kubernetes software is a Pod, where one Pod represents a running process. The automated deployment method for the application package provided in this embodiment can be implemented using a Pod that includes a Java interface and an Nginx server 2.

[0038] Figure 2 This is a flowchart illustrating an automated deployment method for a software package, provided as an embodiment of the present invention.

[0039] like Figure 2 As shown, the automated deployment method for program packages in this embodiment may include:

[0040] Step 201: Receive the program package.

[0041] In one example, the package could be a PWA package, which developers upload via the Pod's Java interface.

[0042] Preferably, the automated deployment method for the application package provided in this embodiment of the invention may further include: storing the application package in a third specified directory. Specifically, the third specified directory may be / tmp / in the Pod. Storing and backing up the application package facilitates troubleshooting by querying the application package in case of subsequent problems.

[0043] Step 202: Generate a domain name identifier for the package.

[0044] Preferably, before step 202, the automated deployment method for the program package provided in this embodiment of the invention may further include: verifying whether the format of the program package is correct; if correct, then proceeding to step 202; if incorrect, then ending the process or outputting a message indicating a format error. Specifically, verifying whether the format of the program package is correct may include: determining whether the program package includes a homepage file (index.html); if it includes it, then confirming it is correct; if it does not include it, then confirming it is incorrect.

[0045] Step 203: Create a target folder named after the domain name identifier in the first specified directory.

[0046] Specifically, the first specified directory can be / export / home / webroot / in the Pod. Assuming the domain name identifier generated in step 202 is sd0ewqsg0quj8ui7, then the path of the generated target folder is / export / home / webroot / sd0ewqsg0quj8ui7 / .

[0047] Step 204: Unzip the package and store the unzipped package in the target folder.

[0048] The unzipped package includes a homepage file.

[0049] Specifically, taking the example in step 203 as an example, unzip the program package to / export / home / webroot / sd0ewqsg0quj8ui7 / in the Pod.

[0050] Step 205: Generate a target domain name that points to the homepage file. The target domain name contains the domain name identifier.

[0051] Specifically, taking the example in step 203 as an example, the generated target domain name can be https:sd0ewqsg0quj8ui7.service.xxxxxx.com, where service.xxxxxx.com points to Nginx server 2.

[0052] Step 206: Generate a target configuration file named after the domain name identifier and store it in the second specified directory.

[0053] The target configuration file is used to trigger the resolution of the target domain name so that the decompressed program package can be obtained by accessing the page corresponding to the homepage file.

[0054] Specifically, the second specified directory can be / opt / openresty / nginx / conf / vhost / under Nginx server 2, and the configuration file can be sd0ewqsg0quj8ui7.conf. Nginx server 2 can be restarted to make the newly generated configuration file take effect.

[0055] Step 207: Output the target domain name.

[0056] Specifically, taking the example in step 203 as an example, the output target domain name is https:sd0ewqsg0quj8ui7.service.xxxxxx.com, so that users can obtain the decompressed program package through this domain name, thereby realizing the automated deployment of the program package.

[0057] Preferably, the automated deployment method for program packages provided in this embodiment of the invention may further include a method for a user to obtain the program package, specifically including: receiving a target domain name input by the user; searching for a target configuration file in a second specified directory based on the domain name identifier contained in the target domain name; and executing the configuration file.

[0058] Specifically, when a user needs to obtain the application package, they will enter the target domain name https: / / sd0ewqsg0quj8ui7.service.xxxxxx.com. Upon receiving the target domain name, Nginx server 1 first performs a first-level resolution, directing the access to Nginx server 2 inside the Kubernetes Pod based on *.service.xxxxxx.com. Nginx server 2 then resolves the target domain name and locates the deployment configuration file sd0ewqsg0quj8ui7.conf in the directory / opt / openresty / nginx / conf / vhost / . By triggering sd0ewqsg0quj8ui7.conf, the request for the target domain name is redirected to the homepage file index.html in the deployment package decompression directory / export / home / webroot / sd0ewqsg0quj8ui7. Thus, the user can obtain the decompressed application package by accessing the page corresponding to index.html.

[0059] The following specific example further illustrates the automated deployment method for program packages provided in this embodiment of the invention. For example... Figure 3 The diagram shown is a signaling flowchart of an automated package deployment method provided by an embodiment of the present invention. Specifically, it includes the following steps:

[0060] 1. Receive PWA source code packages uploaded by developers.

[0061] 2. Parse the contents of the source code package and verify that the project format is correct (e.g., whether it contains an index file and a manifest file). If correct, proceed to step 3. If incorrect, prompt the developer with a format error message.

[0062] 3. Upload the source code package to the specified directory / tmp / in the Pod.

[0063] 4. Generate a unique 16-digit domain name identifier, such as sd0ewqsg0quj8ui7

[0064] 5. Create a folder named sd0ewqsg0quj8ui7 under the Pod directory / export / home / webroot / , and extract the source code package to the / export / home / webroot / sd0ewqsg0quj8ui7 / directory.

[0065] 6. Based on the unique domain name identifier sd0ewqsg0quj8ui7 and the decompressed file directory, dynamically generate the Ngnix configuration file sd0ewqsg0quj8ui7.conf in the Pod, and point the dynamically generated third-level domain name to index.html in the decompressed directory / export / home / webroot / sd0ewqsg0quj8ui7.

[0066] The 7.java code executes a command to restart Ngnix in the Pod, making the Ngnix configuration effective. https: / / sd0ewqsg0quj8ui7.service.dingcloud.com is the third-level domain name of the project that can be accessed on the public network.

[0067] 8. Return the public domain name https:sd0ewqsg0quj8ui7.service.dingcloud.com as an output parameter to the developers.

[0068] By utilizing the automated deployment method for program packages provided in this embodiment of the invention, a program package is received, a domain name identifier is generated for the program package, a target folder named after the domain name identifier is created in a first designated directory, the program package is decompressed, and the decompressed program package, which includes a homepage file, is stored in the target folder. Then, a target domain name pointing to the homepage file is generated, the target domain name containing the domain name identifier, and a target configuration file named after the domain name identifier is generated and stored in a second designated directory. This target configuration file is used to trigger the resolution of the target domain name, so that the decompressed program package can be obtained by accessing the page corresponding to the homepage file; the target domain name is then output. Based on this, developers do not need to build their own servers; developers only need to upload the program package to achieve automated deployment of the program package and obtain a publicly accessible domain name address for users to obtain the program package, effectively reducing the time and economic costs for developers and minimizing errors.

[0069] Figure 4 This is a schematic diagram of the structure of an automated package deployment device provided in an embodiment of the present invention. Figure 4 As shown, the automated package deployment device in this embodiment may include:

[0070] The first receiving unit 401 is used to receive program packets;

[0071] The first generation unit 402 is used to generate a domain name identifier for the package;

[0072] Creation unit 403 is used to create a target folder named after the domain name identifier in the first specified directory;

[0073] The decompression unit 404 is used to decompress the program package and store the decompressed program package in the target folder. The decompressed program package includes a homepage file.

[0074] The second generation unit 405 generates a target domain name pointing to the homepage file, wherein the target domain name contains the domain name identifier;

[0075] The third generation unit 406 is used to generate a target configuration file named after the domain name identifier and store it in the second specified directory. The target configuration file is used to trigger the resolution of the target domain name so as to obtain the decompressed program package by accessing the page corresponding to the homepage file.

[0076] Output unit 407 is used to output the target domain name.

[0077] Preferably, the device further includes: a second receiving unit for receiving the target domain name input by a user; a searching unit for searching the target configuration file in the second specified directory based on the domain name identifier contained in the target domain name; and an execution unit for executing the configuration file.

[0078] Preferably, the device further includes a storage unit for storing the package in a third designated directory.

[0079] Preferably, the device further includes: a verification unit, used to verify whether the format of the package is correct; if correct, the first generation unit 302 generates a domain name identifier for the package.

[0080] By utilizing the automated deployment device for program packages provided in this embodiment of the invention, a program package is received, a domain name identifier is generated for the program package, a target folder named after the domain name identifier is created in a first designated directory, the program package is decompressed, and the decompressed program package, which includes a homepage file, is stored in the target folder. Then, a target domain name pointing to the homepage file is generated, the target domain name containing the domain name identifier, and a target configuration file named after the domain name identifier is generated and stored in a second designated directory. This target configuration file is used to trigger the resolution of the target domain name, so that the decompressed program package can be obtained by accessing the page corresponding to the homepage file; the target domain name is then output. Based on this, developers do not need to build their own servers; developers only need to upload the program package to achieve automated deployment of the program package and obtain a publicly accessible domain name address for users to obtain the program package, effectively reducing the time and economic costs for developers and minimizing errors.

[0081] This invention also provides an electronic device. Figure 5 This is a schematic diagram of the structure of an embodiment of the electronic device of the present invention, which can realize the present invention. Figure 2 The process of the illustrated embodiment is as follows: Figure 5 As shown, the above-mentioned electronic device may include: a housing 51, a processor 52, a memory 53, a circuit board 54, and a power supply circuit 55, wherein the circuit board 54 is disposed inside the space enclosed by the housing 51, and the processor 52 and the memory 53 are disposed on the circuit board 54; the power supply circuit 55 is used to supply power to various circuits or devices of the above-mentioned electronic device; the memory 53 is used to store executable program code; the processor 52 runs a program corresponding to the executable program code by reading the executable program code stored in the memory 53, for executing the method described in any of the foregoing embodiments.

[0082] This electronic device exists in various forms, including but not limited to:

[0083] (1) Mobile communication devices: These devices are characterized by their mobile communication capabilities and primarily aim to provide voice and data communication. These terminals include: smartphones (e.g., iPhones), multimedia phones, feature phones, and low-end phones, etc.

[0084] (2) Ultra-mobile personal computer devices: These devices fall under the category of personal computers, possessing computing and processing capabilities, and generally also have mobile internet access features. These terminals include PDAs, MIDs, and UMPCs, such as the iPad.

[0085] (3) Portable entertainment devices: These devices can display and play multimedia content. This category includes: audio and video playback modules (e.g., iPod), handheld game consoles, e-book readers, as well as smart toys and portable car navigation devices.

[0086] (4) Server: A device that provides computing services. The components of a server include a processor, hard disk, memory, system bus, etc. Servers are similar to general computer architectures, but because they need to provide highly reliable services, they have higher requirements in terms of processing power, stability, reliability, security, scalability, and manageability.

[0087] (5) Other electronic devices with data interaction functions.

[0088] This invention provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the methods described in any of the foregoing embodiments.

[0089] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0090] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0091] For ease of description, the above apparatus is described by dividing it into various functional units / modules. Of course, in implementing this invention, the functions of each unit / module can be implemented in one or more software and / or hardware.

[0092] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0093] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for automated deployment of software packages, characterized in that, The method includes: Receive package; Verify that the format of the package is correct; if correct, generate a domain name identifier for the package. Create a target folder named after the domain name identifier in the first specified directory; The program package is decompressed and stored in the target folder. The decompressed program package includes a homepage file. Generate a target domain name that points to the homepage file, wherein the target domain name contains the domain name identifier; Generate a target configuration file named after the domain name identifier and store it in the second specified directory. The target configuration file is used to trigger the resolution of the target domain name so as to obtain the decompressed program package by accessing the page corresponding to the homepage file. Output the target domain name; Receive the target domain name input by the user; The target configuration file is located in the second specified directory based on the domain name identifier contained in the target domain name; Execute the configuration file; After receiving the packet, the method further includes: The package is stored in a third designated directory to perform a backup of the package.

2. An automated deployment device for software packages, characterized in that, The device includes: The first receiving unit is used to receive program packets; The first generation unit is used to verify whether the format of the program package is correct; if it is correct, it generates a domain name identifier for the program package. A creation unit is used to create a target folder named after the domain name identifier in the first specified directory; The decompression unit is used to decompress the program package and store the decompressed program package in the target folder. The decompressed program package includes a homepage file. The second generation unit generates a target domain name that points to the homepage file, wherein the target domain name contains the domain name identifier; The third generation unit is used to generate a target configuration file named after the domain name identifier and store it in the second specified directory. The target configuration file is used to trigger the resolution of the target domain name so as to obtain the decompressed program package by accessing the page corresponding to the homepage file. Output unit, used to output the target domain name The second receiving unit is used to receive the target domain name input by the user; The search unit is configured to search for the target configuration file in the second specified directory based on the domain name identifier contained in the target domain name; An execution unit is used to execute the configuration file; The device further includes: A storage unit is used to store the program package in a third designated directory to perform storage backup of the program package.

3. An electronic device, characterized in that, The electronic device includes: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside the space enclosed by the housing, and the processor and the memory are disposed on the circuit board; the power supply circuit is used to supply power to various circuits or devices of the electronic device; the memory is used to store executable program code; the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for executing the automated deployment method of the program package as described in claim 1.

4. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the automated deployment method of the package as described in claim 1.