A method and device for managing application code package versions

By conducting standardized detection and fingerprint generation of application code packages, and determining the target code repository with node information, realizing nearby storage and deployment, it solves the problem of version rollback and transmission efficiency in application code package management, and improves deployment efficiency and release speed.

CN114115910BActive Publication Date: 2025-08-19E-SURFING DIGITAL LIFE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111407747.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-24
Publication Date
2025-08-19
Estimated Expiration
2041-11-24

AI Technical Summary

Technical Problem

In the prior art, the management of application code packages lacks records, which leads to difficulty in rolling back versions, lack of direct deployment packages during capacity expansion, and low transmission efficiency, affecting the efficiency of service iteration release.

Method used

By conducting standardized detection of application code packages, unique fingerprint information is generated, and target code repository is determined based on node information, nearby storage and deployment are realized, and network transmission paths are optimized.

Benefits of technology

Improve the deployment efficiency of application code packages, shorten the upgrade release time, and solve the problems of version management and transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114115910B_ABST
    Figure CN114115910B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for managing application code package versions, including: performing a normative test on the application code packages to be stored; for the application code packages that have passed the test, generating fingerprint information based on the application information, version number, upload time, and file size in the application code packages; obtaining node information of each node where the application code package needs to be deployed from a preset configuration management database based on the application information; determining at least one target code repository based on the node information of each node, and sending the application code package carrying the fingerprint information to the target code repository. By pre-storing the application code packages that have passed the test in the target code repository of each node where the application code package needs to be deployed, each node can schedule the application code package nearby, thereby improving the deployment efficiency of the application code package and shortening the upgrade and release time of the application code package.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a method and device for managing application code package versions. Background Art

[0002] In recent years, with the continued advancement of the DevOps (Development Operations) concept, internet companies have been building automated operations and maintenance pipelines for products and services based on "continuous integration and continuous release" to ensure the on-time delivery of software products and services. However, with the improvement of software development efficiency and the shortening of development cycles, code version management issues have become increasingly prominent.

[0003] Existing software version management often focuses solely on version management during the R&D process, enabling software version control during development through platforms or tools such as GIT and SVN. However, the management of each application code package released online is often overlooked, leading to the following situations: 1. The R&D version number of the source code has been iteratively updated multiple times, but there is no record of the application code package's previous versions, the environments it was released in, or the nodes it was deployed on. 2. When an issue arises with the online application code package and a rollback is required, it is difficult to determine the last deployed version number for the current environment or node. 3. When rapid service expansion is required, there is no readily available application code package for deployment. These scenarios highlight the importance of application code package management in product delivery services.

[0004] In addition, during service deployment, upgrades, expansion, rollback and other operations, the transmission efficiency of application code packages also directly affects the efficiency of service iterative release. Therefore, how to solve the transmission rate problem of application code packages in the network during construction is also a major problem faced in the automation construction process. Summary of the Invention

[0005] In view of this, the present application provides a method and apparatus for managing application code package versions to improve the transmission efficiency of application code packages.

[0006] To achieve the above objectives, the first aspect of the present application provides an application code package version management method, including:

[0007] Performing a compliance test on the application code package to be stored to obtain a test result, wherein the test result includes whether the application code package passes the test;

[0008] For the application code package that passes the detection, fingerprint information is generated based on the application information, version number, upload time, and file size in the application code package;

[0009] According to the application information, node information of each node where the application code package needs to be deployed is obtained from a preset configuration management database;

[0010] At least one target code repository is determined according to the node information of each node, and the application code package carrying the fingerprint information is sent to the target code repository.

[0011] Preferably, the process of determining at least one target code repository based on the node information of each node includes:

[0012] For each of the nodes:

[0013] Obtaining a candidate code repository list according to the node information of the node, the candidate code repository list including at least one candidate code repository;

[0014] Obtain the network type, effective bandwidth, storage space size, and number of routing hops from the node to each candidate code repository for each candidate code repository;

[0015] The target code repository of the node is determined according to the network type, effective bandwidth, storage space size, and the number of routing hops from the node to each candidate code repository.

[0016] Preferably, the process of determining the target code repository of the node according to the network type, effective bandwidth, storage space size, and the number of routing hops from the node to each candidate code repository includes:

[0017] For each code repository, the priority of the code repository is calculated using the following formula:

[0018]

