Code deployment method and device, equipment and storage medium

By building an operating environment associated with the code base and using the deployment model to generate deployment instructions, the problems of inefficiency and poor reliability of traditional code deployment methods are solved, and the automatic deployment and efficient deployment process of the code base are realized.

CN120104140APending Publication Date: 2025-06-06BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510180965.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-18
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

Traditional code deployment methods rely on manual operations or fragile script automation, resulting in inefficiency, poor reliability and difficulty in maintaining consistency on different systems, increasing development costs and probability of errors.

Method used

By building a run environment associated with the code base, using the deployment model to generate deployment instructions based on the status information of the run base, and generate deployment files in response to the successful run of the target test to support the automatic deployment of the code base.

Benefits of technology

The automatic deployment of the code base is realized, which improves the reliability and flexibility of deployment, reduces the complexity and error proneness of manual configuration, and reduces the development costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104140A_ABST
    Figure CN120104140A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a code deployment method and device, equipment and a computer readable storage medium. The method comprises the following steps: constructing a running environment associated with a code library, wherein the running environment is associated with a group of deployment tools; generating a set of deployment instructions associated with the operating environment by using the deployment model based on the state information of the operating environment, the set of deployment instructions being configured to be executed by using a corresponding deployment tool in the set of deployment tools; and in response to successful operation of the target test associated with the code library in the operation environment, generating a deployment file for deploying the code library based on the group of deployment instructions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Example embodiments of the present disclosure generally relate to the field of computers, and more particularly, to methods, apparatuses, devices, and computer-readable storage media for code deployment. Background Art

[0002] In software development, traditional environment configuration solutions usually rely on manual operations or script automation. For example, developers may need to manually install dependencies, configure environment variables, and resolve dependency conflicts, which is not only time-consuming but also error-prone. Another common solution is to use scripts to automate configuration, but these scripts are often fragile and inflexible, making it difficult to adapt to complex or dynamic environment requirements. The main drawbacks of these traditional methods are low efficiency, poor reliability, and difficulty in maintaining consistency across different systems, which causes developers to spend a lot of time configuring the environment when faced with unfamiliar code repositories. At the same time, the complexity and error-proneness of manual configuration also increase development costs and the probability of errors. Summary of the invention

[0003] In a first aspect of the present disclosure, a method for code deployment is provided. The method includes: constructing an operating environment associated with a code base, the operating environment being associated with a set of deployment tools; using a deployment model to generate a set of deployment instructions associated with the operating environment based on state information of the operating environment, wherein the set of deployment instructions is configured to be executed using corresponding deployment tools in a set of deployment tools; and in response to successfully running a target test associated with the code base in the operating environment, generating a deployment file for deploying the code base based on the set of deployment instructions.

[0004] In a second aspect of the present disclosure, a device for code deployment is provided. The device includes: an environment construction module configured to construct an operating environment associated with a code base, the operating environment being associated with a set of deployment tools; an instruction generation module configured to generate a set of deployment instructions associated with the operating environment based on the state information of the operating environment using a deployment model, wherein the set of deployment instructions is configured to be executed using a corresponding deployment tool in a set of deployment tools; and a file generation module configured to generate a deployment file for deploying the code base based on the set of deployment instructions in response to successfully running a target test associated with the code base in the operating environment.

[0005] In a third aspect of the present disclosure, an electronic device is provided. The device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit. When the instructions are executed by the at least one processing unit, the device executes the method of the first aspect.

[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to implement the method of the first aspect.

[0007] In a fifth aspect of the present disclosure, a computer program product is provided, comprising computer executable instructions, wherein the computer executable instructions implement the method of the first aspect when executed by a processor.

[0008] It should be understood that the contents described in this content section are not intended to limit the key features or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0010] Figure 1 A schematic diagram showing an example environment in which embodiments according to the present disclosure may be implemented;

[0011] Figure 2 A flowchart illustrating an example process of code deployment according to some embodiments of the present disclosure;

[0012] Figure 3 An example system for code deployment according to some embodiments of the present disclosure is shown;

[0013] Figure 4 A schematic structural block diagram showing an example apparatus for code deployment according to some embodiments of the present disclosure; and

