Application publishing method and apparatus, computer device and computer readable storage medium

By using a distributed, multi-layered scheduling algorithm to select Jenkins nodes and target servers, the problem of inflexible resource scheduling in centralized architectures is solved, thereby improving application deployment speed and resource utilization.

CN116980465BActive Publication Date: 2026-06-09CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TELECOM CORP LTD TECHNOLOGY INNOVATION CENTER
Filing Date
2023-07-06
Publication Date
2026-06-09

Smart Images

  • Figure CN116980465B_ABST
    Figure CN116980465B_ABST
Patent Text Reader

Abstract

The application relates to an application publishing method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: obtaining configuration information corresponding to a pipeline constructed for a to-be-published application; selecting a Jenkins node range for the to-be-published application according to the configuration information, wherein the Jenkins node range is a master node range or a slave node range; selecting a target Jenkins node for the to-be-published application from the selected Jenkins node range; selecting a target server for the to-be-published application according to the configuration information; obtaining a pipeline script file of the pipeline and a code file of the to-be-published application through the target Jenkins node, and publishing the code file in the form of an application on the target server according to the pipeline script file. The application can improve the application publishing speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an application publishing method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] With the development of computer technology, enterprise cloud services have emerged. Enterprise cloud migration refers to enterprises deploying their basic systems, management, and business operations to the cloud via the network, utilizing the network to more conveniently access computing, storage, software, and data services provided by cloud service providers, thereby improving resource allocation efficiency. Examples include migrating enterprise applications and systems to the cloud.

[0003] Traditional cloud deployment of applications is achieved through a centralized architecture. However, due to the surge in demand for cloud services, the centralized architecture cannot flexibly schedule resources when there are network problems or slow network speeds, which affects the efficiency of application deployment to the cloud. Summary of the Invention

[0004] Therefore, it is necessary to provide an application deployment method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the speed of application deployment in response to the above-mentioned technical problems.

[0005] Firstly, this application provides an application publishing method. The method includes:

[0006] Retrieve the configuration information corresponding to the pipeline built for the application to be released;

[0007] Select a Jenkins node range for the application to be published based on the configuration information, wherein the Jenkins node range is either a master node range or a slave node range.

[0008] Select the target Jenkins node for the application to be released from the selected range of Jenkins nodes;

[0009] Select a target server for the application to be published based on the configuration information;

[0010] Obtain the pipeline script file and the code file of the application to be released through the target Jenkins node, and release the code file as an application on the target server according to the pipeline script file.

[0011] Secondly, this application also provides an application publishing device. The device includes:

[0012] The acquisition module is used to obtain the configuration information corresponding to the pipeline built for the application to be released;

[0013] The range selection module is used to select a Jenkins node range for the application to be published based on the configuration information, wherein the Jenkins node range is either a master node range or a slave node range.

[0014] The node selection module is used to select a target Jenkins node for the application to be released from the selected range of Jenkins nodes;

[0015] The server selection module is used to select a target server for the application to be published based on the configuration information.

[0016] The deployment module is used to obtain the pipeline script file of the pipeline and the code file of the application to be deployed through the target Jenkins node, and deploy the code file as an application on the target server according to the pipeline script file.

[0017] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0018] Retrieve the configuration information corresponding to the pipeline built for the application to be released;

[0019] Select a Jenkins node range for the application to be published based on the configuration information, wherein the Jenkins node range is either a master node range or a slave node range.

[0020] Select the target Jenkins node for the application to be released from the selected range of Jenkins nodes;

[0021] Select a target server for the application to be published based on the configuration information;

[0022] Obtain the pipeline script file and the code file of the application to be released through the target Jenkins node, and release the code file as an application on the target server according to the pipeline script file.

[0023] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0024] Retrieve the configuration information corresponding to the pipeline built for the application to be released;

[0025] Select a Jenkins node range for the application to be published based on the configuration information, wherein the Jenkins node range is either a master node range or a slave node range.

[0026] Select the target Jenkins node for the application to be released from the selected range of Jenkins nodes;

[0027] Select a target server for the application to be published based on the configuration information;

[0028] Obtain the pipeline script file and the code file of the application to be released through the target Jenkins node, and release the code file as an application on the target server according to the pipeline script file.

[0029] Fifthly, this application also provides a computer program product. The computer program product includes a computer program, which, when executed by a processor, performs the following steps:

[0030] Retrieve the configuration information corresponding to the pipeline built for the application to be released;

[0031] Select a Jenkins node range for the application to be published based on the configuration information, wherein the Jenkins node range is either a master node range or a slave node range.

[0032] Select the target Jenkins node for the application to be released from the selected range of Jenkins nodes;

[0033] Select a target server for the application to be published based on the configuration information;

[0034] Obtain the pipeline script file and the code file of the application to be released through the target Jenkins node, and release the code file as an application on the target server according to the pipeline script file.