[0019] in, is the network environment coefficient determined by the network type, is the number of routing hops from the node to the candidate code repository, is the routing attenuation coefficient determined by the network type, is the effective bandwidth, is the storage space size;

[0020] The candidate code repository with the highest priority is determined as the target code repository.

[0021] Preferably, the process of performing compliance testing on the application code package to be stored includes:

[0022] Detecting whether a file format of the application code package matches a type of service carried by the application code package;

[0023] Check whether the naming method of the application code package complies with the preset naming specification;

[0024] Checking whether the directory structure of the application code package complies with a preset directory structure specification;

[0025] Check whether the application code package is not in a locked state.

[0026] Preferably, the process of sending the application code package carrying the fingerprint information to the target code repository includes:

[0027] Notify the node agent of the node where the target code repository is located, and have the node agent pull the application code package carrying the fingerprint information, and push the application code package carrying the fingerprint information to the target code repository.

[0028] Preferably, after generating the fingerprint information, the method further includes:

[0029] The application code package carrying the fingerprint information is sent to a backup warehouse, and the backup warehouse is used to store all application code packages that have passed the detection in a backup form.

[0030] Preferably, it also includes:

[0031] When receiving a deployment request for an application code package, obtain information about the node to be deployed and target fingerprint information of the application code package based on the parameters of the deployment request;

[0032] Determine the target code repository based on the information of the node to be deployed;

[0033] Determining whether the target code repository stores an application code package carrying the target fingerprint information;

[0034] If yes, sending the application code package carrying the target fingerprint information in the target code repository to the node that needs to be deployed;

[0035] If not, the application code package carrying the target fingerprint information in the backup warehouse is sent to the node that needs to be deployed.

[0036] Preferably, the process of sending the application code package carrying the target fingerprint information in the target code repository to the node to be deployed includes:

[0037] Notify the node agent of the node that needs to be deployed, and have the node agent pull the application code package carrying the target fingerprint information from the target code repository, and push the application code package carrying the target fingerprint information to the host cluster of the node that needs to be deployed.

[0038] Preferably, it also includes:

[0039] When the application code package carrying the target fingerprint information is successfully deployed to the node that needs to be deployed, a label of the application code package is generated according to a test report of the application code package carrying the target fingerprint information.

[0040] A second aspect of the present application provides an application code package version management device, comprising:

[0041] a compliance detection unit, configured to perform compliance detection on the application code package to be stored and obtain a detection result, wherein the detection result includes whether the application code package passes the detection;

[0042] A fingerprint generating unit, configured to generate fingerprint information for an application code package that has passed the detection according to application information, version number, upload time, and file size in the application code package;

[0043] An information acquisition unit, configured to acquire, based on the application information, node information of each node on which the application code package needs to be deployed from a preset configuration management database;

[0044] The target determination unit is configured to determine at least one target code repository based on the node information of each node, and send the application code package carrying the fingerprint information to the target code repository.

[0045] As can be seen from the above technical solution, the present application performs a compliance check on a stored application code package and obtains a test result, which includes whether the application code package has passed the test. For each application code package that has passed the test, fingerprint information is first generated based on the application information, version number, upload time, and file size in the application code package. The fingerprint information is unique for each application code package and can be associated with a unique corresponding application code package based on the fingerprint information. The integrity of the application code package file can also be verified based on the fingerprint information. Then, based on the application information, node information for each node where the application code package needs to be deployed is obtained from a preset configuration management database. Finally, based on the node information of each node, at least one target code repository is determined, and the application code package carrying the fingerprint information is sent to the target code repository. The target code repository is the most appropriate code repository for each node. By pre-storing the application code package that has passed the test in the target code repository of each node where the application code package needs to be deployed, each node can schedule the application code package locally, improving the deployment efficiency of the application code package and shortening the upgrade and release time of the application code package. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0047] Figure 1 A schematic diagram of the storage part of the application code package version method disclosed in an embodiment of the present application;

[0048] Figure 2 This is another schematic diagram of the storage part of the application code package version method disclosed in an embodiment of the present application;

[0049] Figure 3 A schematic diagram of the storage process of the application code package version method disclosed in an embodiment of the present application;

[0050] Figure 4 This is a schematic diagram of the deployment part of the application code package version method disclosed in an embodiment of the present application;

[0051] Figure 5 A schematic diagram of the deployment process of the application code package version method disclosed in an embodiment of the present application;

[0052] Figure 6 A schematic diagram of a storage portion in the application code package version management device disclosed in an embodiment of the present application;