[0014] Figure 5 A block diagram of an electronic device capable of implementing various embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0016] It should be noted that the titles of any sections / subsections provided herein are not restrictive. Various embodiments are described throughout this article, and any type of embodiment may be included under any section / subsection. In addition, the embodiments described in any section / subsection may be combined in any manner with any other embodiments described in the same section / subsection and / or different sections / subsections.

[0017] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may be included below. The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may be included below.

[0018] The embodiments of the present disclosure may involve user data, data acquisition and / or use, etc. These aspects are subject to the corresponding laws, regulations and relevant provisions. In the embodiments of the present disclosure, all data collection, acquisition, processing, processing, forwarding, use, etc. are carried out on the premise that the user knows and confirms. Accordingly, when implementing each embodiment of the present disclosure, the type, scope of use, usage scenario, etc. of the data or information that may be involved should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with the relevant laws and regulations. The specific notification and / or authorization method can vary according to the actual situation and application scenario, and the scope of the present disclosure is not limited in this respect.

[0019] In this specification and the embodiments, if personal information processing is involved, it will be processed on the premise of having a legal basis (such as obtaining the consent of the subject of personal information, or it is necessary to perform a contract, etc.), and will only be processed within the scope of regulations or agreements. If a user refuses to process personal information other than the necessary information for basic functions, it will not affect the user's use of basic functions.

[0020] In software development, traditional environment configuration solutions usually rely on manual operations or script automation. For example, developers may need to manually install dependencies, configure environment variables, and resolve dependency conflicts, which is not only time-consuming but also error-prone. Another common solution is to use scripts to automate configuration, but these scripts are often fragile and inflexible, making it difficult to adapt to complex or dynamic environment requirements. The main drawbacks of these traditional methods are low efficiency, poor reliability, and difficulty in maintaining consistency across different systems, which causes developers to spend a lot of time configuring the environment when faced with unfamiliar code repositories. At the same time, the complexity and error-proneness of manual configuration also increase development costs and the probability of errors.

[0021] The embodiment of the present disclosure proposes a solution for code deployment. The solution includes: constructing an operating environment associated with a code base, the operating environment being associated with a set of deployment tools; using a deployment model to generate a set of deployment instructions associated with the operating environment based on state information of the operating environment, wherein the set of deployment instructions is configured to be executed using corresponding deployment tools in a set of deployment tools; and in response to successfully running a target test associated with the code base in the operating environment, generating a deployment file for deploying the code base based on the set of deployment instructions.

[0022] In this way, the embodiments of the present disclosure can utilize the model to automatically generate deployment files of the code library to support automatic deployment of the code library, thereby improving the reliability and flexibility of deploying the code library.

[0023] Various example implementations of the solution are described in detail below in conjunction with the accompanying drawings.

[0024] Example Environment

[0025] Figure 1 1 is a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. Figure 1 As shown, example environment 100 may include electronic device 110 .

[0026] like Figure 1 As shown, the electronic device 110 can obtain the code base 120 to be deployed. As an example, such a code base 120 can include code files, for example. In addition, the code base 120 can also include configuration files, test scripts, documents (e.g., readme documents), etc. Developers can manage and collaborate on the code base through a version control system to ensure that code changes can be tracked and managed. However, the code base itself does not contain the runtime environment configuration information required to run the code, which often requires developers to manually set it or complete it through script automation.

[0027] like Figure 1 As shown, the electronic device 110 can use the deployment model 130 to generate a deployment file 140 for deploying the code library 120. The deployment model 130 may include, for example, a generative model, such as a language model. The specific implementation of the deployment model 130 will be referred to below. Figure 3 Detailed description.

[0028] In some embodiments, the deployment file 140 can implement automatic deployment of the code base 120. As an example, the deployment file can include a Dockerfile. A Dockerfile is a script file that can specify how to start from a base image and gradually build an image containing specific software, dependencies, and configurations through a series of instructions.

[0029] Dockerfile allows developers to standardize the code's operating environment and package it into an image, thereby automatically configuring the code base's operating environment. Dockerfile provides an automated and repeatable way to configure the environment, solving the inefficiency and inconsistency problems of traditional manual configuration of the environment. With Dockerfile, developers can easily deploy code to any environment that supports Docker without having to worry about compatibility issues caused by environmental differences.

[0030] In some embodiments, the deployment file 140 may also include, for example, other appropriate script files for configuring the operating environment.