[0035] The aforementioned application deployment method, apparatus, computer equipment, storage medium, and computer program products, by acquiring the configuration information corresponding to the pipeline built for the application to be deployed, select a master node range or a slave node range as the Jenkins node range for the application to be deployed based on the configuration information. From the selected Jenkins node range, a target Jenkins node is chosen for the application to be deployed, ensuring that selecting a suitable Jenkins node for the deployment task helps reduce network transmission overhead. A target server is selected for the application to be deployed based on the configuration information to avoid excessive server load and achieve server load balancing. By obtaining the pipeline script files and the code files of the application to be deployed through the target Jenkins node, and deploying the code files as an application on the target server according to the pipeline script files, the execution speed of the pipeline, resource utilization, and application deployment speed can be effectively improved, thereby increasing the application deployment speed. Attached Figure Description

[0036] Figure 1 This is an application environment diagram of the publishing method used in one embodiment;

[0037] Figure 2 This is a flowchart illustrating the application of the publishing method in one embodiment;

[0038] Figure 3 This is a schematic diagram of the application architecture of a three-layer scheduling algorithm in one embodiment;

[0039] Figure 4 This is a comparative schematic diagram of the use of a center-side component and an edge-side component in one embodiment;

[0040] Figure 5 This is a schematic diagram comparing the performance of a three-layer scheduling algorithm in one embodiment;

[0041] Figure 6 This is a structural block diagram of an application publishing device in one embodiment;

[0042] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0044] The application publishing method provided in this application embodiment can be applied to, for example, Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on the cloud or other servers. Terminal 102 obtains the configuration information corresponding to the pipeline built for the application to be released. Based on the configuration information, terminal 102 selects a Jenkins node range for the application to be released, which can be either a master node range or a slave node range. From the selected Jenkins node range, a target Jenkins node is selected for the application to be released. Based on the configuration information, terminal 102 selects a target server 104 for the application to be released. Terminal 102 obtains the pipeline script file and the code file of the application to be released through the target Jenkins node, and releases the code file as an application on the target server 104 according to the pipeline script file. Terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart vehicle devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0045] In one embodiment, such as Figure 2 As shown, an application publishing method is provided, which is applied to computer devices (such as computer devices...) Figure 1 Taking a terminal or server as an example, the following steps are included:

[0046] Step 202: Obtain the configuration information corresponding to the pipeline built for the application to be released.

[0047] The configuration information refers to the pipeline's startup information, which can be the pipeline's startup parameters. Specifically, the configuration information may include at least one of the following: server type, tenant identifier, system identifier, application identifier of the application to be deployed, pipeline identifier, and pipeline branch identifier.

[0048] A pipeline refers to a group of executable events or jobs that are connected in sequence.

[0049] Specifically, the computer device identifies the application to be released and the pipeline to be built for the application. The computer device then obtains the configuration information corresponding to that pipeline.

[0050] In this embodiment, the computer device initiates a pipeline based on configuration information to perform relevant processing, thereby obtaining a pipeline instance. A pipeline instance refers to a record generated after the pipeline execution.

[0051] Step 204: Select the Jenkins node range for the application to be published based on the configuration information. The Jenkins node range can be either the master node range or the slave node range.

[0052] Jenkins is an open-source continuous integration tool developed in Java, and it is commonly used as the backend continuous integration tool in continuous integration systems. Continuous integration systems monitor code management tools through methods such as webhooks and send code information to the backend Jenkins continuous integration tool. Jenkins then uses pipeline scripts to automate building, code scanning, and testing during the development and testing process.

[0053] The master node range refers to the range of nodes on the central side, i.e., the range of Jenkins nodes on the central side. The slave node range refers to the range of nodes on the edge side, i.e., the range of Jenkins nodes on the edge side. Tenants are pre-divided into central and edge sides to allow them to follow the nearest node range.

[0054] Specifically, the computer device selects the Jenkins node range for the application to be released from the master node range and the slave node range based on the configuration information.

[0055] In this embodiment, the computer device selects the Jenkins node range that is closest to the application to be released from the master node range and the slave node range based on the configuration information.

[0056] Step 206: Select the target Jenkins node for the application to be released from the selected Jenkins node range.

[0057] Specifically, the Jenkins node scope includes multiple Jenkins nodes, and a computer device can select one of the multiple Jenkins nodes as the target Jenkins node for the application to be released.

[0058] In this embodiment, the computer device determines the load of each Jenkins node among multiple Jenkins nodes, and selects the Jenkins node with the lowest load as the target Jenkins node for the application to be released.

[0059] Step 208: Select a target server for the application to be published based on the configuration information.

[0060] The target server can be a cloud server.

[0061] Specifically, the configuration information includes the server type, the computer device identifies the servers belonging to that server type, and selects the target server for the application to be published from among the servers.

[0062] In this embodiment, the configuration information includes server type and tenant identifier. The computer device determines each server belonging to that server type, and selects a target server for the application to be published from among the servers based on the tenant identifier and the server identifier of each server.

[0063] Step 210: Obtain the pipeline script file and the code file of the application to be released through the target Jenkins node, and release the code file as an application on the target server according to the pipeline script file.

[0064] The pipeline script text describes the execution steps of the pipeline.