[0053] Figure 7 Another schematic diagram of the storage portion of the application code package version management device disclosed in an embodiment of the present application;

[0054] Figure 8 A schematic diagram of the deployment portion of the application code package version management device disclosed in an embodiment of the present application;

[0055] Figure 9 This is another schematic diagram of the deployment part of the application code package version management device disclosed in an embodiment of the present application;

[0056] Figure 10 This is a schematic diagram of the application code package version management device disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0057] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0058] Centralized management of project deployment is only suitable for small services with a simple business architecture. Once faced with services with complex architectures and multi-point deployment across computer rooms, relying on the public network to transmit the project's application code packages from the data center will be difficult to meet the needs of efficient transmission.

[0059] For scenarios where service nodes are widely and dispersed, achieving efficient and rapid project deployment is a challenging task. For example, a DDNS service runs in cloud resource pools across more than ten provinces across China (e.g., Guizhou, Hunan, Hebei, Jiangsu, and Shanxi, each with independent network connectivity). Each service deployment and upgrade requires simultaneous upgrades across all resource pools. With centralized package management, upgrade packages would need to be transferred over the public network to each resource pool, and then upgraded one by one. This not only increases network overhead but also reduces upgrade efficiency.

[0060] Absolute marginalization, which involves distributing application code package files across various nodes, can minimize network interference and improve transmission efficiency, but it can also easily lead to problems such as excessive costs and irrational resource allocation.

[0061] The inventors of this application discovered that if distributed storage is implemented when application code packages are uploaded, they can be stored in one or more code repositories corresponding to each deployment node. This allows each resource pool to pull the code package from the nearest code repository during an application code package upgrade, reducing network overhead and improving overall service upgrade efficiency.

[0062] Based on this, this application intends to adopt an appropriate marginalization form, combined with resource attributes such as network environment, network bandwidth, storage space, etc., to develop a version management solution for application code packages to solve the dual problems of application service version management and upgrade release transmission efficiency during the construction of automated operation and maintenance.

[0063] The following describes the application code package version management method provided by the embodiment of this application. Figure 1 The application code package version management method provided in the embodiment of the present application may include the following steps:

[0064] Step S101: Perform a compliance check on the application code package to be stored.

[0065] After the compliance test, a test result can be obtained, which includes whether the application code package has passed the test.

[0066] The checkpoints in the compliance test may include: naming standards of application code packages, file directory structure standards, security standards, etc. Through compliance testing, application code packages that do not meet the standards can be filtered out and not stored.

[0067] Step S102 : For an application code package that has passed the detection, fingerprint information is generated based on the application information, version number, upload time, and file size in the application code package.

[0068] The application information in the application code package can include the product name, application type (such as Java, Python, Go, HTML, Node.js, etc.), and service name (such as the English abbreviation of the service platform). Fingerprint information is unique to each application code package and can be used to identify the application code package.

[0069] Step S103: According to the application information, node information of each node where the application code package needs to be deployed is obtained from a preset configuration management database.

[0070] The Configuration Management Database (CMDB) contains all relevant information about project deployment, such as which nodes need to deploy which projects, which application code packages these projects depend on, and so on.

[0071] By querying the preset configuration management database, node information of each node where a specified application code package needs to be deployed can be obtained. For a certain application code package, there may be multiple scattered nodes that need to deploy it, or there may be only one node that needs to deploy it.

[0072] The node information may include network information and capacity information of code repositories near the node.

[0073] Step S104: determining at least one target code repository based on the node information of each node, and sending the application code package carrying the fingerprint information to the target code repository.

[0074] Each node must correspond to a target code repository. At the same time, multiple nodes may share a target code repository. The target code repository is the code repository most suitable for storing application code packages among the code repositories near the node, calculated according to a preset algorithm.

[0075] This application performs a compliance check on a stored application code package and obtains a test result, which includes whether the application code package has passed the test. For application code packages that have passed the test, fingerprint information is first generated based on the application information, version number, upload time, and file size in the application code package. This fingerprint information is unique for each application code package and can be associated with a unique corresponding application code package based on the fingerprint information. The integrity of the application code package file can also be verified based on the fingerprint information. Then, based on the application information, node information for each node where the application code package needs to be deployed is retrieved from a preset configuration management database. Finally, based on the node information of each node, at least one target code repository is determined, and the application code package carrying the fingerprint information is sent to the target code repository. The target code repository is the most appropriate code repository for each node. By pre-storing the application code package that has passed the test in the target code repository of each node where the application code package needs to be deployed, each node can schedule the application code package locally, improving the deployment efficiency of the application code package and shortening the upgrade and release time of the application code package.