[0031] The specific generation process of the deployment file 140 will be referred to below. Figure 2 and Figure 3 Detailed description.

[0032] In some embodiments, the electronic device 110 can be any type of mobile terminal, fixed terminal or portable terminal, including mobile phones, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, media computers, multimedia tablets, handheld computers, portable game terminals, VR / AR devices, personal communication systems (PCS) devices, personal navigation devices, personal digital assistants (PDA), audio / video players, digital cameras / camcorders, positioning devices, television receivers, radio broadcast receivers, e-book devices, game devices, or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. In some embodiments, the electronic device 110 can also support any type of interface for the user (such as "wearable" circuits, etc.).

[0033] It should be understood that the structure and function of the various elements in the environment 100 are described for exemplary purposes only and do not imply any limitation on the scope of the present disclosure.

[0034] Some example embodiments of the present disclosure will be described below with continued reference to the accompanying drawings.

[0035] Example Process

[0036] Figure 2 A flow chart of an example process 200 of code deployment according to some embodiments of the present disclosure is shown. The process 200 may be implemented at the electronic device 110.

[0037] As shown in the figure, in block 210 , the electronic device 110 builds an operating environment associated with a code library, and the operating environment is associated with a set of deployment tools.

[0038] The following will further refer to Figure 3 To describe the specific process of generating deployment files. Figure 3 An example system 300 for code deployment according to some embodiments of the present disclosure is shown.

[0039] like Figure 3 As shown, in order to generate a deployment file, the electronic device 110 can build an operating environment 310 in the external environment 350. In some scenarios, the operating environment 310 is also called an internal environment, which can be a sandbox environment, for example. As an example, the operating environment 310 can be a sandbox environment based on a Docker container.

[0040] like Figure 3 As shown, the electronic device 110 can obtain the image file 302 to initialize the operating environment 310 using the base image 312. As an example, the base image 312 can be the starting point of a Docker container, which provides a preconfigured operating system environment.

[0041] In some embodiments, Figure 3 As shown, a variety of deployment tools can also be configured for the operating environment 310. As an example, the deployment tools can include: running test tools, code editing tools, command line tools, and dependency installation tools. The capabilities provided by each tool will be specifically introduced below.

[0042] As an example, the execution test tool 316 can be used to execute the target test associated with the code base 314 to determine whether the target test can be successfully executed in the execution environment 310. As introduced above, such a target test can be provided in the code base 314.

[0043] If the target test can be successfully executed in the operating environment 310, it means that the operating environment 310 has completed the environment configuration for the operating code base 314. On the contrary, if the target test cannot be successfully executed in the operating environment 310, it means that the operating environment 310 has completed the environment configuration of the operating code base 314.

[0044] As another example, the environment monitoring tool 318 can provide instructions for checking and analyzing the status of the current running environment. It allows developers or automated systems to understand the current configuration of the environment, installed dependencies, file and directory structure, and other key information. For example, the commands ls and at can view file and directory contents, pip list and pipdeptree can check installed versions, and env and printenv can view the settings of environment variables. These monitoring operations usually do not change the state of the environment, but provide important basis for subsequent configuration decisions.

[0045] As yet another example, code editing tool 320 may support modification of source code in code base 314. As an example, code editing tool 320 may support repairing syntax errors in code base 314, optimizing code logic in code base 314, updating dependencies in code base 314, or adjusting code structure in code base 314 to meet new functional requirements.

[0046] As another example, command line tool 322 can support executing command lines (e.g., Bash Command) generated by deployment model 362 in runtime environment 310. Such command sets can perform various types of tasks, such as file and directory management, environment variable settings, software installation, process control, etc.

[0047] As another example, dependency installation tool 324 can support installing external libraries, frameworks, or other resources required to run code base 314 into the target environment. These dependencies are usually not included in the code base, but are essential for the normal operation of the program. As an example, all necessary dependencies can be ensured to be correctly installed into the Docker container by parsing the dependency file (such as requirements.txt) in code base 314 or directly executing the installation command.

[0048] Continue to refer Figure 2 In box 220, the electronic device 110 generates a set of deployment instructions associated with the operating environment based on the state information of the operating environment using the deployment model, wherein the set of deployment instructions is configured to be executed using a corresponding deployment tool in a set of deployment tools.