[0065] Specifically, the computer device retrieves the pipeline script text and the corresponding code files for the application to be released from the associated code repository through the target Jenkins node. The target server then runs application instances that build, package, and deploy container services according to the pipeline script, thereby releasing the code files as an application on the target server.

[0066] The aforementioned application deployment method is a distributed, multi-tiered scheduling approach. It obtains the configuration information corresponding to the pipeline built for the application to be deployed. Based on this configuration information, it selects a master node range or a slave node range as the Jenkins node range for the application to be deployed. From the selected Jenkins node range, it chooses the target Jenkins node for the application to be deployed. This ensures that the Jenkins node closest to the user's initiation point is selected to execute the deployment task, reducing network transmission overhead. It also selects a target server for the application to be deployed based on the configuration information to avoid excessive server load and achieve server load balancing. By obtaining the pipeline script files and the code files of the application to be deployed from the target Jenkins node, and deploying the code files as an application on the target server according to the pipeline script files, it effectively improves the pipeline execution speed, resource utilization, and application deployment speed, thereby increasing the application deployment speed.

[0067] In one embodiment, the configuration information includes a pipeline identifier; selecting a Jenkins node range for the application to be released based on the configuration information includes:

[0068] Retrieve the pipeline instance corresponding to the pipeline identifier; when a proxy relationship exists in the pipeline instance, select the range of slave nodes for the application to be released;

[0069] Select the target Jenkins node for the application to be released from the selected Jenkins node range, including: selecting the target Jenkins node for the application to be released from the Jenkins nodes included in the slave node range.

[0070] Specifically, the configuration information includes the identifier of the pipeline built for the application to be released, namely the pipeline identifier.

[0071] After the computer device starts the pipeline indicated by the pipeline identifier based on the configuration information, it obtains a pipeline instance. The computer device checks whether there is a proxy relationship in the pipeline instance. If there is a proxy relationship in the pipeline instance, it selects the slave node range as the Jenkins node range corresponding to the application to be released.

[0072] Within the scope of slave nodes, there are multiple Jenkins nodes. A computer device can select one of the multiple Jenkins nodes as the target Jenkins node for the application to be released.

[0073] In this embodiment, the computer device can select any one of the multiple Jenkins nodes from the range of slave nodes as the target Jenkins node.

[0074] Alternatively, the computer device can provide multiple Jenkins nodes from a range of nodes to the operation object, which can then select one as the target Jenkins node. This operation object is the one that triggers the release of the application to be published.

[0075] In this embodiment, the pipeline instance corresponding to the pipeline identifier is obtained to determine whether a proxy relationship exists in the pipeline. When a proxy relationship exists in the pipeline instance, it indicates that the distance to the central node range is far, and there is a usable edge node range. The deployment task of the application to be deployed needs to be assigned to a Jenkins node within the edge node range. In this case, a slave node range is selected for the application to be deployed. From the Jenkins nodes included in the slave node range, a target Jenkins node is selected for the application to be deployed, thereby selecting a Jenkins node that is more suitable for handling the deployment task and improving the application's deployment speed.

[0076] In one embodiment, the method further includes:

[0077] When there is no proxy relationship in the pipeline instance, select the master node range for the application to be released; select the target Jenkins node for the application to be released from the Jenkins nodes included in the master node range.

[0078] Specifically, after the computer device starts the pipeline indicated by the pipeline identifier based on the configuration information, it obtains a pipeline instance. The computer device checks whether there is a proxy relationship in the pipeline instance. If there is no proxy relationship in the pipeline instance, it selects the master node range as the Jenkins node range corresponding to the application to be released.

[0079] The master node includes multiple Jenkins nodes, and a computer device can select one of the multiple Jenkins nodes as the target Jenkins node for the application to be released.

[0080] In this embodiment, the computer device can select any one of the multiple Jenkins nodes within the master node range as the target Jenkins node.

[0081] Alternatively, the computer device can provide multiple Jenkins nodes within the master node range to the target, which can then select one as the target Jenkins node.

[0082] In this embodiment, the pipeline instance corresponding to the pipeline identifier is obtained to determine whether a proxy relationship exists in the pipeline. When no proxy relationship exists in the pipeline instance, it indicates that it is close to the node range on the central side. In this case, a master node range is selected for the application to be released. From the Jenkins nodes included in the master node range, a target Jenkins node is selected for the application to be released. This allows for the selection of a Jenkins node that is more suitable for handling the release task, thereby improving the application's deployment speed.

[0083] In one embodiment, the configuration information includes the server type; selecting a target server for the application to be published based on the configuration information includes:

[0084] Query the load information of each server belonging to the server type; filter out the allocable servers whose load information meets the load conditions from each server; select the target server for the application to be deployed from the allocable servers.

[0085] The server type can be the server's CPU (Central Processing Unit) type, such as the x86 type or the ARM (Advanced RISC Machine) type.

[0086] Load information includes the server's load level, and load conditions include load thresholds. Load conditions are met when the server's load level is less than or equal to the load threshold. Load conditions are not met when the server's load level is greater than the load threshold.

[0087] Specifically, the configuration information includes server type, computer equipment identifies each server belonging to the server type, and determines the load information for each server.