[0076] See also Figure 2 In some embodiments of the present application, after the above step S102, the following steps may also be included:

[0077] Step S105: Send the application code package carrying the fingerprint information to the backup warehouse.

[0078] The backup repository is used to store all application code packages that have passed the test in the form of backup.

[0079] It's easy to understand that both the code repository and the backup repository are used to store application code packages. The code repository is a distributed resource pool, and the number of application code packages in each repository varies. For example, if a service has only one deployment node, the application code package for that service will be stored only in the code repository closest to that node. When a service upgrade or release is required, each node retrieves the application code package from the nearest or optimal code repository. The backup repository is a comprehensive repository that stores application code packages for all services. If an application code package in the code repository is lost, the backup repository can be used.

[0080] In some embodiments of the present application, the process of determining at least one target code repository according to the node information of each node in step S104 may include:

[0081] For each of the nodes:

[0082] S1. Obtain a list of candidate code repositories based on the node information of the node.

[0083] The candidate code repository list includes at least one candidate code repository.

[0084] S2: Obtain the network type, effective bandwidth, storage space size, and routing hop count of each candidate code repository from the node.

[0085] Among them, network types can include intranet, dedicated line, and public network; the effective bandwidth can be determined by the bandwidth size and access coefficient of the network to which the candidate code repository is connected. The access coefficient is determined by the access form, which includes independent bandwidth and shared bandwidth.

[0086] For example, assume that the bandwidth of the network is expressed as , the access coefficient is expressed as , then the effective bandwidth It can be expressed as .

[0087] S3: Determine the target code repository for the node based on the network type, effective bandwidth, storage space size, and the number of routing hops from the node to each candidate code repository.

[0088] Since network factors and storage space factors are taken into consideration when determining the target code repository, a code repository that is close to the node and has sufficient storage space can be selected as the target code repository for each node.

[0089] In some embodiments of the present application, the process of determining the target code repository of the node in S3 based on the network type, effective bandwidth, storage space size, and the number of routing hops from the node to each candidate code repository may include:

[0090] S31: For each candidate code repository, the priority of the candidate code repository is calculated using the following formula:

[0091]

[0092] in, is the network environment coefficient determined by the network type, The number of routing hops from the node to the candidate code repository, is the routing attenuation coefficient determined by the network type, is the effective bandwidth, The storage space size.

[0093] For example, the above network environment coefficient can be set as follows: if the network type is intranet, , if the network type is dedicated line, , if the network type is public network, ;

[0094] For the above routing attenuation coefficient, it can be set as follows: If the network type is intranet, , if the network type is dedicated line, , if the network type is public network, ;

[0095] For the above effective bandwidth, it can be set as follows: If the access mode is independent bandwidth, , the effective bandwidth is equal to the broadband size of the network, that is, ; If the access mode is shared bandwidth, , the effective bandwidth is equal to half of the network's bandwidth, that is, .

[0096] S32: Determine the code repository with the highest priority as the target code repository.

[0097] In the process of determining the target code repository, the above embodiment takes into account the network type (intranet, dedicated line, and public network) and the access form (independent bandwidth, shared bandwidth) in terms of network parameters. The formula used can more fully reflect the actual transmission capacity of the network, making it easier to determine the code repository that is closer to the node in terms of network distance, which is beneficial to the transmission of application code packages.

[0098] In some embodiments of the present application, the process of performing the compliance check on the application code package to be stored in step S101 may include:

[0099] S1, detecting whether the file format of the application code package matches the type of the service carried by the application code package.

[0100] Specifically, different types of services may be required to be packaged into packages in different file formats, which may include .war format, .zip file format, .tar..gz file format, etc.

[0101] S2: Check whether the naming method of the application code package complies with the preset naming specification.

[0102] For example, the preset naming convention can be: project name-version number.suffix format, where the project name must be consistent with the name of the corresponding project in the version management platform, and the version number must be expressed in the format of xxx, where x represents a number, and the version number must be at least 3 digits.

[0103] S3: Check whether the directory structure of the application code package complies with the preset directory structure specification.