[0049] like Figure 3 As shown, the deployment model 362 can obtain the event history 360 associated with the operating environment 310. Such event history 360 can indicate the historical actions performed in the operating environment 310 and the state information of the operating environment 310.

[0050] As an example, after the operating environment 310 is initialized, the result processor 358 may determine first description information corresponding to a first state of the operating environment 310. As an example, the first description information may include various environmental parameters in the operating environment 310.

[0051] Further, the electronic device 110 may provide the first description information to the deployment model 362 to generate a first deployment instruction corresponding to the first state.

[0052] As an example, the electronic device 110 may also provide the deployment model 362 with tool description information corresponding to a set of deployment tools supported by the operating environment 310 , so that the deployment model 362 can generate deployment instructions using the deployment tools.

[0053] As an example, the deployment model 362 can generate one or more of the following deployment instructions: code editing instructions, used to modify the code content in the code library; command line instructions, used to execute specified command lines in the running environment; dependency installation instructions, used to install dependencies in the running environment; test running instructions, used to execute target tests in the running environment.

[0054] Further, in block 364, the electronic device 110 may execute the generated deployment instructions using the corresponding deployment tool in the operating environment 310. As an example, when it is determined that the source code in the code base 314 needs to be edited, the deployment model 362 may generate a code editing instruction corresponding to the code editing tool 320 to trigger the editing of the source code.

[0055] As another example, when it is determined that dependencies related to the code library 314 need to be installed, the deployment model 362 can, for example, generate dependency installation instructions corresponding to the dependency installation tool 324 to trigger the installation of the corresponding dependencies in the operating environment 310.

[0056] Specifically, for dependency installation, the external environment 350 may further include a dependency management module, which may include a waiting list 352 and a conflict list 354. The waiting list 352 and the conflict list 354 may be used to resolve conflicts and dependencies between dependencies.

[0057] As an example, the waiting list 352 is a queue for storing dependencies to be installed. It allows the operating environment 310 to process the installation of dependencies step by step, rather than trying to install all dependencies at once. This helps to resolve complex dependencies and avoid installation failures caused by version conflicts.

[0058] As another example, conflict list 354 can be a mechanism for recording and resolving dependency conflicts. When there are version conflicts in dependencies in waiting list 352 (for example, different versions of the same package are added multiple times), these conflicts will be recorded in conflict list 354. Conflict list 354 allows the system to resolve these conflicts one by one to ensure version consistency of dependencies.

[0059] In addition, the external environment 350 also includes a rollback module 356, which can support the rollback of the configuration state of the operating environment 310. Specifically, when a deployment command is executed in the operating environment 310, the operating environment 310 can take a snapshot of the current environment state. If the command fails to execute (for example, returns a non-zero exit code), the rollback module 356 will detect the failure and trigger a rollback operation. The rollback operation will restore the environment state to the snapshot state before the command was executed, thereby undoing any potential impact caused by the failed command.

[0060] As an example, after the first deployment instruction is executed in the operating environment 310, the result processor 358 can determine the second description information corresponding to the second state of the operating environment 310. Further, the electronic device 110 can provide the second description information and the historical deployment instruction (e.g., the first deployment instruction) to the deployment model 362 to generate the second deployment instruction corresponding to the second state. Similarly, the second deployment instruction can be executed using the corresponding tool in the operating environment 310.

[0061] In some embodiments, the second description information includes log information related to the execution of the first deployment instruction. As an example, after the first deployment instruction is executed in the operating environment 310, the operating environment 310 will generate corresponding log information. At least part of such log information can be provided as a reference for the deployment model 362 to generate the next deployment instruction.

[0062] In some embodiments, execution environment 310 may obtain current status information of the execution environment by executing environment monitoring instructions generated by deployment model 362 (eg, using environment monitoring tool 318 ).

[0063] Thus, the deployment model 362 can iteratively generate new deployment instructions corresponding to the current state based on the state of the operating environment 310 and the historical deployment instructions. Such an interaction process may include, for example, multiple rounds of interaction to complete the environment configuration of the operating environment 310.

[0064] Continue to refer Figure 2 In block 230 , in response to successfully running the target test associated with the code base in the execution environment, a deployment file for deploying the code base is generated based on a set of deployment instructions.