[0088] The computer equipment obtains load conditions, matches the load information of each server with the load conditions, filters out the load information that meets the load conditions, and designates the servers corresponding to the load information that meet the load conditions as allocable servers. The computer equipment then selects a target server from the allocable servers for the application to be deployed.

[0089] For example, with a load threshold of 85%, the computer queries the load of each server. If a server's load exceeds 85%, that server is set to unallocable, and a list of servers with loads less than or equal to 85% is generated. All servers in this list are then allocable. Target servers are selected from this list for the application to be deployed.

[0090] In this embodiment, any one of the allocatable services in the server list can be selected as the target server for the application to be published.

[0091] In this embodiment, the server with the lowest load can also be selected from the list of all available services as the target server for the application to be published.

[0092] In this embodiment, the server types for executing the deployment task of the application to be deployed are pre-configured. The load information of each server belonging to that server type is queried to determine the load status of each server within that server type. From these servers, allocable servers whose load information meets the load conditions are selected. An allocable server represents an executor capable of executing the deployment task, thereby enabling the selection of the most suitable target server for the application to be deployed from among the allocable servers, accelerating the scheduling of the application's execution nodes. Furthermore, the required server types can be configured, ensuring compatibility with server resources of different CPU types.

[0093] In one embodiment, the configuration information further includes a tenant identifier; and before querying the load information of each server belonging to the server type, it also includes:

[0094] Under the server type, detect the server identifier associated with the tenant identifier; when the tenant identifier does not have an associated server identifier, execute the step of querying the load information of each server belonging to the server type; when the tenant identifier has an associated server identifier, and the load information of the server indicated by the server identifier does not meet the load conditions, execute the step of querying the load information of each server belonging to the server type.

[0095] Specifically, the computer device obtains the tenant identifier and server type, and determines whether the tenant identifier is associated with a server identifier belonging to that server type, that is, it detects whether the tenant identifier is associated with a server identifier under that server type.

[0096] When a tenant identifier does not have an associated server identifier, the computer device identifies the servers belonging to that server type and determines the load information for each server. The computer device obtains load conditions, filters out load information that meets the conditions, and designates the servers corresponding to these load conditions as available servers. The computer device then selects a target server from these available servers for the application to be deployed.

[0097] When a tenant identifier has an associated server identifier, the load information of the server indicated by that server identifier is obtained. The load information of the server indicated by the server identifier is matched against load conditions. If the load information of the server indicated by the server identifier does not meet the load conditions, the load information of each of the remaining servers belonging to the same server type, excluding the server indicated by the server identifier, is queried. The computer device then selects servers from the remaining servers whose load information meets the load conditions as allocable servers. Finally, the computer device selects a target server from the allocable servers for the application to be deployed.

[0098] In this embodiment, after the computer device filters out each allocatable server, it selects a target server for the application to be published from the allocatable servers based on the server identifier and tenant identifier of each allocatable server. Further, the computer device determines the number of servers in each allocatable server set, and selects a target server for the application to be published from the allocatable servers based on the number of servers, the server identifier and tenant identifier of each allocatable server.

[0099] For example, the computer device determines the remainder obtained by dividing the tenant identifier by the number of servers, identifies the server identifiers among the allocable servers that have the same remainder, and uses the server identifiers with the same remainder as the target servers for the application to be published. The server identifier of the target server is then bound to the tenant identifier to associate the target server with the tenant identifier.

[0100] In this embodiment, the server type and tenant identifier for executing the deployment task of the application to be deployed are pre-configured. Under the server type, it is detected whether there is a server identifier associated with the tenant identifier.

[0101] When a tenant identifier does not have an associated server identifier, the process involves querying the load information of each server belonging to that server type to select a suitable target server for the publishing task based on its load. When a tenant identifier has an associated server identifier, but the load information of the server indicated by that server identifier does not meet the load criteria, the process involves querying the load information of each server belonging to that server type to select a suitable target server for the publishing task from unassociated servers of that server type based on their load. Furthermore, processing methods are provided for both the existence of associated server identifiers and the presence of tenant identifiers, enabling appropriate handling for various situations, adapting to different scenarios, and better meeting diverse needs.

[0102] In one embodiment, the method further includes:

[0103] When a tenant identifier has an associated server identifier, and the load information of the server indicated by the server identifier meets the load conditions, the server indicated by the server identifier will be used as the target server for the application to be published.

[0104] Specifically, when a tenant identifier has an associated server identifier, the load information of the server indicated by that server identifier is obtained. The load information of the server indicated by the server identifier is matched with the load conditions. If the load information of the server indicated by the server identifier meets the load conditions, the server indicated by the server identifier is used as the target server for the application to be published.

[0105] For example, if the load threshold is 85%, the computer device queries the load of the server indicated by the associated server identifier of the tenant identifier. When the load of the server is less than or equal to 85%, the server is used as the target server for the application to be published.