[0104] For example, the preset directory structure specification may be: the first-level directory of the application code package must contain the bin file and the service start and stop management scripts, and the configuration files are all stored in the config directory.

[0105] S4: Check whether the application code package is in an unlocked state.

[0106] Specifically, the deployment of application code packages can be roughly divided into four processes: deployment self-test, deployment test submission, deployment grayscale, and online deployment. During the deployment self-test phase, R&D may need to continuously modify bugs and repeatedly upload the same version of code, so the application code package at this stage is in an unlocked state. Starting from the deployment test submission, the software testing department will intervene in the operation of this application code package, and the software R&D department is not allowed to overwrite the application code package. At this time, in order to prevent the application code package from being modified during operation, the application code package is set to a locked state. If the application code package fails the test, it will be unlocked; if the application code package passes the test, it will remain in a locked state until the application code package is released online.

[0107] For the above four test items, if any one of them fails, the test result of the application code package will be considered as failed. Only when all items pass the test, the test result of the application code package will be considered as passed.

[0108] See also Figure 3 In some embodiments of the present application, the process of sending the application code package carrying the fingerprint information to the target code repository in step S104 may include:

[0109] A1, notifying the node agent of the node where the target code repository is located, and having the node agent pull the application code package carrying the fingerprint information, and push the application code package carrying the fingerprint information to the target code repository.

[0110] The above describes the storage management process of application code packages. The following describes the deployment management process of application code packages. Figure 4 In some embodiments of the present application, the application code package version management method may further include:

[0111] Step S201: When a deployment request for an application code package is received, information of nodes to be deployed and target fingerprint information of the application code package are obtained according to parameters of the deployment request.

[0112] Typically, the parameters of a deployment request may include the name of the project to be deployed, the version number of the application code package, the deployment environment, and the deployment method. The deployment method may include full deployment, batch deployment, proportional deployment, whether to restart the service one by one, the restart interval, etc.

[0113] In addition, a special type of deployment is version rollback. When deploying an application code package, each version's directory files are managed as a file name + version number. However, the running file does not have a version number and is usually soft-linked from a file with a version number. Based on this, version rollback can include two scenarios: First, passing the previous version of the application code package as a parameter to redeploy using the previous version of the application code package; second, modifying the soft link of the file with the version number to directly link to the previous version of the file.

[0114] Step S202: Determine the target code repository based on the information of the node to be deployed.

[0115] The process of determining the target code repository in this step is the same as the principle of determining the target code repository in the above step S104, and will not be repeated here.

[0116] Step S203: determine whether the target code repository stores an application code package carrying the target fingerprint information.

[0117] For example, first, the application code package's application information, version number, MD5 value, and other information are obtained based on the target fingerprint information. Then, based on the application information and version number, it is determined whether the specified application code package is stored in the target code repository. Finally, a hash calculation is performed on the application code package to determine whether the MD5 value of the application code package is consistent with the MD5 value in the fingerprint information. Comparing the MD5 values can detect file damage or tampering during transmission.

[0118] If the target code repository stores an application code package carrying the target fingerprint information, the process proceeds to step S204; otherwise, the process proceeds to step S205.

[0119] Step S204: Send the application code package carrying the target fingerprint information in the target code repository to the node that needs to be deployed.

[0120] Step S205: Send the application code package carrying the target fingerprint information in the backup warehouse to the node that needs to be deployed.

[0121] It is understandable that, since the target code repository is the optimal choice for the node to be deployed, obtaining the application code package from the target code repository is the most efficient in terms of transmission efficiency. If the specified application code package does not exist in the target code repository or is damaged, it will be obtained from the backup repository.

[0122] See also Figure 5 In some embodiments of the present application, the process of sending the application code package carrying the target fingerprint information in the target code repository to the node to be deployed in step S204 may include:

[0123] B1, notifying the node agent of the node that needs to be deployed, and having the node agent pull the application code package carrying the target fingerprint information from the target code repository, and push the application code package carrying the target fingerprint information to the host cluster of the node that needs to be deployed.

[0124] Specifically, a node agent is set up on each node. The node agent is responsible for transmitting application code packages and controlling the host or host cluster to be deployed.

[0125] However, the proxy node in A1 and the proxy node in B1 may not be the same node. This is because, during the application code package storage process, the node proxy of the node where the code repository is located is called and controlled; while during the deployment process, the node proxy called is the node proxy of the node to be deployed.