[0065] like Figure 3As shown, after the running test tool 316 determines that the target test associated with the code base 314 can be successfully run in the running environment 310, the generator 366 can generate a deployment file 368 for deploying the code base 314 based on a set of deployment instructions executed in the running environment, such as a Dockerfile.

[0066] In some embodiments, the generator 366 may generate a deployment file 368 by rewriting the set of deployment instructions into an instruction format corresponding to the Dockerfile to generate an automated script for configuring the operating environment.

[0067] The specific generation process of the deployment file 368 will be described below with reference to a specific example.

[0068] As an example, a set of deployment instructions generated by the deployment model 362 and their interpretation are as follows:

[0069]

[0070] For this example, the generator 366 can detect whether a set of deployment instructions includes a base image change instruction. If a base image change instruction is detected, the generator 366 can generate a deployment file for deploying the code base based on the base image change instruction and at least one subsequent instruction in the set of deployment instructions.

[0071] For example, the change_python_version 3.11 instruction corresponds to a base image change instruction, and the generator 366 may ignore the deployment instructions before the base image change instruction, and generate a deployment file based on the instruction and subsequent deployment instructions.

[0072] For specific deployment instructions, the generator 366 may generate a deployment file for deploying the code base based on the instruction type and execution result of the deployment instruction.

[0073] For example, if the deployment instruction is an instruction for viewing environment parameters, the instruction may be ignored, for example. As an example, ls / repo is an instruction for listing the root directory content of the code base, which may not be added to the deployment file.

[0074] As another example, the generator 366 may also ignore instructions that fail to execute. For example, if the poetry install instruction indicates an attempt to install a dependency using Poetry, and the return code is 1 (failure), the generator may also ignore the instruction.

[0075] Based on this approach, the following is an example of the deployment file that is finally generated:

[0076]

[0077] In this way, the embodiments of the present disclosure can utilize the model to automatically generate deployment files of the code library to support automatic deployment of the code library, thereby improving the reliability and flexibility of deploying the code library.

[0078] Example devices and equipment

[0079] The embodiments of the present disclosure also provide corresponding devices for implementing the above methods or processes. Figure 4 A schematic structural block diagram of an example apparatus 400 for code deployment according to some embodiments of the present disclosure is shown. The apparatus 400 may be implemented as or included in the electronic device 110. Each module / component in the apparatus 400 may be implemented by hardware, software, firmware, or any combination thereof.

[0080] like Figure 4 As shown, the device 400 includes an environment construction module 410, which is configured to construct an operating environment associated with a code base, and the operating environment is associated with a set of deployment tools; an instruction generation module 420, which is configured to generate a set of deployment instructions associated with the operating environment based on the state information of the operating environment using a deployment model, wherein the set of deployment instructions is configured to be executed using corresponding deployment tools in a set of deployment tools; and a file generation module 440, which is configured to generate a deployment file for deploying the code base based on the set of deployment instructions in response to successfully running a target test associated with the code base in the operating environment.

[0081] In some embodiments, the instruction generation module 420 is further configured to: determine first description information corresponding to a first state of the operating environment; and provide the first description information to the deployment model to generate a first deployment instruction corresponding to the first state.

[0082] In some embodiments, the instruction generation module 420 is also configured to: execute a first deployment instruction in the operating environment; in response to completion of the execution of the first deployment instruction, determine second descriptive information corresponding to a second state of the operating environment; and provide the second descriptive information and the first deployment instruction to the deployment model to generate a second deployment instruction corresponding to the second state.

[0083] In some embodiments, the second description information includes log information related to the execution of the first deployment instruction.

[0084] In some embodiments, a set of deployment instructions includes at least one of the following: code editing instructions for modifying code content in a code repository; command line instructions for executing specified command lines in a running environment; dependency installation instructions for installing dependencies in a running environment; and test running instructions for executing target tests in a running environment.

[0085] In some embodiments, the device 400 also includes an environment monitoring module configured to: execute environment monitoring instructions generated by the deployment model to obtain current status information of the operating environment.

[0086] In some embodiments, the file generation module 430 is further configured to: in response to detecting a base image change instruction in a set of deployment instructions, generate a deployment file for deploying a code base based on the base image change instruction and at least one subsequent instruction in the set of deployment instructions.

[0087] In some embodiments, the file generation module 430 is further configured to generate a deployment file for deploying a code base based on the instruction type and execution result of a set of deployment instructions.