[0106] In this embodiment, when a tenant identifier has an associated server identifier, and the load information of the server indicated by the server identifier meets the load conditions, the server indicated by the server identifier is given priority as the target server corresponding to the application to be published. This allows the target server to be quickly determined based on the association, server load, and caching status, effectively improving the deployment execution speed.

[0107] In one embodiment, selecting a target server for the application to be published from the available servers includes:

[0108] When there is one available server, the available server is used as the target server for the application to be published; when there are multiple available servers, the target server for the application to be published is determined based on the tenant identifier, the server identifiers of the multiple available servers, and the number of servers.

[0109] Specifically, after the computer equipment filters out the available services, if there is one available server, that available server is used as the target server for the application to be published. If there are multiple available servers, the computer equipment determines the number of servers for each available server, and selects a target server for the application to be published from among the available servers based on the number of servers, the server identifier and tenant identifier of each available server.

[0110] For example, computer devices calculate the target server for the application to be published by performing a modulo operation, i.e., "the server ID of the target server = the tenant ID % the number of servers under this server type".

[0111] In this embodiment, when there is one allocable server, it is used as the target server for the application to be published. This allows for rapid determination and allocation of available servers based on server load, thus facilitating fast execution of the publishing task. When multiple allocable servers exist, the most suitable target server is selected for the application to be published based on the tenant identifier, the server identifiers of the multiple allocable servers, and the number of servers. This ensures load balancing across servers, accelerating the scheduling of application execution nodes and improving server resource utilization.

[0112] In one embodiment, an application publishing method is provided, applied to a computer device, comprising:

[0113] Retrieve the configuration information corresponding to the pipeline built for the application to be released; the configuration information includes pipeline identifier, server type and tenant identifier.

[0114] Next, obtain the pipeline instance corresponding to the pipeline identifier; when there is a proxy relationship in the pipeline instance, select the range of slave nodes for the application to be released; from the Jenkins nodes included in the range of slave nodes, select the target Jenkins node for the application to be released.

[0115] Furthermore, when there is no proxy relationship in the pipeline instance, a master node range is selected for the application to be released; from the Jenkins nodes included in the master node range, a target Jenkins node is selected for the application to be released.

[0116] Next, under server type, check if there is a server identifier associated with the tenant identifier.

[0117] Furthermore, when the tenant identifier does not have an associated server identifier, the load information of each server belonging to the server type is queried; from each server, the allocatable servers whose load information meets the load conditions are selected; when there is one allocatable server, the allocatable server is used as the target server corresponding to the application to be published; when there are multiple allocatable servers, the target server corresponding to the application to be published is determined according to the tenant identifier, the server identifiers of the multiple allocatable servers and the number of servers.

[0118] Optionally, when a tenant identifier has an associated server identifier, and the load information of the server indicated by the server identifier does not meet the load conditions, the load information of each of the servers belonging to the server type, excluding the associated server, is queried; from the remaining servers, allocable servers whose load information meets the load conditions are selected; when there is one allocable server, the allocable server is used as the target server corresponding to the application to be published; when there are multiple allocable servers, the target server corresponding to the application to be published is determined according to the tenant identifier, the server identifiers of the multiple allocable servers, and the number of servers.

[0119] Optionally, when a tenant identifier has an associated server identifier, and the load information of the server indicated by the server identifier meets the load conditions, the server indicated by the server identifier is used as the target server for the application to be published.

[0120] Furthermore, the pipeline script files and the code files of the application to be released are obtained through the target Jenkins node, and the code files are released as applications on the target server according to the pipeline script files.

[0121] In one embodiment, the application deployment method is primarily implemented through a distributed three-layer scheduling algorithm.

[0122] like Figure 3 The diagram shows the application architecture of the three-layer scheduling algorithm, and the processing procedure is as follows:

[0123] To start the pipeline, input the following startup parameters: CPU type, tenant ID, system ID, application ID, pipeline ID, and pipeline branch name. CPU type is the server type, tenant ID is the tenant identifier, application ID is the application identifier of the application to be released, and pipeline ID is the identifier of the pipeline built by the application to be released.

[0124] Retrieve the pipeline instance by pipeline ID.

[0125] Assigning Jenkins node ranges to the execution pipeline based on the application ID, i.e., selecting Jenkins node ranges for the application ID, including:

[0126] If the pipeline instance contains a proxy, then the Jenkins node range of the nearest edge-side tenant is selected based on the proxy relationship for the application ID. The presence of a proxy in the pipeline instance indicates the existence of a Jenkins node range on the edge side.

[0127] If the pipeline instance does not contain an agent, the application ID is selected from the range of Jenkins nodes on the central side.

[0128] Manually select a Jenkins node within the chosen Jenkins node range, and pull the pipeline script file jenkinsFile and code files from the GitLab repository associated with the Jenkins node.

[0129] The tenant ID is used to query the association table to determine whether an associated server ID exists, including both cases where the server ID exists and cases where the server ID does not exist.

[0130] In the first scenario, if the server ID does not exist, different servers are selected based on the CPU type and tenant ID:

[0131] If a tenant ID does not have an associated server ID, and the server's CPU type is x86, the API is called to query the load status of all x86 servers. Servers with a load > 85% are set to unallocable, and a list of allocatable x86 servers is obtained. The associated server ID of the tenant ID is determined from the server list according to the calculation method of "associated server ID = tenant ID % number of servers of this type". This associated server ID is the target server for the application to be deployed. If there is a server with a load <= 85%, this server is used as the associated server ID of the tenant ID. If there are multiple servers with a load <= 85%, the associated server ID of the tenant ID is determined from the server list according to the calculation method of "associated server ID = tenant ID % number of servers of this type".

[0132] If a tenant ID does not have an associated server ID, and the server's CPU type is ARM, the API is called to query the load status of all ARM servers. Nodes with a load > 85% are set to unallocable, and a list of divisible ARM server nodes is obtained. The associated server ID of the tenant ID is determined from the server list according to the calculation method of "associated server ID = tenant ID % number of servers of this type". This associated server ID is the target server for the application to be deployed. If there is a server with a load <= 85%, this server is used as the associated server ID of the tenant ID. If there are multiple servers with a load <= 85%, the associated server ID of the tenant ID is determined from the server list according to the calculation method of "associated server ID = tenant ID % number of servers of this type".

[0133] In the second scenario, if the server ID exists, the API is called to query the load status of each server under that server type, and different servers are selected based on the load status:

[0134] If the server load indicated by the associated server ID is >85%, then the server is set to unallocatable; obtain a list of divisible ARM server nodes, and determine the associated server ID of the tenant ID from the server list according to the calculation method of "associated server ID = tenant ID % number of servers of this type"; if there is a server with a load <= 85%, use that server as the associated server ID of the tenant ID; if there are multiple servers with a load <= 85%, determine the associated server ID of the tenant ID from the server list according to the calculation method of "associated server ID = tenant ID % number of servers of this type".

[0135] If the server load is less than 85%, the associated server ID will be returned, which will be used as the target server for the application to be published.

[0136] Output the association between tenant ID and server ID, that is, bind the tenant ID to the determined server ID.

[0137] Calling the Jenkins API uses the Jenkins file in the pipeline to execute the pipeline job on the specified target Jenkins node. On the target server indicated by the corresponding server ID, namely CCSE (Container Cloud Service Engine), an application instance that builds, packages, and deploys container services is run, enabling the code to be transformed into an application and released on the cloud platform using DevOps' distributed pipeline tools.

[0138] Application examples for building container services include downloading and uploading binary deployment packages from artifactocry (binary storage management tools); application examples for packaging container services include downloading base images from Harbor (image repository) and packaging the deployment packages into application images using Docker files; and application examples for deploying container services include deploying and publishing images.

[0139] In this embodiment, an application deployment method based on a three-layer scheduling algorithm and distributed architecture pipeline design is applied to a distributed pipeline architecture for large-scale application cloud deployment. The first layer of scheduling selects the edge Jenkins node closest to the user based on distance, using edge Jenkins nodes to run jobs in a distributed architecture, which helps reduce network transmission losses. The second layer of scheduling selects the execution node from a range of servers with different CPU types based on CPU type, effectively adapting to and being compatible with different types of domestic servers. The third layer of scheduling selects the execution node for application deployment based on server load and caching conditions, i.e., selecting the target server, effectively improving deployment execution speed. This three-layer scheduling achieves a distributed architecture pipeline design, effectively solving the problem of unreasonable resource utilization in distributed architectures. Furthermore, the distributed deployment of the Jenkins cluster effectively improves pipeline high availability, and the scheduling algorithm effectively improves pipeline execution speed and resource utilization, avoiding excessive server load.

[0140] like Figure 4 As shown, the application deployment method in this embodiment can be applied to cloud platforms. Company A's container server engine (CCSE) cluster within its province has already built an image repository (Harbor) component and newly deployed three components: a security engine, Jenkins, and a binary storage management tool (jfrog artifactory). This provides the component shards required for the pipeline at the edge, effectively adding pipeline components at the edge. Simultaneously, new tenants are added at the edge, associating them with components within the province. This ensures that Jenkins packaging queues only within Chongqing, and Harbor image synchronization queues only within the province, significantly increasing the province's autonomy and controllability, greatly improving packaging and deployment efficiency, and accelerating system migration to the cloud and application deployment.

[0141] like Figure 4 The first line indicates that before the three-layer scheduling algorithm was used, Company A used central-side components and resources to execute application deployment tasks. The second line indicates that after adding the three-layer scheduling algorithm, Company A used edge-side components and resources to execute application deployment tasks, effectively improving application deployment speed.

[0142] The application and deployment effects of the three-level scheduling algorithm are as follows: Figure 5 The image shows the comparison results obtained from tests conducted during idle and busy periods when using the corresponding code to execute application deployment tasks, using components and resources from both the central and edge sides for building and packaging. Figure 5 As can be seen, the application deployment method in this embodiment improves build efficiency by 1.94 times during off-peak hours and by 1.88 times during peak hours, demonstrating a significant improvement in processing efficiency. The efficiency calculation formula is as follows:

[0143]