[0126] See also Figure 5 , code repository 1 corresponds to node 1, and the entire storage process calls node 1's node agent. If, during deployment, you need to deploy both node 1 and node 2, and node 2 does not have its own code repository, node 2 and node 1 will reuse code repository 1. During deployment, the version management platform will simultaneously notify node 1's node agent and node 2's node agent to pull code from code repository 1.

[0127] The application code package version management method provided in some embodiments of the present application may further include:

[0128] When the application code package carrying the target fingerprint information is successfully deployed to the node that needs to be deployed, a label of the application code package is generated according to the test report of the application code package carrying the target fingerprint information.

[0129] Specifically, the tags may include: test passed, test failed, grayscale passed, grayscale rollback, production xxx node passed, production xxx node rollback, etc. An application code package may include multiple tags at the same time. For example, an application code package may have the tags test passed, grayscale passed, and production xxx node passed.

[0130] Typically, after a test deployment is complete, a pass or fail label is generated based on the test report. After a phased deployment or production deployment is complete, a pass label is assigned by default. This label is automatically changed to the rollback label in the event of a rollback. Label information is managed in the code package information management section of the version management platform, specifically by adding or removing labels for a specific service version.

[0131] Through diverse tag management, application code packages are constrained to sequentially pass through the R&D environment, the test environment, the grayscale environment, and finally the production environment, significantly improving the quality of their releases. Furthermore, node deployment tags address the management of different versions across different nodes. Furthermore, through combined version management and tag management, all previously released application code packages can be quickly rolled back or deployed, addressing the need for cross-version rollbacks to address potential issues.

[0132] The following describes an application code package version management device provided in an embodiment of the present application. The application code package version management device described below and the application code package version management method described above can refer to each other.

[0133] See Figure 6 The application code package version management device provided in the embodiment of the present application may include:

[0134] A compliance detection unit 21 is configured to perform compliance detection on the application code package to be stored and obtain a detection result, wherein the detection result includes whether the application code package passes the detection;

[0135] The fingerprint generating unit 22 is configured to generate fingerprint information for an application code package that has passed the detection according to the application information, version number, upload time and file size in the application code package;

[0136] The information acquisition unit 23 is used to acquire node information of each node where the application code package needs to be deployed from a preset configuration management database according to the application information;

[0137] The target determination unit 24 is configured to determine at least one target code repository according to the node information of each node, and send the application code package carrying the fingerprint information to the target code repository.

[0138] In some embodiments of the present application, the process of the target determination unit 24 determining at least one target code repository based on the node information of each node may include:

[0139] For each of the nodes:

[0140] Obtaining a candidate code repository list according to the node information of the node, the candidate code repository list including at least one candidate code repository;

[0141] Obtain the network type, effective bandwidth, storage space size, and number of routing hops from the node to each candidate code repository for each candidate code repository;

[0142] The target code repository of the node is determined according to the network type, effective bandwidth, storage space size, and the number of routing hops from the node to each candidate code repository.

[0143] In some embodiments of the present application, the process of the target determination unit 24 determining the target code repository of the node based on the network type, effective bandwidth, storage space size, and the number of routing hops from the node to each candidate code repository may include:

[0144] For each code repository, the priority of the code repository is calculated using the following formula:

[0145]

[0146] in, is the network environment coefficient determined by the network type, is the number of routing hops from the node to the candidate code repository, is the routing attenuation coefficient determined by the network type, is the effective bandwidth, is the storage space size;

[0147] The candidate code repository with the highest priority is determined as the target code repository.

[0148] In some embodiments of the present application, the process of the standardization detection unit 21 performing standardization detection on the application code package to be stored may include:

[0149] Detecting whether a file format of the application code package matches a type of service carried by the application code package;

[0150] Check whether the naming method of the application code package complies with the preset naming specification;

[0151] Checking whether the directory structure of the application code package complies with a preset directory structure specification;

[0152] Check whether the application code package is not in a locked state.

[0153] In some embodiments of the present application, the process of the target determination unit 24 sending the application code package carrying the fingerprint information to the target code repository may include:

[0154] Notify the node agent of the node where the target code repository is located, and have the node agent pull the application code package carrying the fingerprint information, and push the application code package carrying the fingerprint information to the target code repository.

[0155] See Figure 7In some embodiments of the present application, the application code package version management device may further include:

[0156] The backup unit 25 is configured to send the application code package carrying the fingerprint information to a backup warehouse, where the backup warehouse is configured to store all application code packages that have passed the detection in a backup form.