[0088] In some embodiments, the deployment model includes a language model.

[0089] Figure 5 1 shows a block diagram of an electronic device 500 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 5 The electronic device 500 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein. Figure 5 The electronic device 500 shown can be used to implement Figure 1 An electronic device 110.

[0090] like Figure 5 As shown, the electronic device 500 is in the form of a general electronic device. The components of the electronic device 500 may include, but are not limited to, one or more processors or processing units 510, a memory 520, a storage device 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. The processing unit 510 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the memory 520. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 500.

[0091] The electronic device 500 typically includes a plurality of computer storage media. Such media may be any accessible media that is accessible to the electronic device 500, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 520 may be a volatile memory (e.g., registers, caches, random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 530 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data and may be accessed within the electronic device 500.

[0092] The electronic device 500 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 5 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 520 may include a computer program product 525 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.

[0093] The communication unit 540 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 500 can be implemented in a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 500 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.

[0094] The input device 550 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 560 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 500 may also communicate with one or more external devices (not shown) through the communication unit 540 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 500, or communicate with any device that allows the electronic device 500 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).

[0095] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which computer-executable instructions are stored, wherein the computer-executable instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.

[0096] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices, equipment, and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0097] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0098] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0099] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.

[0100] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the various implementations disclosed herein.

Claims

1. A code deployment method, comprising: Building an operating environment associated with the code base, the operating environment being associated with a set of deployment tools; generating, using the deployment model and based on the state information of the operating environment, a set of deployment instructions associated with the operating environment, wherein the set of deployment instructions is configured to be executed using corresponding deployment tools in the set of deployment tools; as well as In response to successfully running a target test associated with the code library in the execution environment, a deployment file for deploying the code library is generated based on the set of deployment instructions.

2. The method according to claim 1, wherein using the deployment model to generate a set of deployment instructions associated with the operating environment based on the state information of the operating environment comprises: Determining first descriptive information corresponding to a first state of the operating environment; as well as The first description information is provided to the deployment model to generate a first deployment instruction corresponding to the first state.

3. The method according to claim 2, wherein using the deployment model to generate a set of deployment instructions associated with the operating environment based on the state information of the operating environment further comprises: Executing the first deployment instruction in the operating environment; In response to completion of execution of the first deployment instruction, determining second description information corresponding to a second state of the operating environment; as well as The second description information and the first deployment instruction are provided to the deployment model to generate a second deployment instruction corresponding to the second state. The method according to claim 3 , wherein the second description information comprises log information related to the execution of the first deployment instruction.

5. The method of claim 1, wherein the set of deployment instructions comprises at least one of the following: Code editing instructions, used to modify the code content in the code library; Command line instructions, used to execute a specified command line in the operating environment; Dependency installation instructions, used to install dependencies in the operating environment; The test execution instruction is used to execute the target test in the execution environment.

6. The method according to claim 1, further comprising: Execute the environment monitoring instructions generated by the deployment model to obtain current status information of the operating environment.

7. The method according to claim 1, wherein generating a deployment file for deploying the code base based on the set of deployment instructions comprises: In response to detecting a base image change instruction in the set of deployment instructions, the deployment file for deploying the code base is generated based on the base image change instruction and at least one subsequent instruction in the set of deployment instructions.

8. The method according to claim 1, wherein generating a deployment file for deploying the code base based on the set of deployment instructions comprises: Based on the instruction types and execution results of the set of deployment instructions, the deployment file for deploying the code library is generated.

9. The method of claim 1, wherein the deployment model comprises a language model.

10. A device for code deployment, comprising: An environment building module, configured to build an operating environment associated with a code base, wherein the operating environment is associated with a set of deployment tools; an instruction generation module, configured to generate a set of deployment instructions associated with the operating environment based on the state information of the operating environment using the deployment model, wherein the set of deployment instructions is configured to be executed using a corresponding deployment tool in the set of deployment tools; as well as The file generation module is configured to generate a deployment file for deploying the code library based on the set of deployment instructions in response to successfully running a target test associated with the code library in the execution environment.

11. An electronic device, comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 9 when executed by the at least one processing unit.

12. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 9.

13. A computer program product comprising computer executable instructions, wherein the computer executable instructions, when executed by a processor, implement the method according to any one of claims 1 to 9.