[0144] Where x represents the task to be executed, such as building, packaging, and synchronizing; T1 and T2 represent the execution time for the first and second executions, respectively; and f represents efficiency.

[0145] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0146] Based on the same inventive concept, this application also provides an application publishing apparatus for implementing the application publishing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more application publishing apparatus embodiments provided below can be found in the limitations of the application publishing method described above, and will not be repeated here.

[0147] In one embodiment, such as Figure 6 As shown, an application publishing device 600 is provided, including:

[0148] The acquisition module 602 is used to acquire the configuration information corresponding to the pipeline built for the application to be released.

[0149] The range selection module 604 is used to select the Jenkins node range for the application to be published based on the configuration information. The Jenkins node range can be either the master node range or the slave node range.

[0150] The node selection module 606 is used to select the target Jenkins node for the application to be released from the selected range of Jenkins nodes.

[0151] Server selection module 608 is used to select a target server for the application to be published based on the configuration information.

[0152] The deployment module 610 is used to obtain the pipeline script files and the code files of the application to be deployed from the target Jenkins node, and deploy the code files as an application on the target server according to the pipeline script files.

[0153] In this embodiment, by obtaining the configuration information corresponding to the pipeline built for the application to be released, a master node range or a slave node range is selected as the Jenkins node range for the application to be released based on the configuration information. From the selected Jenkins node range, a target Jenkins node is chosen for the application to be released, ensuring that selecting a suitable Jenkins node to execute the release task helps reduce network transmission losses. A target server is selected for the application to be released based on the configuration information to avoid excessive server load and achieve server load balancing. The pipeline script files and the code files of the application to be released are obtained through the target Jenkins node. The code files are then released as an application on the target server according to the pipeline script files, effectively improving the pipeline execution speed, resource utilization, and application deployment speed.

[0154] In one embodiment, the range selection module 604 is further configured to obtain the pipeline instance corresponding to the pipeline identifier; when there is a proxy relationship in the pipeline instance, the range of slave nodes is selected for the application to be released.

[0155] The node selection module 606 is also used to select a target Jenkins node for the application to be released from the Jenkins nodes included in the slave node range.

[0156] In this embodiment, the pipeline instance corresponding to the pipeline identifier is obtained to determine whether a proxy relationship exists in the pipeline. When a proxy relationship exists in the pipeline instance, it indicates that the distance to the central node range is far, and there is a usable edge node range. The deployment task of the application to be deployed needs to be assigned to a Jenkins node within the edge node range. In this case, a slave node range is selected for the application to be deployed. From the Jenkins nodes included in the slave node range, a target Jenkins node is selected for the application to be deployed, thereby selecting a Jenkins node that is more suitable for handling the deployment task and improving the application's deployment speed.

[0157] In one embodiment, the node selection module 606 is used to select a range of main nodes for the application to be released when there is no proxy relationship in the pipeline instance;

[0158] The node selection module 606 is also used to select a target Jenkins node for the application to be released from the Jenkins nodes included in the master node scope.

[0159] In this embodiment, the pipeline instance corresponding to the pipeline identifier is obtained to determine whether a proxy relationship exists in the pipeline. When no proxy relationship exists in the pipeline instance, it indicates that it is close to the node range on the central side. In this case, a master node range is selected for the application to be released. From the Jenkins nodes included in the master node range, a target Jenkins node is selected for the application to be released. This allows for the selection of a Jenkins node that is more suitable for handling the release task, thereby improving the application's deployment speed.

[0160] In one embodiment, the server selection module 608 is further configured to query the load information of each server belonging to the server type; filter out allocable servers whose load information meets the load conditions from each server; and select a target server for the application to be published from the allocable servers.

[0161] In this embodiment, the server types for executing the deployment task of the application to be deployed are pre-configured. The load information of each server belonging to that server type is queried to determine the load status of each server within that server type. From these servers, allocable servers whose load information meets the load conditions are selected. An allocable server represents an executor capable of executing the deployment task, thereby enabling the selection of the most suitable target server for the application to be deployed from among the allocable servers, accelerating the scheduling of the application's execution nodes. Furthermore, the required server types can be configured, ensuring compatibility with server resources of different CPU types.

[0162] In one embodiment, the server selection module 608 is further configured to detect, under the server type, a server identifier associated with the tenant identifier; when the tenant identifier does not have an associated server identifier, execute the step of querying the load information of each server belonging to the server type; when the tenant identifier has an associated server identifier, and the load information of the server indicated by the server identifier does not meet the load conditions, execute the step of querying the load information of each server belonging to the server type.

[0163] In this embodiment, the server type and tenant identifier for executing the deployment task of the application to be deployed are pre-configured. Under the server type, it is detected whether there is a server identifier associated with the tenant identifier.

[0164] When a tenant identifier does not have an associated server identifier, the process involves querying the load information of each server belonging to that server type to select a suitable target server for the publishing task based on its load. When a tenant identifier has an associated server identifier, but the load information of the server indicated by that server identifier does not meet the load criteria, the process involves querying the load information of each server belonging to that server type to select a suitable target server for the publishing task from unassociated servers of that server type based on their load. Furthermore, processing methods are provided for both the existence of associated server identifiers and the presence of tenant identifiers, enabling appropriate handling for various situations, adapting to different scenarios, and better meeting diverse needs.