[0157] See Figure 8 In some embodiments of the present application, the application code package version management device may further include:

[0158] The deployment information receiving unit 51 is configured to, upon receiving a deployment request for an application code package, obtain information about the node to be deployed and target fingerprint information of the application code package according to parameters of the deployment request;

[0159] A code repository determining unit 52 is configured to determine a target code repository based on information about the node to be deployed.

[0160] The target code identification unit 53 is used to determine whether the target code repository stores an application code package carrying the target fingerprint information;

[0161] The target code acquisition unit 54 is used to:

[0162] If the target code identification unit 53 determines that the target code repository stores an application code package carrying the target fingerprint information, the application code package carrying the target fingerprint information in the target code repository is sent to the node to be deployed;

[0163] If the target code identification unit 53 determines that the target code repository does not store the application code package carrying the target fingerprint information, the application code package carrying the target fingerprint information in the backup repository is sent to the node that needs to be deployed.

[0164] In some embodiments of the present application, the process of the target code acquisition unit 54 sending the application code package carrying the target fingerprint information in the target code repository to the node to be deployed may include:

[0165] Notify the node agent of the node that needs to be deployed, and have the node agent pull the application code package carrying the target fingerprint information from the target code repository, and push the application code package carrying the target fingerprint information to the host cluster of the node that needs to be deployed.

[0166] See Figure 9 In some embodiments of the present application, the application code package version management device may further include:

[0167] The label generating unit 55 is configured to generate a label for the application code package according to a test report of the application code package carrying the target fingerprint information after the application code package carrying the target fingerprint information is successfully deployed to the node requiring deployment.

[0168] The application code package version management apparatus provided in the embodiment of the present application can be applied to an application code package version management device, such as a computer. Optionally, Figure 10 The hardware structure diagram of the application code package version management device is shown. Figure 10 The hardware structure of the application code package version management device may include: at least one processor 31 , at least one communication interface 32 , at least one memory 33 and at least one communication bus 34 .

[0169] In the embodiment of the present application, the number of the processor 31, the communication interface 32, the memory 33, and the communication bus 34 is at least one, and the processor 31, the communication interface 32, and the memory 33 communicate with each other through the communication bus 34;

[0170] The processor 31 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application;

[0171] The memory 32 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0172] The memory 33 stores a program, and the processor 31 can call the program stored in the memory 33, wherein the program is used to:

[0173] Performing a compliance test on the application code package to be stored to obtain a test result, wherein the test result includes whether the application code package passes the test;

[0174] For the application code package that passes the detection, fingerprint information is generated based on the application information, version number, upload time, and file size in the application code package;

[0175] According to the application information, node information of each node where the application code package needs to be deployed is obtained from a preset configuration management database;

[0176] At least one target code repository is determined according to the node information of each node, and the application code package carrying the fingerprint information is sent to the target code repository.

[0177] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0178] An embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:

[0179] Performing a compliance test on the application code package to be stored to obtain a test result, wherein the test result includes whether the application code package passes the test;

[0180] For the application code package that passes the detection, fingerprint information is generated based on the application information, version number, upload time, and file size in the application code package;

[0181] According to the application information, node information of each node where the application code package needs to be deployed is obtained from a preset configuration management database;

[0182] At least one target code repository is determined according to the node information of each node, and the application code package carrying the fingerprint information is sent to the target code repository.

[0183] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0184] In summary:

[0185] This application performs a compliance check on a stored application code package and obtains a test result, which includes whether the application code package has passed the test. For application code packages that have passed the test, fingerprint information is first generated based on the application information, version number, upload time, and file size in the application code package. This fingerprint information is unique for each application code package and can be associated with a unique corresponding application code package based on the fingerprint information. The integrity of the application code package file can also be verified based on the fingerprint information. Then, based on the application information, node information for each node where the application code package needs to be deployed is retrieved from a preset configuration management database. Finally, based on the node information of each node, at least one target code repository is determined, and the application code package carrying the fingerprint information is sent to the target code repository. The target code repository is the most appropriate code repository for each node. By pre-storing the application code package that has passed the test in the target code repository of each node where the application code package needs to be deployed, each node can schedule the application code package locally, improving the deployment efficiency of the application code package and shortening the upgrade and release time of the application code package.

[0186] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0187] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referenced to each other.

