[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN106095501B - A kind of application dispositions method and device - Google Patents

A kind of application dispositions method and device Download PDF

Info

Publication number
CN106095501B
CN106095501B CN201610408133.1A CN201610408133A CN106095501B CN 106095501 B CN106095501 B CN 106095501B CN 201610408133 A CN201610408133 A CN 201610408133A CN 106095501 B CN106095501 B CN 106095501B
Authority
CN
China
Prior art keywords
configuration item
production environment
configuration
application
environment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610408133.1A
Other languages
Chinese (zh)
Other versions
CN106095501A (en
Inventor
俞前
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201610408133.1A priority Critical patent/CN106095501B/en
Publication of CN106095501A publication Critical patent/CN106095501A/en
Application granted granted Critical
Publication of CN106095501B publication Critical patent/CN106095501B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the present invention provides a kind of application dispositions method and device, is related to software technology field, can identify the configuration item for influencing to apply operation result, to improve the reliability of the production environment constructed, reduces the risk of application deployment failure.This method comprises: obtain the first configuration item, first configuration item be develop environment operation application executable code before with operation the application executable code after changed data;Obtain the second configuration item, second configuration item be run the executable code before exploitation environment and initial production environment between different data;In this way, the configuration item content of the initial production environment can be corrected according to first configuration item and second configuration item, the higher amendment production environment of reliability is obtained;So, after which being deployed in the amendment production environment, the success rate using deployment can be improved.

Description

Application deployment method and device
Technical Field
The invention relates to the technical field of software, in particular to an application deployment method and device.
Background
An application is developed to be successfully deployed on line, the source code is required to be compiled, installed, debugged and operated in a development environment (namely an environment used by developers), after the executable code is successfully operated in the development environment, a production environment for deploying the application (namely an environment for long-term actual operation of the application) can be constructed through an existing automatic construction system, and finally the executable code is tested and operated in the constructed production environment, so that the application which can be successfully operated is obtained.
For example, the development environment may be composed of only a few devices, and the production environment may be composed of thousands of devices; one or more runtime libraries of the development language may be included in the development environment, while runtime libraries needed for the application to run may not be available in the production environment.
Due to these differences, an application that can be successfully run in a development environment may not be successfully run in a production environment, and therefore, when a production environment for deploying the application is built, a Configuration Item (Configuration Item) that affects the running result of the application needs to be set, so as to build a more reliable production environment.
However, these configuration items all require manual configuration by a developer, and once the developer identifies a configuration item that is not incorporated into the automatic building system or is erroneously incorporated by the automatic building system, an error occurs in the finally built production environment, so that the application fails to be deployed in the production environment.
Disclosure of Invention
The invention provides an application deployment method and device, which can identify configuration items influencing the operation result of an application, thereby improving the reliability of a constructed production environment and reducing the risk of application deployment failure.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, the present invention provides an application deployment method, including: acquiring a first configuration item, wherein the first configuration item is data of a development environment which changes before an executable code of an application is run and after the executable code of the application is run; acquiring a second configuration item, wherein the second configuration item is data which is different between a development environment and an initial production environment before the executable code is operated; thus, according to the first configuration item and the second configuration item, the configuration item content of the initial production environment can be corrected, and a corrected production environment with higher reliability is obtained; then, after the application is deployed to the modified production environment, the success rate of application deployment can be improved.
In addition, the corrected production environment obtained during the application deployment can be used as the initial production environment during the next application deployment, and further the configuration item during the next application deployment can be obtained by obtaining the first configuration item and the first configuration item again, so that an effective feedback adjustment mechanism is realized to repeatedly deploy the application.
In one possible design, obtaining a first configuration item includes: before the executable code of the application is run in the development environment, saving first snapshot information of the development environment; after the executable code of the application is successfully run in the development environment, saving second snapshot information of the development environment; the first configuration item is determined based on a portion of the second snapshot information that is different from the first snapshot information.
Wherein determining the first configuration item according to a portion of the second snapshot information that is different from the first snapshot information comprises: and taking the difference data in the second snapshot information different from the first snapshot information as a first configuration item.
Or searching for replacement data corresponding to the difference data in a preset configuration dictionary according to the difference data, different from the first snapshot information, in the second snapshot information, wherein a mapping relation between the difference data and the replacement data is stored in the configuration dictionary; and taking the searched replacement data corresponding to the difference data as a first configuration item.
In one possible design, obtaining the second configuration item includes: saving third snapshot information of the initial production environment before running the executable code of the application in the initial production environment; the second configuration item is determined based on a portion of the third snapshot information that is different from the first snapshot information.
Therefore, the application deployment device identifies the first configuration item and the second configuration item which influence the application running result through two snapshot comparisons, so that a more reliable correction production environment is constructed for the application subsequently.
In one possible design, modifying the configuration item content of the initial production environment according to the first configuration item and the second configuration item to obtain a modified production environment includes: if the first configuration item and the second configuration item do not have a common configuration item, copying the first configuration item into the content of the configuration item to obtain a modified production environment, wherein the common configuration item is an intersection of the first configuration item and the second configuration item.
Or, modifying the configuration item content of the initial production environment according to the first configuration item and the second configuration item to obtain a modified production environment, including: if the first configuration item and the second configuration item do not have a common configuration item, searching a replacement configuration item corresponding to the first configuration item in a preset configuration dictionary, wherein the common configuration item is an intersection of the first configuration item and the second configuration item; and copying the searched replacement configuration item corresponding to the first configuration item into the configuration item content to obtain a modified production environment.
Correspondingly, if the first configuration item and the second configuration item include a common configuration item, the method further includes: and copying the configuration items except the public configuration item in the first configuration item into the configuration item content of the initial production environment to obtain the corrected production environment.
In one possible design, after copying configuration items other than the common configuration item in the first configuration item into the configuration item content of the initial production environment, the method further includes: searching a replacement configuration item corresponding to the common configuration item in a preset configuration dictionary; and copying the searched replacement configuration item corresponding to the public configuration item into the configuration item content to obtain a corrected production environment.
In one possible design, after modifying the configuration item content of the initial production environment according to the first configuration item and the second configuration item, the method further includes: testing the corrected production environment; if the test result does not conform to the preset test result, the snapshot of the initial production environment (i.e., the modified production environment constructed when the application was successfully deployed last time) is stored in advance, so that the modified production environment can be restored to the initial production environment, and the modification and debugging can be performed on the basis of the modified production environment constructed when the application was successfully deployed last time by developers.
In a second aspect, an embodiment of the present invention provides an application deployment apparatus, including: the system comprises an acquisition unit and a processing unit, wherein the acquisition unit is used for acquiring a first configuration item and a second configuration item, the first configuration item is data of which the development environment changes before an executable code of an application is run and after the executable code of the application is run, and the second configuration item is data of which the development environment before the executable code is run is different from an initial production environment; the environment construction unit is used for correcting the configuration item content of the initial production environment according to the first configuration item and the second configuration item to obtain a corrected production environment; a deployment unit to deploy the application into the modified production environment.
In one possible design, the apparatus further includes: the snapshot unit is used for saving first snapshot information of the development environment before the executable code of the application runs in the development environment; after the executable code of the application is successfully run in the development environment, second snapshot information of the development environment is saved; and the comparison unit is used for determining the first configuration item according to the part of the second snapshot information, which is different from the first snapshot information.
In a possible design, the comparison unit is specifically configured to use, as the first configuration item, difference data in the second snapshot information that is different from the first snapshot information, and content of the difference data.
Or the comparing unit is specifically configured to search, according to difference data different from the first snapshot information in the second snapshot information, replacement data corresponding to the difference data in a preset configuration dictionary, where a mapping relationship between the difference data and the replacement data is stored in the configuration dictionary; and taking the searched replacement data corresponding to the difference data as a first configuration item.
In one possible design, the snapshot unit is further configured to save third snapshot information of the initial production environment before the executable code of the application is run in the initial production environment; the comparing unit is further configured to determine the second configuration item according to a portion of the third snapshot information that is different from the first snapshot information.
In a possible design, the environment construction unit is specifically configured to copy the first configuration item to the content of the configuration item to obtain a modified production environment if there is no common configuration item in the first configuration item and the second configuration item, where the common configuration item is an intersection of the first configuration item and the second configuration item.
In a possible design, the environment construction unit is specifically configured to, if there is no common configuration item in the first configuration item and the second configuration item, look up a replacement configuration item corresponding to the first configuration item in a preset configuration dictionary, where the common configuration item is an intersection of the first configuration item and the second configuration item; and copying the searched replacement configuration item corresponding to the first configuration item into the configuration item content to obtain the corrected production environment.
In a possible design, the environment construction unit is further configured to, if the first configuration item and the second configuration item include a common configuration item, copy the configuration items except the common configuration item in the first configuration item to the configuration item content of the initial production environment, so as to obtain a modified production environment.
In a possible design, the environment constructing unit is further configured to search a preset configuration dictionary for a replacement configuration item corresponding to the common configuration item; and copying the searched replacement configuration item corresponding to the public configuration item into the configuration item content to obtain a corrected production environment.
In one possible design, the apparatus further includes: the test unit is used for testing the corrected production environment; and the rollback unit is used for restoring the corrected production environment to the initial production environment if the test result does not accord with the preset test result.
In a third aspect, an embodiment of the present invention provides an application management apparatus, where the application management apparatus has a function of implementing a behavior of an application deployment device in the foregoing method. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions.
In one possible design, the structure of the application management device includes a processor and a memory, the memory is used for storing application program codes supporting the application management device to execute the method, and the processor is configured to execute the application program stored in the memory. The application management device may further comprise a communication interface for the management device to communicate with other devices or a communication network.
In a fourth aspect, an embodiment of the present invention provides a computer storage medium for storing computer software instructions for the application deployment apparatus, which includes a program designed for executing the above aspect to manage a device.
In the present invention, the name of the application deployment apparatus does not limit the devices themselves, and in actual implementation, the devices may appear by other names. Provided that the respective devices function similarly to the present invention, are within the scope of the claims of the present invention and their equivalents.
In addition, the technical effects brought by any one of the design manners of the second aspect to the fourth aspect can be referred to the technical effects brought by different design manners of the first aspect, and are not described herein again.
These and other aspects of the invention are apparent from and will be elucidated with reference to the embodiments described hereinafter.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic structural diagram of an application deployment apparatus according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an application deployment apparatus according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of an application deployment method according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an application management device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
In addition, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless otherwise specified.
The embodiment of the invention provides an application deployment method which can be applied to application development and deployment processes based on a DevOps (development, operation and maintenance integration, which is a general term for a group of processes, methods and systems) technology.
Specifically, an internet application may use multiple development languages and development modes to complete the writing and development of source codes, and meanwhile, in order to enable the application to operate correctly, configuration item content of an operating environment where the application is located needs to be set, for example, a modification script of the application, and the like.
However, scale differences, deployment area differences, and the like may exist between the development environment and the production environment of an application, and therefore, after a developer successfully runs the application in the development environment, it cannot be guaranteed that the application can be successfully run in the production environment of an actual production, and therefore, when the production environment is constructed, the developer usually identifies and sets a configuration item in the content of the configuration item in advance, which may affect the running result of the application, and such manual deployment and debugging may not only cause a problem of repeated investment, but also increase the risk of application deployment failure for an application scenario in which the application version is updated more frequently and the application deployment scale is larger.
In contrast, the application deployment method and the application deployment device provided by the embodiment of the invention can automatically identify the configuration items influencing the application operation result by comparing the operation environments before and after the application is developed, so that a more reliable production environment is constructed, an effective feedback regulation mechanism is formed in the application deployment process, and the risk of application deployment failure is reduced.
The application deployment method provided in the embodiment of the present invention can be applied to the application deployment apparatus 100 shown in fig. 1, where the application deployment apparatus 100 includes a snapshot unit 11, a comparison unit 12 connected to the snapshot unit 11, an environment construction unit 02 connected to the comparison unit 12, and a deployment unit 03 connected to the environment construction unit 02, where the environment construction unit 02 may also be connected to a version library 04 that stores applications of various versions.
Specifically, as shown in fig. 2, the snapshot unit 11 may store first snapshot information of the development environment before development, that is, before the application executable code is run, and store second snapshot information of the development environment after development, that is, after the application executable code is successfully run, at this time, the comparison unit 12 is configured to compare the first snapshot information and the second snapshot information stored in the snapshot unit 11, and identify a first configuration item required for successful running of the application in the development environment, and further, in a deployment preparation stage, the snapshot unit 11 may also store third snapshot information of the initial production environment; the comparison unit 12 may be configured to compare different information between the first snapshot information and the third snapshot information, identify a second configuration item required for successful operation of the application in the initial production environment, and output the first configuration item and the second configuration item to the environment construction unit 02, so that, in the deployment phase, the environment construction unit 02 sets a configuration item content in the initial production environment according to the first configuration item and the second configuration item, obtains application software from the version library 04, executes an automatic construction function, obtains a modified production environment after modification, and finally, the deployment unit 03 deploys the application to the modified production environment to complete application deployment.
It can be seen that if the development environment is consistent with the initial production environment, the first configuration item can be directly set in the configuration item content of the initial production environment to obtain the corrected production environment, so that the application can be successfully operated in the corrected production environment; when the development environment is inconsistent with the initial production environment, the first configuration item and the second configuration item need to be set in the configuration item content of the initial production environment at the same time to obtain a corrected production environment, so that the application is deployed in the corrected production environment, and the application can be successfully operated.
The snapshot unit 11 and the comparison unit 12 may also be replaced by the obtaining unit 01, and in this case, the obtaining unit 01 is configured to provide configuration items, such as the first configuration item and the second configuration item, which affect the running result of the application, to the environment construction unit 02.
In addition, the corrected production environment obtained during the application deployment can be used as the initial production environment during the next application deployment, and further, each configuration item during the next application deployment can be obtained through the snapshot unit 11 and the comparison unit 12, so that an effective feedback adjustment mechanism is realized to repeatedly deploy the application.
Further, as also shown in fig. 1, the application deployment apparatus 100 may further include a testing unit 05 and a rollback unit 06, where the testing unit 05 may be configured to test the built modified production environment to verify whether the modified production environment is normal; at this time, if the test result is not normal, since the snapshot unit 11 stores the snapshot of the initial production environment (i.e., the corrected production environment constructed when the application was successfully deployed last time), the rollback unit 06 may be configured to restore the corrected production environment to the initial production environment, so that the developer may modify and debug based on the corrected production environment constructed when the application was successfully deployed last time.
It should be noted that, in the example of the present invention, each functional unit in the application deployment apparatus 100, for example, the snapshot unit 11, the comparison unit 12, the environment construction unit 02, and the like, may be integrated in one entity device in the form of a logic functional module, or each functional unit may be respectively arranged in one or more entity devices in the form of a logic functional module, at this time, the application deployment apparatus 100 implements the application deployment method in the form of a system, which is not limited in this embodiment of the present invention.
Further, in order to more clearly describe the application deployment method provided by the embodiment of the present invention, a logic function module is used as an execution subject in the following description, and it can be understood by those skilled in the art that the logic function module needs to depend on hardware resources on the entity device where the logic function module is located when being specifically implemented.
Based on the application deployment apparatuses shown in fig. 1 and fig. 2, an embodiment of the present invention provides an application deployment method, and as shown in fig. 3, the application deployment method includes:
101. the application deployment device saves first snapshot information of the development environment prior to running executable code of the application within the development environment.
102. After successfully running the executable code of the application in the development environment, the application deployment device saves the second snapshot information of the development environment.
103. The application deployment device compares the first snapshot information with the second snapshot information, and determines a first configuration item according to a part of the second snapshot information, which is different from the first snapshot information.
104. Before the executable code of the application is run in the initial production environment, the application deployment device saves the third snapshot information of the initial production environment.
105. And the application deployment device compares the first snapshot information with the third snapshot information, and determines a second configuration item according to a part of the third snapshot information, which is different from the first snapshot information.
106. The application deployment device judges whether the first configuration item and the second configuration item contain a common configuration item, wherein the common configuration item is an intersection of the first configuration item and the second configuration item.
And 107a, if the public configuration items are included, copying the configuration items except the public configuration items in the first configuration items into the configuration item content of the initial production environment by the application deployment device.
108a, the (optional) application deployment device searches a preset configuration dictionary for a replacement configuration item corresponding to the common configuration item; and copying the searched replacement configuration item corresponding to the public configuration item into the configuration item content to obtain a modified production environment.
And 107b, if the public configuration item is not included, the application deployment device copies the first configuration item into the configuration item content of the initial production environment to obtain the corrected production environment. Or,
108b, if the public configuration item is not included, the application deployment device searches a replacement configuration item corresponding to the first configuration item in a preset configuration dictionary; and copying the searched replacement configuration item corresponding to the first configuration item into the configuration item content to obtain the corrected production environment.
109. And the application deployment device deploys the application to the correction production environment.
110. And testing the modified production environment by using a deployment device.
111. And if the test result does not accord with the preset test result, the corrected production environment is restored to the initial production environment by using the deployment device.
The development environment refers to an environment used by a developer of an application in a process of compiling and testing a source code, and for example, a test server or a test mobile phone used for developing the application a.
In step 101, before the executable code of the application is run in the development environment, the snapshot unit 11 may snapshot the development environment at this time to obtain first snapshot information of the development environment.
For example, when a developer writes and runs an executable code of an application of a web service using a computer, the computer may serve as a development environment, and before the executable code of the web service is run on the computer, the snapshot unit 11 may completely save all information of the development environment (i.e., the computer) by a data replication means such as a file backup or a database backup technique, so as to obtain the first snapshot information.
For another example, when a developer uses a computer to write a mobile phone APP (Application), the computer used by the developer is not considered as the development environment, only the used test mobile phone is the development environment, and before the executable code of the mobile phone APP is run on the test mobile phone, the snapshot unit 11 may completely save all information of the development environment (i.e., the test mobile phone) through data copy means such as mobile phone system backup, file backup, memory export, and the like, to obtain first snapshot information.
Furthermore, a developer may write, compile, debug, and the like, the source code of the application in the development environment, and after the application runs successfully in the development environment, in step 102, the snapshot unit 11 may snapshot the development environment again to obtain second snapshot information of the development environment.
For example, when the web service or the mobile phone APP can successfully run in the development environment, similarly, the snapshot unit 11 may completely save all information of the computer (or the mobile phone) by using data copying means such as file backup, database backup, and memory export technology, so as to obtain second snapshot information.
Then, in step 103, the comparing unit 12 may further compare the first snapshot information with the second snapshot information to find data (i.e., difference data) in the second snapshot information, which is different from the first snapshot information, for example, after the comparison, it may find that parameters in the second snapshot information are increased or decreased, or values of the parameters are changed, or that a certain file (e.g., executable code, library file, etc.) is increased or deleted, and further, determine a first configuration item, that is, a configuration item required for the application to successfully run in the development environment, according to the data in the second snapshot information, which is different from the first snapshot information.
For example, as shown in table 1, by comparing the first snapshot information and the second snapshot information, it can be determined that the value of the parameter A, B is changed before and after the application is successfully run, and the file C is also added after the application is successfully run, at this time, in step 103, the difference data of the values of the parameter A, B, the file C, the parameter A, B, and the file C in the second snapshot information may be used as the first configuration item, that is, to successfully run the application, it is necessary to change the value of the parameter A, B in the development environment, and add the file C.
TABLE 1
Before development After development
Parameter (or file) name First snapshot information Second snapshot information
Parameter A 1010 1111
Parameter B 1100 0011
File C 1100
Parameter D 0101 0101
Still alternatively, after comparing the first snapshot information with the second snapshot information, the comparing unit 12 may determine that data (i.e., difference data) that changes in the first snapshot information and the second snapshot information, for example, values of the parameters a and B change, and a file C is newly added to the second snapshot information, at this time, the parameter A, B, C is the difference data, then the comparing unit 12 may further search, in a preset configuration dictionary, for replacement data corresponding to the difference data according to the identifier and/or the type of the difference data, for example, the replacement data of the parameter a is 1110; and then, the searched replacement data corresponding to the difference data is used as a first configuration item.
The configuration dictionary stores at least one piece of data (such as any parameter, configuration item, file or program) in advance, and a value rule of replacement data or replacement configuration corresponding to each piece of data in a production environment, that is, a mapping relationship between each piece of data and the replacement data of the piece of data is stored, for example, a replacement configuration item of the configuration item Y is a configuration item M; the parameter a indicates the memory size, and the value rule for storing the parameter a in the configuration dictionary is as follows: and multiplying the value of the parameter A in the second snapshot information by 5 to serve as the value of the parameter A in the first configuration item, namely setting the size of the memory to be 5 times of the value of the parameter A in the second snapshot information when the application is operated in the production environment.
Since the environment in which the application actually runs (i.e. the production environment) usually has many differences from the development environment, if the application is intended to successfully run in the production environment, not only the executable code of the application needs to be installed in the production environment, but also the configuration item content of the production environment in which the application runs needs to be set accordingly, that is, after the application successfully runs in the development environment, a reliable production environment needs to be built for the application, and this stage can be referred to as a deployment preparation stage of the application.
In the embodiment of the present invention, the production environment before construction is referred to as an initial production environment, and the production environment formed after construction is referred to as a modified production environment.
Specifically, in the deployment preparation phase, as described in step 104, before the executable code of the application is run in the initial production environment, the snapshot unit 11 may save the third snapshot information of the initial production environment.
Further, in step 105, the comparison unit 12 compares the above-described third snapshot information with the first snapshot information stored in step 101, that is, compares the difference between the development environment before development and the initial production environment by the first snapshot information and the third snapshot information. For example, after comparison, it can be found that the parameter in the third snapshot information is increased or decreased, or the value of the parameter is changed, or a certain file (e.g., executable code, library file, etc.) is increased or deleted.
It can be understood that, if the first snapshot information and the third snapshot information are completely the same, it indicates that the initial production environment is the same as the development environment before the application is run, and at this time, in order to enable the application to run successfully in the initial production environment, only the configuration item content of the initial production environment needs to be modified according to the first configuration item obtained in step 103, so that a modified production environment can be constructed.
For example, when the first snapshot information and the third snapshot information are completely the same, the values of the parameter A, B and the file C in the second snapshot information in table 1 may be covered with the values of the corresponding parameter A, B and the file C in the third snapshot information, so that the modified production environment may be constructed.
However, the development environment is generally different from the initial production environment, for example, there may be only one device in the development environment, and the initial production environment may be composed of thousands of devices, in this case, similarly to step 103, the comparison unit 12 may determine the second configuration item, that is, the configuration parameter that needs to be preserved when the application is successfully run in the initial production environment, according to the part of the third snapshot information that is different from the first snapshot information.
For example, a portion of the third snapshot information that is different from the first snapshot information, that is, the changed difference data, may be directly used as the second configuration item.
For example, as shown in table 2, by comparing the first snapshot information and the third snapshot information, it may be determined that a value of the parameter a is changed, that is, the parameter a may reflect a parameter of an inherent attribute of the initial production environment compared to the development environment before development, that is, the parameter a is necessary for the application to successfully run in the initial production environment, for example, when the parameter a is IP address information, IP address information in the first snapshot information and IP address information in the third snapshot information are different, and if the IP address information in the first snapshot information is singly copied to the third snapshot information, the application may not run normally in the initial production environment.
At this time, the value of the parameter a in the third snapshot information may be used as the second configuration item, that is, to successfully run the application in the initial production environment, the parameter a in the third snapshot information needs to be retained.
TABLE 2
Before development Deployment preparation phase
Parameter (or file) name First snapshot information Third Snapshot information
Parameter A 1010 1111
Parameter B 1100 1100
File C
Parameter D 0101 0101
Still alternatively, after comparing the first snapshot information and the third snapshot information, the comparing unit 12 may determine difference data that changes between the third snapshot information and the first snapshot information, for example, the parameter a, so that, since the configuration dictionary stores the replacement data or the value rule of the replacement data corresponding to the parameter a in the production environment, the comparing unit 12 may further search the configuration dictionary for the replacement data corresponding to the difference data; and then, the searched replacement data corresponding to the difference data is used as a second configuration item.
Thus, through the above-mentioned step 101-105, the application deployment device can identify the first configuration item and the second configuration item that affect the application running result through two snapshot comparisons, so that the subsequent environment construction unit 02 constructs a more reliable modified production environment for the application.
Further, in step 106, the environment construction unit 02 determines whether there is a same configuration item (referred to as a common configuration item in the embodiment of the present invention) in the first configuration item and the second configuration item according to the first configuration item and the second configuration item obtained by the comparison unit 12, that is, the common configuration item is an intersection of the first configuration item and the second configuration item.
For example, in the first configuration item and the second configuration item indicated in tables 1 and 2, since the parameter a is an intersection of the first configuration item and the second configuration item, the parameter a may serve as the common configuration item described above.
Furthermore, if the first configuration item and the second configuration item include a common configuration item, the steps 107a to 108a are executed; if the first configuration item and the second configuration item do not include the common configuration item, the above step 107b or 108b is performed.
Specifically, in step 107a, if the first configuration item and the second configuration item include the common configuration item, for example, the parameter a, then the environment construction unit 02 may retain the parameter a in the configuration item content of the initial production environment, that is, the parameter a in the third snapshot information, and copy the values of the other configuration items, for example, the parameter B, the file C, the parameter B, and the file C, in the first configuration item except the common configuration item, to the configuration item content of the initial production environment, so as to construct the modified production environment.
Further, optionally, for a common configuration item in the first configuration item and the second configuration item, in step 108a, the environment construction unit 02 may also look up a replacement configuration corresponding to the common configuration item in the configuration dictionary; and copying the searched replacement configuration corresponding to the public configuration item into the content of the configuration item to obtain a corrected production environment.
Accordingly, if the common configuration item is not included in the first configuration item and the second configuration item, in step 107b, the environment construction unit 02 may directly copy the first configuration item to the configuration item content of the initial production environment, so as to construct the modified production environment.
Or, if the first configuration item and the second configuration item do not include the common configuration item, in step 108b, the environment construction unit 02 may search the configuration dictionary for a replacement configuration corresponding to the first configuration item; and copying the searched replacement configuration corresponding to the first configuration item into the configuration item content to obtain a modified production environment.
Finally, in step 109, the deployment unit 03 may obtain the source code of the application from the version library 04, compile the source code to obtain an executable code, and deploy the executable code to the built modified production environment, thereby implementing the function of automatically deploying the application on line.
Further optionally, the application deployment apparatus may further set the testing unit 05 to test the modified production environment, for example, to try to run the executable code of the application in the modified production environment, so as to detect whether the modified production environment constructed in the step is normal.
Furthermore, in step 111, if the test result does not meet the preset test result, the rollback unit 06 may be further configured to restore the modified production environment to the initial production environment, where the initial production environment is the modified production environment constructed when the application was successfully deployed last time, and therefore, after being restored to the initial production environment, the developer is convenient to modify and debug on the basis of the modified production environment when the application was successfully deployed last time.
The invention provides an application deployment method, which can obtain a first configuration item and a second configuration item which need to be set when an application is successfully run, wherein the first configuration item is data of a development environment which changes before an executable code of the application is run and after the executable code of the application is run, and the second configuration item is data of a development environment before the executable code is run and different from an initial production environment; in this way, the application deployment device modifies the configuration item content of the initial production environment according to the first configuration item and the second configuration item, and a modified production environment with higher reliability can be constructed.
In addition, the application deployment apparatus 100 provided in the embodiment of the present invention may be applied to any application management device capable of implementing application deployment, as shown in fig. 4, which is a schematic structural diagram of an application management device 200 provided in the embodiment of the present invention, and the application management device 200 provided in the embodiment of the present invention may be used to implement the method implemented in each embodiment of the present invention shown in fig. 4.
The application management device 200 includes at least one processor 11, a communication bus 12, a memory 13, and at least one communication interface 14.
For example, the functions of the comparison unit 12, the environment construction unit 02, the test unit 05 and the rollback unit 06 in fig. 1 may be executed by the processor 11; and snapshot information stored within snapshot unit 11 may be stored within memory 13.
The processor 11 may be a general purpose Central Processing Unit (CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs in accordance with the inventive arrangements.
The communication bus 12 may include a path to transfer information between the aforementioned components. The communication interface 14 may be any device, such as a transceiver, for communicating with other devices or communication Networks, such as ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
The memory 13 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a Random Access Memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (electrically erasable) memory
But is not limited to, Programmable Read-Only Memory, EEPROM), Compact Disc Read-Only Memory (CD-ROM) or other optical disk storage, optical disk storage (including Compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be self-contained and coupled to the processor via a communication bus. The memory may also be integral to the processor.
Wherein, the memory 13 is used for storing application program codes for executing the scheme of the invention and is controlled by the processor 11 to execute. The processor 11 is configured to execute application program code stored in the memory 13.
In particular implementations, processor 11 may include one or more CPUs, such as CPU0 and CPU1 of FIG. 4, for example, as an example.
In particular implementations, application management device 200 may include multiple processors, such as processor 11 and processor 18 in FIG. 4, as one embodiment. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In a specific implementation, the application management device 200 may further include an output device 15 and an input device 16, as an embodiment. The output device 15 is in communication with the processor 11 and may display information in a variety of ways. For example, the output device 15 may be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display device, a Cathode Ray Tube (CRT) display device, a projector (projector), or the like. The input device 16 is in communication with the processor 11 and can accept user input in a variety of ways. For example, the input device 16 may be a mouse, a keyboard, a touch screen device or a sensing device, and the like.
The application management device 200 may be a general-purpose computer device or a special-purpose computer device. In a specific implementation, the application management device 200 may be a desktop computer, a portable computer, a web server, a Personal Digital Assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, an embedded device, or a device with a similar structure as in fig. 4. The embodiment of the present invention does not limit the type of the application management apparatus 200.
It should be noted that, since each functional unit in fig. 1, such as the snapshot unit 11, the comparison unit 12, and the environment construction unit 02, may be respectively disposed in one or more entity devices in the form of a logical functional module, a plurality of application management devices 200 as shown in fig. 4 may be disposed to respectively implement the function of each functional unit in the deployment apparatus 100 in fig. 1.
For example, the first application management device may be configured to execute a corresponding function of the snapshot unit 11, the second application management device may be configured to execute a corresponding function of the comparison unit 12, the third application management device may be configured to execute a corresponding function of the environment construction unit 02, and the fourth application management device may be configured to execute corresponding functions of the test unit 05 and the rollback unit 06, which is not limited in this embodiment of the present invention.
The application management device can obtain a first configuration item and a second configuration item which need to be set when an application is successfully run, wherein the first configuration item is data of which a development environment changes before an executable code of the application is run and after the executable code of the application is run, and the second configuration item is data of which the development environment before the executable code is run is different from an initial production environment; in this way, the application deployment device modifies the configuration item content of the initial production environment according to the first configuration item and the second configuration item, and a modified production environment with higher reliability can be constructed.
It will be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (20)

1. An application deployment method, comprising:
acquiring a first configuration item, wherein the first configuration item is data of a development environment which changes before an executable code of an application is run and after the executable code of the application is run;
acquiring a second configuration item, wherein the second configuration item is data which is different between a development environment and an initial production environment before the executable code is operated;
correcting the configuration item content of the initial production environment according to the first configuration item and the second configuration item to obtain a corrected production environment;
deploying the application into the modified production environment.
2. The method of claim 1, wherein obtaining a first configuration item comprises:
saving first snapshot information of the development environment before running executable code of the application in the development environment;
after the executable code of the application is successfully run in the development environment, saving second snapshot information of the development environment;
and determining the first configuration item according to the part of the second snapshot information, which is different from the first snapshot information.
3. The method of claim 2, wherein determining the first configuration item from a portion of the second snapshot information that is different from the first snapshot information comprises:
and taking the difference data in the second snapshot information different from the first snapshot information as a first configuration item.
4. The method of claim 2, wherein determining the first configuration item from a portion of the second snapshot information that is different from the first snapshot information comprises:
according to the difference data different from the first snapshot information in the second snapshot information, searching for replacement data corresponding to the difference data in a preset configuration dictionary, wherein the configuration dictionary stores a mapping relation between the difference data and the replacement data;
and taking the searched replacement data corresponding to the difference data as a first configuration item.
5. The method of any of claims 2-4, wherein obtaining a second configuration item comprises:
saving third snapshot information of the initial production environment prior to running the application's executable code in the initial production environment;
and determining the second configuration item according to a part of the third snapshot information, which is different from the first snapshot information.
6. The method according to any one of claims 1-4, wherein modifying the configuration item content of the initial production environment according to the first configuration item and the second configuration item, resulting in a modified production environment, comprises:
if the first configuration item and the second configuration item do not have a common configuration item, copying the first configuration item to the content of the configuration item to obtain a modified production environment, wherein the common configuration item is an intersection of the first configuration item and the second configuration item.
7. The method according to any one of claims 1-4, wherein modifying the configuration item content of the initial production environment according to the first configuration item and the second configuration item, resulting in a modified production environment, comprises:
if the first configuration item and the second configuration item do not have a common configuration item, searching a replacement configuration item corresponding to the first configuration item in a preset configuration dictionary, wherein the common configuration item is an intersection of the first configuration item and the second configuration item, and the configuration dictionary stores a corresponding relation between the first configuration item and the replacement configuration item;
and copying the searched replacement configuration item corresponding to the first configuration item into the configuration item content to obtain a corrected production environment.
8. The method of claim 6, wherein if the first configuration item and the second configuration item include a common configuration item, further comprising:
copying the configuration items except the public configuration item in the first configuration item into the configuration item content of the initial production environment to obtain a corrected production environment.
9. The method of claim 8, further comprising, after copying configuration items of the first configuration items other than the common configuration item into configuration item content of the initial production environment:
searching a replacement configuration item corresponding to the common configuration item in a preset configuration dictionary, wherein the configuration dictionary stores the corresponding relation between the common configuration item and the replacement configuration item;
and copying the searched replacement configuration item corresponding to the public configuration item into the configuration item content to obtain a corrected production environment.
10. The method of any of claims 1-4, further comprising, after modifying configuration item content of the initial production environment according to the first configuration item and the second configuration item:
testing the corrected production environment;
and if the test result does not accord with the preset test result, restoring the corrected production environment to the initial production environment.
11. An application deployment apparatus, comprising:
the system comprises an acquisition unit and a processing unit, wherein the acquisition unit is used for acquiring a first configuration item and a second configuration item, the first configuration item is data of which a development environment changes before an executable code of an application is run and after the executable code of the application is run, and the second configuration item is data of which the development environment before the executable code is run is different from an initial production environment;
the environment construction unit is used for correcting the configuration item content of the initial production environment according to the first configuration item and the second configuration item to obtain a corrected production environment;
a deployment unit to deploy the application into the modified production environment.
12. The apparatus of claim 11, further comprising:
the snapshot unit is used for saving first snapshot information of the development environment before the executable code of the application runs in the development environment; and saving second snapshot information of the development environment after the executable code of the application is successfully run in the development environment;
and the comparison unit is used for determining the first configuration item according to the part, different from the first snapshot information, in the second snapshot information.
13. The apparatus of claim 12,
the comparing unit is specifically configured to use difference data in the second snapshot information, which is different from the first snapshot information, as a first configuration item.
14. The apparatus of claim 12,
the comparison unit is specifically configured to search, according to difference data in the second snapshot information, which is different from the first snapshot information, for replacement data corresponding to the difference data in a preset configuration dictionary, where a mapping relationship between the difference data and the replacement data is stored in the configuration dictionary; and taking the searched replacement data corresponding to the difference data as a first configuration item.
15. The apparatus of any one of claims 12-14,
the snapshot unit is further configured to save third snapshot information of the initial production environment before the executable code of the application is run in the initial production environment;
the comparing unit is further configured to determine the second configuration item according to a portion of the third snapshot information that is different from the first snapshot information.
16. The apparatus according to any one of claims 11-14,
the environment construction unit is specifically configured to copy the first configuration item to the configuration item content to obtain a modified production environment if there is no common configuration item in the first configuration item and the second configuration item, where the common configuration item is an intersection of the first configuration item and the second configuration item.
17. The apparatus according to any one of claims 11-14,
the environment construction unit is specifically configured to, if there is no common configuration item in the first configuration item and the second configuration item, look up a replacement configuration item corresponding to the first configuration item in a preset configuration dictionary, where the common configuration item is an intersection of the first configuration item and the second configuration item, and the configuration dictionary stores a corresponding relationship between the first configuration item and the replacement configuration item; and copying the searched replacement configuration item corresponding to the first configuration item into the configuration item content to obtain a corrected production environment.
18. The apparatus of claim 16,
the environment construction unit is further configured to copy, if the first configuration item and the second configuration item include a common configuration item, a configuration item in the first configuration item except the common configuration item to the configuration item content of the initial production environment, so as to obtain a modified production environment.
19. The apparatus of claim 18,
the environment construction unit is further configured to search a preset configuration dictionary for a replacement configuration item corresponding to the common configuration item, where the configuration dictionary stores a corresponding relationship between the common configuration item and the replacement configuration item; and copying the searched replacement configuration item corresponding to the public configuration item into the configuration item content to obtain a corrected production environment.
20. The apparatus according to any one of claims 11-14, further comprising:
the test unit is used for testing the corrected production environment;
and the rollback unit is used for restoring the corrected production environment to the initial production environment if the test result does not accord with the preset test result.
CN201610408133.1A 2016-06-12 2016-06-12 A kind of application dispositions method and device Active CN106095501B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610408133.1A CN106095501B (en) 2016-06-12 2016-06-12 A kind of application dispositions method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610408133.1A CN106095501B (en) 2016-06-12 2016-06-12 A kind of application dispositions method and device

Publications (2)

Publication Number Publication Date
CN106095501A CN106095501A (en) 2016-11-09
CN106095501B true CN106095501B (en) 2019-05-03

Family

ID=57228754

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610408133.1A Active CN106095501B (en) 2016-06-12 2016-06-12 A kind of application dispositions method and device

Country Status (1)

Country Link
CN (1) CN106095501B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109840194B (en) * 2017-11-28 2022-07-08 网宿科技股份有限公司 Method and system for detecting configuration file
CN108039975B (en) * 2017-12-21 2020-08-28 北京搜狐新媒体信息技术有限公司 Container cluster management system and application method thereof
CN108153676B (en) * 2017-12-26 2021-08-20 Oppo广东移动通信有限公司 Debugging management method and device, storage medium and terminal equipment
CN110019145B (en) * 2018-06-19 2021-09-14 杭州数澜科技有限公司 Multi-environment cascading method and device for big data platform
CN109165018A (en) * 2018-09-10 2019-01-08 深圳市泰洲科技有限公司 Code method for automatically releasing, device, computer equipment and storage medium
CN109818948B (en) * 2019-01-16 2020-04-10 星环信息科技(上海)有限公司 Application deployment method, device, system, equipment and medium
CN113778460A (en) * 2021-09-08 2021-12-10 中国银行股份有限公司 Production environment deployment method and device
CN114281428B (en) * 2021-12-28 2024-06-04 挂号网(杭州)科技有限公司 Service dictionary configuration method, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101932999A (en) * 2007-12-20 2010-12-29 汇丰技术股份有限公司 Automated methods and systems for developing and deploying projects in parallel

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6510466B1 (en) * 1998-12-14 2003-01-21 International Business Machines Corporation Methods, systems and computer program products for centralized management of application programs on a network
US9588749B2 (en) * 2014-10-14 2017-03-07 Microsoft Technology Licensing, Llc Configuration transform for application deployment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101932999A (en) * 2007-12-20 2010-12-29 汇丰技术股份有限公司 Automated methods and systems for developing and deploying projects in parallel

Also Published As

Publication number Publication date
CN106095501A (en) 2016-11-09

Similar Documents

Publication Publication Date Title
CN106095501B (en) A kind of application dispositions method and device
US9665365B2 (en) Transparently upgrading derived database objects
US9417985B2 (en) Distributed analysis and attribution of source code
US10019256B2 (en) Systems and methods for incremental software development
US8832028B2 (en) Database cloning
US20090319552A1 (en) Software merging utility
US9715440B2 (en) Test scope determination based on code change(s)
US11099828B2 (en) Updating a metadata structure for a firmware update
CN104679500B (en) Method and device for realizing automatic generation of entity class
CN112711403B (en) Method, device, computer equipment and storage medium for synchronizing game development
US12019538B2 (en) Software application build testing
CN111158730B (en) System updating method, device, electronic equipment and readable storage medium
US20220350593A1 (en) Adaptive hot reload for class changes
US8738569B1 (en) Systematic verification of database metadata upgrade
US20070185929A1 (en) Method and apparatus for processing monitoring
US20170329698A1 (en) System and Method for Provisioning a Virtual Machine Test Environment
CN109558121B (en) Interface driver development method, device, equipment and storage medium
EP2913758B1 (en) Loop abstraction for model checking
WO2012104991A1 (en) Program test method, program test system, and program
US10146664B2 (en) Virtual test environment for webpages with automation features
US12079111B2 (en) Automatic detection of software deployment errors
US20240103853A1 (en) Code maintenance system
Li et al. ElasticNotebook: Enabling Live Migration for Computational Notebooks
US20240354102A1 (en) Techniques for incremental software build
US20230359547A1 (en) Targeted Testing for Modular Software Applications

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200214

Address after: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee after: HUAWEI TECHNOLOGIES Co.,Ltd.

Address before: 210012 HUAWEI Nanjing base, 101 software Avenue, Yuhuatai District, Jiangsu, Nanjing

Patentee before: Huawei Technologies Co.,Ltd.

TR01 Transfer of patent right