[0165] In one embodiment, the server selection module 608 is further configured to, when a tenant identifier has an associated server identifier and the load information of the server indicated by the server identifier meets the load conditions, use the server indicated by the server identifier as the target server corresponding to the application to be published.

[0166] In this embodiment, when a tenant identifier has an associated server identifier, and the load information of the server indicated by the server identifier meets the load conditions, the server indicated by the server identifier is given priority as the target server corresponding to the application to be published. This allows the target server to be quickly determined based on the association, server load, and caching status, effectively improving the deployment execution speed.

[0167] In one embodiment, the server selection module 608 is further configured to, when there is an allocable server, use the allocable server as the target server corresponding to the application to be published; when there are multiple allocable servers, determine the target server corresponding to the application to be published based on the tenant identifier, the server identifiers of the multiple allocable servers, and the number of servers.

[0168] In this embodiment, when there is one allocable server, it is used as the target server for the application to be published. This allows for rapid determination and allocation of available servers based on server load, thus facilitating fast execution of the publishing task. When multiple allocable servers exist, the most suitable target server is selected for the application to be published based on the tenant identifier, the server identifiers of the multiple allocable servers, and the number of servers. This ensures load balancing across servers, accelerating the scheduling of application execution nodes and improving server resource utilization.

[0169] Each module in the aforementioned application publishing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0170] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores application deployment data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements an application deployment method.

[0171] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0172] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0173] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0174] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0175] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0176] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0177] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0178] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. An application deployment method, characterized in that, The method includes: Obtain the configuration information corresponding to the pipeline built for the application to be released; the configuration information includes pipeline identifier and server type; Obtain the pipeline instance corresponding to the pipeline identifier; When there is no proxy relationship in the pipeline instance, select the range of Jenkins nodes of the central tenant for the application to be released, and select the target Jenkins node for the application to be released from the Jenkins nodes included in the range of Jenkins nodes of the central tenant. When a proxy relationship exists in the pipeline instance, select the range of Jenkins nodes of the edge tenant for the application to be released, and select the target Jenkins node for the application to be released from the Jenkins nodes included in the range of Jenkins nodes of the edge tenant. Select a target server for the application to be published based on the server type; Obtain the pipeline script file and the code file of the application to be released through the target Jenkins node, and release the code file as an application on the target server according to the pipeline script file.

2. The method according to claim 1, characterized in that, The step of selecting a target server for the application to be published based on the configuration information includes: Query the load information of each server belonging to the specified server type; From all the servers, select the allocatable servers whose load information meets the load conditions; Select a target server for the application to be published from the available servers.

3. The method according to claim 2, characterized in that, The configuration information also includes a tenant identifier; before querying the load information of each server belonging to the server type, it also includes: Under the server type, detect the server identifier associated with the tenant identifier; When the tenant identifier does not have an associated server identifier, the step of querying the load information of each server belonging to the server type is executed; When the tenant identifier has an associated server identifier, and the load information of the server indicated by the server identifier does not meet the load conditions, the step of querying the load information of each server belonging to the server type is executed.

4. The method according to claim 3, characterized in that, The method further includes: When the tenant identifier has an associated server identifier, and the load information of the server indicated by the server identifier meets the load condition, the server indicated by the server identifier is used as the target server corresponding to the application to be published.

5. The method according to claim 3, characterized in that, The step of selecting a target server for the application to be published from the allocable servers includes: When an allocatable server exists, the allocatable server is used as the target server for the application to be published. When multiple allocable servers exist, the target server corresponding to the application to be published is determined based on the tenant identifier, the server identifier of the multiple allocable servers, and the number of servers.

6. An application publishing device, characterized in that, The device includes: The acquisition module is used to acquire configuration information corresponding to the pipeline built for the application to be released; the configuration information includes pipeline identifier and server type; The range selection module is used to obtain the pipeline instance corresponding to the pipeline identifier; when there is no proxy relationship in the pipeline instance, the Jenkins node range of the central tenant is selected for the application to be released; The node selection module is used to select a target Jenkins node for the application to be released from the Jenkins nodes included in the Jenkins node range of the central tenant; when there is a proxy relationship in the pipeline instance, it selects the Jenkins node range of the edge tenant for the application to be released, and selects a target Jenkins node for the application to be released from the Jenkins nodes included in the Jenkins node range of the edge tenant. The server selection module is used to select a target server for the application to be published based on the configuration information. The deployment module is used to obtain the pipeline script file of the pipeline and the code file of the application to be deployed through the target Jenkins node, and deploy the code file as an application on the target server according to the pipeline script file.

7. The apparatus according to claim 6, characterized in that, The server selection module is further configured to, when there is an allocable server, use the allocable server as the target server corresponding to the application to be published; when there are multiple allocable servers, determine the target server corresponding to the application to be published based on the tenant identifier, the server identifier of the multiple allocable servers and the number of servers.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.