[0188] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for managing application code package versions, characterized in that: include: Performing a compliance test on the application code package to be stored to obtain a test result, wherein the test result includes whether the application code package passes the test; For the application code package that passes the detection, fingerprint information is generated based on the application information, version number, upload time, and file size in the application code package; According to the application information, node information of each node where the application code package needs to be deployed is obtained from a preset configuration management database; Determine at least one target code repository according to the node information of each node, and send the application code package carrying the fingerprint information to the target code repository; The process of determining at least one target code repository according to the node information of each node includes: For each of the nodes: Obtaining a candidate code repository list according to the node information of the node, the candidate code repository list including at least one candidate code repository; Obtain the network type, effective bandwidth, storage space size, and number of routing hops from the node to each candidate code repository for each candidate code repository; The target code repository of the node is determined according to the network type, effective bandwidth, storage space size, and the number of routing hops from the node to each candidate code repository.

2. The method according to claim 1, characterized in that The process of determining the target code repository of the node according to the network type, effective bandwidth, storage space size, and the number of routing hops from the node to each candidate code repository includes: For each code repository, the priority of the code repository is calculated using the following formula: ; in, is the network environment coefficient determined by the network type, is the number of routing hops from the node to the candidate code repository, is the routing attenuation coefficient determined by the network type, is the effective bandwidth, is the storage space size; The candidate code repository with the highest priority is determined as the target code repository.

3. The method according to claim 1, characterized in that The process of checking the compliance of application code packages to be stored includes: Detecting whether a file format of the application code package matches a type of service carried by the application code package; Check whether the naming method of the application code package complies with the preset naming specification; Checking whether the directory structure of the application code package complies with a preset directory structure specification; Check whether the application code package is not in a locked state.

4. The method according to claim 1, wherein The process of sending the application code package carrying the fingerprint information to the target code repository includes: Notify the node agent of the node where the target code repository is located, and have the node agent pull the application code package carrying the fingerprint information, and push the application code package carrying the fingerprint information to the target code repository.

5. The method according to claim 1, wherein After generating the fingerprint information, the method further includes: The application code package carrying the fingerprint information is sent to a backup warehouse, and the backup warehouse is used to store all application code packages that have passed the detection in a backup form.

6. The method according to claim 5, characterized in that Also includes: When receiving a deployment request for an application code package, obtain information about the node to be deployed and target fingerprint information of the application code package based on the parameters of the deployment request; Determine the target code repository based on the information of the node to be deployed; Determining whether the target code repository stores an application code package carrying the target fingerprint information; If yes, sending the application code package carrying the target fingerprint information in the target code repository to the node that needs to be deployed; If not, the application code package carrying the target fingerprint information in the backup warehouse is sent to the node that needs to be deployed.

7. The method according to claim 6, characterized in that The process of sending the application code package carrying the target fingerprint information in the target code repository to the node to be deployed includes: Notify the node agent of the node that needs to be deployed, and have the node agent pull the application code package carrying the target fingerprint information from the target code repository, and push the application code package carrying the target fingerprint information to the host cluster of the node that needs to be deployed.

8. The method according to claim 7, characterized in that Also includes: When the application code package carrying the target fingerprint information is successfully deployed to the node that needs to be deployed, a label of the application code package is generated according to a test report of the application code package carrying the target fingerprint information.

9. An application code package version management device, characterized in that: include: a compliance detection unit, configured to perform compliance detection on the application code package to be stored and obtain a detection result, wherein the detection result includes whether the application code package passes the detection; A fingerprint generating unit, configured to generate fingerprint information for an application code package that has passed the detection according to application information, version number, upload time, and file size in the application code package; An information acquisition unit, configured to acquire, based on the application information, node information of each node on which the application code package needs to be deployed from a preset configuration management database; a target determination unit, configured to determine at least one target code repository based on the node information of each node, and send the application code package carrying the fingerprint information to the target code repository; The process of determining at least one target code repository according to the node information of each node includes: For each of the nodes: Obtaining a candidate code repository list according to the node information of the node, the candidate code repository list including at least one candidate code repository; Obtain the network type, effective bandwidth, storage space size, and number of routing hops from the node to each candidate code repository for each candidate code repository; The target code repository of the node is determined according to the network type, effective bandwidth, storage space size, and the number of routing hops from the node to each candidate code repository.

Citation Information

Patent Citations

  • Mobile application deployment for distributed computing environments

    US20140101717A1