CN109739539B - Cross-environment application release method, device, equipment and storage medium - Google Patents

Cross-environment application release method, device, equipment and storage medium Download PDF

Info

Publication number
CN109739539B
CN109739539B CN201811617268.4A CN201811617268A CN109739539B CN 109739539 B CN109739539 B CN 109739539B CN 201811617268 A CN201811617268 A CN 201811617268A CN 109739539 B CN109739539 B CN 109739539B
Authority
CN
China
Prior art keywords
application
publishing
environment
subsystem
version
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
CN201811617268.4A
Other languages
Chinese (zh)
Other versions
CN109739539A (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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201811617268.4A priority Critical patent/CN109739539B/en
Publication of CN109739539A publication Critical patent/CN109739539A/en
Application granted granted Critical
Publication of CN109739539B publication Critical patent/CN109739539B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a cross-environment application release method, which comprises the following steps: when an application is published in a certain subsystem of a source environment, judging whether the subsystem meets a preset cross-environment publishing rule; if yes, acquiring a released application version and a preset release mode corresponding to the subsystem; acquiring an application publishing packet to be synchronized according to the published application version and the publishing mode; and acquiring a publishing template instance corresponding to the application publishing package to be synchronized, and submitting the application publishing package to be synchronized and the publishing template instance to a preset target environment so as to enable the target environment to generate corresponding application publishing operation. The invention also discloses a cross-environment application release device, equipment and a storage medium. The invention realizes the automatic synchronous release of the cross-environment application and avoids consuming more computing resources.

Description

Cross-environment application release method, device, equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a cross-environment application publishing method, apparatus, device, and storage medium.
Background
With the continuous development of computer software technology, in order to make an application have more powerful functions and better performance, the version of the application is often required to be continuously updated. In the prior art, a file-based increment issuing method is commonly used, increment files among application issuing packages are calculated, an increment upgrading list is generated according to the increment files, and then the increment upgrading list is issued to a client side for increment upgrading. Such as: the distribution bag V1 contains files f1, f2, the distribution bag V2 contains files f1, f2, f3, the distribution bag V3 contains files f1, f3, f 4; Δ V1 is a delta package of files V1 to V2, containing f3, Δ V2 is a delta package of files V2 to V3, containing-f 2 and f 4; the machine H1 needs to be upgraded from V1 to V2 only by updating the Δ V1, and the machine H2 needs to be upgraded from V2 to V3 only by updating the Δ V2.
The disadvantages of the above-mentioned method are: 1) automatic deployment across environments cannot be performed; 2) the granularity is as fine as the file level, and more computing resources are consumed for computing the increment files among the distribution packages.
Disclosure of Invention
The invention mainly aims to provide a cross-environment application release method, a device, equipment and a storage medium, aiming at realizing the automatic synchronous release of cross-environment applications and avoiding consuming more computing resources.
In order to achieve the above object, the present invention provides a cross-environment application release method, which includes the following steps:
when an application is published in a certain subsystem of a source environment, judging whether the subsystem meets a preset cross-environment publishing rule;
if yes, acquiring a released application version and a preset release mode corresponding to the subsystem;
acquiring an application publishing packet to be synchronized according to the published application version and the publishing mode;
and acquiring a publishing template instance corresponding to the application publishing package to be synchronized, and submitting the application publishing package to be synchronized and the publishing template instance to a preset target environment so as to enable the target environment to generate corresponding application publishing operation.
Preferably, the step of obtaining the application publishing packet to be synchronized according to the published application version and the publishing mode includes:
when the release mode is a common mode, acquiring an application release package corresponding to the released application version as an application release package to be synchronized;
when the release mode is an increment mode, acquiring each application instance of the subsystem in the target environment;
calculating a to-be-released version path corresponding to each application instance of the subsystem in the target environment according to a preset rule;
and acquiring an application publishing packet corresponding to the application version contained in the path of the version to be published as the application publishing packet to be synchronized.
Preferably, the step of calculating, according to a preset rule, a to-be-released version path corresponding to each application instance of the subsystem in the target environment includes:
acquiring a historical release version path of each application instance of the subsystem in the source environment;
carrying out duplicate removal and merging processing on the historical release version paths of the application instances of the subsystem in the source environment to obtain a longest public path;
acquiring the current version of each application instance of the subsystem in the target environment;
and in the longest public path, taking the current version as a starting point, and taking a historical release version path after the starting point as a to-be-released version path corresponding to each application instance of the subsystem in the target environment.
Preferably, when an application is published in a subsystem of a source environment, the step of determining whether the subsystem meets a preset cross-environment publication rule includes:
when an application is published in a certain subsystem of a source environment, detecting whether versions of all application instances of the subsystem in the source environment are consistent, and if so, judging that the subsystem meets a preset cross-environment publishing rule;
or when an application is published in a certain subsystem of a source environment, detecting whether the version of the application instance of the subsystem in the source environment is changed, and if the version of any application instance of the subsystem in the source environment is changed, judging that the subsystem meets a preset cross-environment publishing rule.
Preferably, the cross-environment application publishing method further comprises:
acquiring an execution state of the application release job in the target environment, and writing the execution state into a preset release record table;
polling the issuing record table, and judging whether a record in an unexecuted completion state exists in the issuing record table;
if the record exists, the current execution state of the application release operation corresponding to the record in the unexecuted completion state is requested from the target environment regularly, and the current execution state is written back to the release record table until the record in the unexecuted completion state does not exist in the release record table.
Preferably, after the step of writing back the current execution state to the issue record table until there is no record in the issue record table in the unexecuted completion state, the method further includes:
summarizing all release information recorded in the release record table within a preset time length to generate a release report;
and sending the release report to the front end of the source environment for displaying.
Preferably, the step of submitting the application publishing package to be synchronized and the publishing template instance to a preset target environment includes:
associating the application publishing packet to be synchronized with the publishing template instance and then adding the application publishing packet to be synchronized into a preset publishing queue;
and calling an application programming interface of the target environment regularly to submit the application publishing packet to be synchronized and the publishing template instance in the publishing queue to a preset target environment.
Preferably, before the step of determining whether a subsystem meets a preset cross-environment publishing rule when an application is published in the subsystem of a source environment, the method further includes:
setting an automatic synchronization release switch of the subsystem in a configuration management database of the source environment;
when receiving a starting instruction triggered based on the automatic synchronous release switch, displaying a selection list comprising a common mode and an incremental mode;
and receiving a selection instruction triggered based on the selection list, and setting an issuing mode corresponding to the subsystem according to the selection instruction.
In order to achieve the above object, the present invention provides a cross-environment application distribution apparatus, including:
the system comprises a judging module, a processing module and a processing module, wherein the judging module is used for judging whether a subsystem meets a preset cross-environment publishing rule when an application is published in a subsystem of a source environment;
the first acquisition module is used for acquiring an application version to be published and a preset publishing mode corresponding to the subsystem if the subsystem meets a preset cross-environment publishing rule;
the second acquisition module is used for acquiring the application release package to be synchronized according to the released application version and the release mode;
and the submitting module is used for acquiring the publishing template instance corresponding to the application publishing package to be synchronized, and submitting the application publishing package to be synchronized and the publishing template instance to a preset target environment so as to enable the target environment to generate corresponding application publishing operation.
Preferably, the second obtaining module further comprises:
a first obtaining unit, configured to obtain, when the release mode is a normal mode, an application release package corresponding to the released application version as an application release package to be synchronized;
a second obtaining unit, configured to obtain, when the publishing mode is an incremental mode, each application instance of the subsystem in the target environment; calculating a to-be-released version path corresponding to each application instance of the subsystem in the target environment according to a preset rule; and acquiring an application publishing packet corresponding to the application version contained in the path of the version to be published as the application publishing packet to be synchronized.
Preferably, the second obtaining unit is further configured to:
acquiring a historical release version path of each application instance of the subsystem in the source environment;
carrying out duplicate removal and merging processing on the historical release version paths of the application instances of the subsystem in the source environment to obtain a longest public path;
acquiring the current version of each application instance of the subsystem in the target environment;
and in the longest public path, taking the current version as a starting point, and taking a historical release version path after the starting point as a to-be-released version path corresponding to each application instance of the subsystem in the target environment.
In addition, to achieve the above object, the present invention further provides a cross-environment application publishing device, including: the cross-environment application publishing program comprises a memory, a processor and a cross-environment application publishing program which is stored on the memory and can run on the processor, wherein the steps of the cross-environment application publishing method are realized when the cross-environment application publishing program is executed by the processor.
In addition, to achieve the above object, the present invention further provides a storage medium having a cross-environment application publishing program stored thereon, wherein the cross-environment application publishing program implements the steps of the cross-environment application publishing method when being executed by a processor.
When an application is published in a certain subsystem of a source environment, whether the subsystem meets a preset cross-environment publishing rule is judged; if yes, acquiring a released application version and a preset release mode corresponding to the subsystem; acquiring an application publishing packet to be synchronized according to the published application version and the publishing mode; and acquiring a publishing template instance corresponding to the application publishing package to be synchronized, and submitting the application publishing package to be synchronized and the publishing template instance to a preset target environment so as to enable the target environment to generate corresponding application publishing operation. According to the method and the device, the source environment automatically acquires the application publishing packages to be synchronized and the corresponding publishing template examples and automatically submits the application publishing packages to the target environment for publishing, manual intervention operation is not needed in the whole process, and incremental files among the publishing packages do not need to be calculated, so that the cross-environment automatic synchronous publishing of the applications is realized, and more computing resources are avoided.
Drawings
FIG. 1 is a schematic diagram of an apparatus architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a cross-environment application publishing method according to a first embodiment of the present invention;
fig. 3 is a system architecture diagram of a source environment according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating environment according to an embodiment of the present invention.
The cross-environment application publishing device in the embodiment of the invention can be a PC or a server device.
As shown in fig. 1, the apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the apparatus shown in fig. 1 is not intended to be limiting of the apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a cross-environment application publishing program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be configured to invoke the cross-environment application publishing program stored in the memory 1005 and perform the operations in the various embodiments of the cross-environment application publishing method described below.
Based on the hardware structure, the embodiment of the cross-environment application release method is provided.
Referring to fig. 2, fig. 2 is a schematic flowchart of a first embodiment of a cross-environment application publishing method according to the present invention, where the method includes:
step S10, when an application is published in a certain subsystem of a source environment, judging whether the subsystem meets a preset cross-environment publishing rule;
in this embodiment, the environment refers to a network environment isolated on a network, which can be used for independently deploying an application architecture, and includes, but is not limited to, a development environment, an integration test environment, a user acceptance test environment, a production environment, a disaster tolerance environment, and the like. The embodiment is used for realizing cross-environment application automatic synchronous release from a source environment to a target environment, for example, the source environment may be a test environment of an application, the target environment may be a production environment of the application, and the source environment and the target environment include the same subsystem.
Referring to fig. 3, fig. 3 is a schematic diagram of a system architecture of a source environment in an embodiment of the present invention, in which the source environment includes an automatic operation and maintenance platform aomp (automation Operations Management platform), a configuration Management database cmdb (configuration Management database), and a plurality of subsystems S1, …, Sn. Wherein, AOMP can implement various functions of automated operation and maintenance, including but not limited to: the application automatically issues, executes commands (or command sets) at a server or a network device (one or more) end, operates a database, runs a timing task, and the like; the CMDB is used for storing configuration items of various equipment assets and application architectures in the IT architecture; subsystem refers to the smallest granularity which can be used for independent release in an IT architecture, and is usually an independent module; typically, a subsystem is actually deployed and published to multiple machines, and each deployment is an application instance.
In this embodiment, when a user triggers an instruction to issue based on a version of an application, the source environment issues the version of the application in one or more user-specified subsystems via AOMP. When an application is published in a certain subsystem of a source environment, whether the subsystem meets a preset cross-environment application publishing rule or not is judged, and the cross-environment application publishing rule can be flexibly set by a user in advance.
In an embodiment, the step S10 may further include: when an application is published in a certain subsystem of a source environment, detecting whether versions of all application instances of the subsystem in the source environment are consistent, and if so, judging that the subsystem meets a preset cross-environment publishing rule; or when an application is published in a certain subsystem of a source environment, detecting whether the version of the application instance of the subsystem in the source environment is changed, and if the version of any application instance of the subsystem in the source environment is changed, judging that the subsystem meets a preset cross-environment publishing rule.
For example, when an application with a V version is published in the subsystem S1 in the source environment, if it is detected that all the application instances of the subsystem S1 have V versions, it may be determined that the subsystem S1 satisfies the preset cross-environment publication rule; alternatively, when an application with a version V is released in the subsystem S1 of the source environment, if it is detected that the version of any application instance in the subsystem S1 has changed, it may be determined that the subsystem S1 satisfies the preset cross-environment release rule. The method for automatically detecting whether the subsystem meets the preset cross-environment release rule can well detect the application release condition in the source environment, and is a precondition for carrying out the subsequent cross-environment application synchronous release.
If the subsystem meets the preset cross-environment release rule, executing step S20 to obtain the released application version and the preset release mode corresponding to the subsystem;
taking the subsystem S1 as an example, when the subsystem S1 satisfies the preset cross-environment release rule, the application version currently released by the subsystem, i.e., the version V, may be obtained, and the preset release mode corresponding to the subsystem S1 is obtained at the same time. The issuing modes corresponding to the subsystems can include a common mode and an incremental mode, and a user can set the issuing modes corresponding to the subsystems in advance for different subsystems according to actual needs. If the release mode is set to the normal mode, the application version of the subsystem S1 in the target environment only needs to be upgraded to the current version of the subsystem S1 in the source environment, and if the release mode is set to the incremental mode, all versions of the S1 in the source environment since the current version of the S1 in the target environment need to be released once in the target environment.
Step S30, obtaining the application distribution package to be synchronized according to the distributed application version and the distribution mode;
in this step, the application release package to be synchronized is obtained according to the obtained application version released in the subsystem and the release mode corresponding to the subsystem.
Specifically, the step S30 may further include: when the release mode is a common mode, acquiring an application release package corresponding to the released application version as an application release package to be synchronized; when the release mode is an increment mode, acquiring each application instance of the subsystem in the target environment; calculating a to-be-released version path corresponding to each application instance of the subsystem in the target environment according to a preset rule; and acquiring an application publishing packet corresponding to the application version contained in the path of the version to be published as the application publishing packet to be synchronized.
Still taking the above subsystem S1 as an example, if the release mode of the subsystem S1 is the normal mode, the application release package V corresponding to the currently released application version V (the application release package V indicates that the version of the application release package is V) may be directly used as the application release package to be synchronized; if the release mode of the subsystem S1 is the incremental mode, first obtaining each application instance of the subsystem S1 in the target environment, then calculating a to-be-released version path corresponding to each application instance of the subsystem S1 in the target environment according to a preset rule, and then obtaining an application release package corresponding to each application version included in the to-be-released version path as an application release package to be synchronized.
Further, as an implementation manner, the step of calculating, according to a preset rule, a to-be-released version path corresponding to each application instance of the subsystem in the target environment may include: acquiring a historical release version path of each application instance of the subsystem in the source environment; carrying out duplicate removal and merging processing on the historical release version paths of the application instances of the subsystem in the source environment to obtain a longest public path; acquiring the current version of each application instance of the subsystem in the target environment; and in the longest public path, taking the current version as a starting point, and taking a historical release version path after the starting point as a to-be-released version path corresponding to each application instance of the subsystem in the target environment.
For example, assume that the source environment S1 has two application instances J and K, with subsystem S1, where the historical release version path for J is: v1- > V2- > Vm- > Vn- > V, the historical release version path of K is: v1- > V2- > V1- > Vm- > Vn- > V (wherein V1 is repeatedly published), the historical published version paths of J and K are de-duplicated and merged, and the longest common path of J and K can be obtained as follows: v1- > V2- > Vm- > Vn- > V; assuming that the target environment S1 has two application instances M and N, and the versions are Vm and Vn, respectively, in the longest common path, with Vm as a starting point, the historical release version path Vn- > V after Vm is taken as the to-be-released version path corresponding to the application instance M, and similarly, with Vn as a starting point, the historical release version path V after Vn is taken as the to-be-released version path corresponding to the application instance N. And then, acquiring application publishing packages Vn and V corresponding to the application versions contained in the path of the to-be-published version as the to-be-synchronized application publishing packages.
By the method for taking the longest public path, the complete playback of the historical release version of the application release package in the subsequent target environment is ensured, the application release package with the same version cannot be played back repeatedly, and therefore the synchronization efficiency of the cross-environment application release is improved.
Of course, as another implementation manner, after the historical release version paths of the application instances of the subsystem in the source environment are acquired, the acquired historical release version paths of the application instances may not be deduplicated and combined, but after the current versions of the application instances of the subsystem in the target environment are acquired, the historical release version paths after the starting point are directly used as the to-be-released version paths corresponding to the application instances of the subsystem in the target environment from the current versions.
For example, the historical release version path of the application instance J of the source environment S1 is as follows: v1- > V2- > Vm- > Vn- > V, the historical release version path of application instance K is: v1- > V2- > V1- > Vm- > Vn- > V (wherein V1 is repeatedly published), and assuming that the target environment S1 has two application instances M and N, and the versions are Vm and Vn respectively, the historical published version path Vn- > V after Vm is taken as the to-be-published version path corresponding to the application instance M directly from the historical published version path of the application instance J, and similarly, the historical published version path V after Vn is taken as the to-be-published version path corresponding to the application instance N directly from Vn in the historical published version path of the application instance K.
The two ways are based on the idea of incremental synchronization, and provide a precondition for the incremental upgrade of the subsequent target environment subsystem application instance (i.e. all versions of the S1 in the source environment since the current version of the S1 in the target environment are released in the target environment once to implement the incremental upgrade).
It should be noted that, compared with the incremental mode, the application synchronous release in the normal mode has faster speed and less required network traffic because each application instance of the subsystem in the target environment is directly upgraded to the current version of the source environment by one step; however, for some applications with too large version difference between the source environment and the target environment, the application is often upgraded to the latest version only by performing incremental upgrade according to the version difference between the source environment and the target environment, so that synchronous release of the application in an incremental mode can ensure that the application in the target environment can be accurately and smoothly upgraded to the latest version. In specific implementation, a user can flexibly select the publishing mode to be the common mode or the incremental mode according to actual needs.
Step S40, obtaining a publishing template instance corresponding to the application publishing packet to be synchronized, and submitting the application publishing packet to be synchronized and the publishing template instance to a preset target environment, so that the target environment generates a corresponding application publishing job.
The publishing template refers to a series of operation steps, such as distribution package, execution of deployment script, recording version and the like, required when the application is published on the AOMP, and these steps form a solidified template which can be repeatedly used in multiple releases; and issuing the template instance refers to cloning an instance of the issuing template every time issuing. The modification of instances and templates do not affect each other.
In this step, a publishing template instance corresponding to the application publishing package to be synchronized is obtained, and then the application publishing package to be synchronized and the corresponding publishing template instance are submitted to a preset target environment together, so that the target environment generates a corresponding application publishing job.
Specifically, the step of submitting the application publishing package to be synchronized and the publishing template instance to a preset target environment may include: associating the application publishing packet to be synchronized with the publishing template instance and then adding the application publishing packet to be synchronized into a preset publishing queue; and calling an application programming interface of the target environment regularly to submit the application publishing packet to be synchronized and the publishing template instance in the publishing queue to a preset target environment.
Taking the application publishing packets Vn and V to be synchronized as an example, since the path of the to-be-published version of the application instance M is Vn- > V and the path of the to-be-published version of the application instance N is V, assuming that the obtained corresponding publishing template instances are Tvn and Tv, the two are associated to obtain S1-M-Vn (Tvn) - > V (Tv), S1-N-V (Tv), and S1-M-Vn (Tvn) - > V (Tv), S1-N-V (Tv) are added to the publishing queue of the AOMP, and then the application programming interface of the target environment is periodically called to submit the to-be-synchronized application publishing packets and publishing template instances in the publishing queue to the preset target environment. It should be noted that, when the publishing template instance is added to the publishing queue, the publishing template instance may also be automatically triggered to be synchronized to the target environment, and the publishing template instance may be flexibly set during specific implementation.
And the target environment automatically generates an application publishing job according to the received publishing template instance and the application publishing package to be synchronized, wherein the job is a complete playback of the job corresponding to the source environment, and except for the execution machine and the environment variable, the rest configuration and data are basically consistent. If the mode is a common mode, the generated job has only one step, namely S1-V-Tv (all machines of the S1 subsystem use Tv as a publishing template instance to publish an application publishing packet of V version); if the mode is the incremental mode, each version of each machine of the generated job has one step, for example, the incremental path is described above, since the path of the version to be released of the application instance M is Vn- > V and the path of the version to be released of the application instance N is V, the job generated by the target environment has the following 3 steps:
1) S1-M-Vn-Tvn (for the M machine of the S1 subsystem, the application publishing package of the Vn version is published by using the Tvn publishing template instance);
2) S1-M-V-Tv (using Tv as an example of a publishing template for M machines of the S1 subsystem to publish an application publishing package of V version);
3) S1-N-V-Tv (the application publishing package of V version is published for N machines of S1 subsystem using Tv as a publishing template instance).
And automatically executing the application release jobs in the target environment according to the corresponding release template examples until all the application release jobs are executed.
In the embodiment, the source environment automatically acquires the application publishing packages to be synchronized and the corresponding publishing template instances and automatically submits the application publishing packages to the target environment for publishing, and manual intervention operation and calculation of increment files among the publishing packages are not needed in the whole process, so that the cross-environment automatic synchronous publishing of the applications is realized, and more computing resources are avoided.
Further, based on the first embodiment described above, it is proposed that the method of the present invention releases the second embodiment across the application of the environment. In this embodiment, after step S40, the method may further include: acquiring an execution state of the application release job in the target environment, and writing the execution state into a preset release record table; polling the issuing record table, and judging whether a record in an unexecuted completion state exists in the issuing record table; if the record exists, the current execution state of the application release operation corresponding to the record in the unexecuted completion state is requested from the target environment regularly, and the current execution state is written back to the release record table until the record in the unexecuted completion state does not exist in the release record table.
In this embodiment, the source environment may obtain an execution state of an application publishing job in the target environment, and write the execution state into a preset publishing record table, and then periodically poll the publishing record table to determine whether a record in an unexecuted complete state exists in the publishing record table, and if so, periodically request the current execution state of the application publishing job corresponding to the record in the unexecuted complete state from the target environment, and write back the current execution state into the publishing record table until no record in the unexecuted complete state exists in the publishing record table. Finally, after the cross-environment application release is completed every time, the subsystem, the machine, the used release template instance and the release package version information which are released at this time are recorded in a release record table and stored in a database.
Further, the writing back the current execution state to the issue record table until there is no record in the unexecuted complete state in the issue record table may further include:
summarizing all release information recorded in the release record table within a preset time length to generate a release report; and sending the release report to the front end of the source environment for displaying.
In this embodiment, all release information of the release record table within a preset time duration (for example, the past 1 day, the past 1 week, and the like) may be summarized to generate a release report, and then the release report is sent to the front end of the source environment for display, so that the front end operation and maintenance personnel can know the cross-environment application release condition in time.
Further, based on the above embodiments, it is proposed that the method of the present invention releases the third embodiment across the application of the environment.
In this embodiment, before the step of determining whether the subsystem meets the preset cross-environment publishing rule when the application is published in a subsystem of the source environment, the method may further include: setting an automatic synchronization release switch of the subsystem in a configuration management database of the source environment; when receiving a starting instruction triggered based on the automatic synchronous release switch, displaying a selection list comprising a common mode and an incremental mode; and receiving a selection instruction triggered based on the selection list, and setting an issuing mode corresponding to the subsystem according to the selection instruction.
Taking the subsystem S1 as an example, in the present embodiment, an automatic synchronization issue switch based on the subsystem S1 is provided in the configuration management database CMDB of the source environment, when an on command triggered based on the automatic synchronization issue switch is received, a selection list including a normal mode and an incremental mode is displayed, and when a selection command triggered by a user based on the selection list is received, that is, the issue mode corresponding to the subsystem S1 is set to be the normal mode or the incremental mode according to the selection command. Of course, besides the subsystem S1, the CMDB is also provided with automatic synchronous publishing switches of other subsystems, so that the user can turn on or off the automatic synchronous publishing switches of different subsystems according to actual needs, and select different publishing modes based on different subsystems. In this way, flexibility in the selection of the distribution mode is improved.
It should be noted that the source environment supports two cross-environment application publishing modes, one is a real-time mode, that is, cross-environment application publishing is performed only on a single user-specified subsystem, for example, cross-environment application publishing is performed only on the subsystem S1; the other is a full-scale mode, namely, all the subsystems in the source environment can be triggered by one key to automatically execute application publishing across environments, and the situation is generally applicable to the situation that the versions of the subsystems included in the source environment and the target environment are different greatly. The normal mode and the increment mode of the subsystem are still supported in the full-quantity mode, for example, a part of subsystems adopt the normal mode, a part of subsystems adopt the increment mode, and for each subsystem, the application issuing logic of the cross-environment is consistent with the real-time mode; in addition, when determining whether the subsystem meets the preset cross-environment distribution rule in the full-scale mode, a serial manner may be adopted, for example, first determining whether the subsystem S1 meets the preset cross-environment distribution rule, then determining whether the subsystem S2 meets the preset cross-environment distribution rule, …, and so on, so as to reduce the pressure of the target environment. In specific implementation, the source environment can provide a function of selecting an application publishing mode across environments, so that a user can flexibly select between a real-time mode and a full-scale mode according to actual requirements.
The invention also provides a cross-environment application release device. The cross-environment application release device of the invention comprises:
the system comprises a judging module, a processing module and a processing module, wherein the judging module is used for judging whether a subsystem meets a preset cross-environment publishing rule when an application is published in a subsystem of a source environment;
the first acquisition module is used for acquiring an application version to be published and a preset publishing mode corresponding to the subsystem if the subsystem meets a preset cross-environment publishing rule;
the second acquisition module is used for acquiring the application release package to be synchronized according to the released application version and the release mode;
and the submitting module is used for acquiring the publishing template instance corresponding to the application publishing package to be synchronized, and submitting the application publishing package to be synchronized and the publishing template instance to a preset target environment so as to enable the target environment to generate corresponding application publishing operation.
Further, the second obtaining module further includes:
a first obtaining unit, configured to obtain, when the release mode is a normal mode, an application release package corresponding to the released application version as an application release package to be synchronized;
a second obtaining unit, configured to obtain, when the publishing mode is an incremental mode, each application instance of the subsystem in the target environment; calculating a to-be-released version path corresponding to each application instance of the subsystem in the target environment according to a preset rule; and acquiring an application publishing packet corresponding to the application version contained in the path of the version to be published as the application publishing packet to be synchronized.
Further, the second obtaining unit is further configured to:
acquiring a historical release version path of each application instance of the subsystem in the source environment;
carrying out duplicate removal and merging processing on the historical release version paths of the application instances of the subsystem in the source environment to obtain a longest public path;
acquiring the current version of each application instance of the subsystem in the target environment;
and in the longest public path, taking the current version as a starting point, and taking a historical release version path after the starting point as a to-be-released version path corresponding to each application instance of the subsystem in the target environment.
Further, the determining module is further configured to:
when an application is published in a certain subsystem of a source environment, detecting whether versions of all application instances of the subsystem in the source environment are consistent, and if so, judging that the subsystem meets a preset cross-environment publishing rule;
or when an application is published in a certain subsystem of a source environment, detecting whether the version of the application instance of the subsystem in the source environment is changed, and if the version of any application instance of the subsystem in the source environment is changed, judging that the subsystem meets a preset cross-environment publishing rule.
Further, the cross-environment application publishing device further comprises:
the execution state writing module is used for acquiring the execution state of the application publishing job in the target environment and writing the execution state into a preset publishing record table;
the polling module is used for polling the issuing record table and judging whether the issuing record table has records in an unexecuted finished state;
and the execution state write-back module is used for regularly requesting the current execution state of the application issuing operation corresponding to the record in the unexecuted completion state from the target environment if the record in the unexecuted completion state exists in the issuing record table, and writing back the current execution state to the issuing record table until the record in the unexecuted completion state does not exist in the issuing record table.
Further, the cross-environment application publishing device further comprises:
the release report generation module is used for summarizing all release information recorded in the release record table within a preset time length so as to generate a release report;
and the sending module is used for sending the release report to the front end of the source environment for displaying.
Further, the commit module is further to:
associating the application publishing packet to be synchronized with the publishing template instance and then adding the application publishing packet to be synchronized into a preset publishing queue;
and calling an application programming interface of the target environment regularly to submit the application publishing packet to be synchronized and the publishing template instance in the publishing queue to a preset target environment.
Further, the cross-environment application publishing device further comprises:
the setting module is used for setting an automatic synchronous release switch of the subsystem in a configuration management database of the source environment;
the display module is used for displaying a selection list containing a common mode and an incremental mode when receiving a starting instruction triggered by the automatic synchronous release switch;
and the receiving module is used for receiving a selection instruction triggered based on the selection list and setting an issuing mode corresponding to the subsystem according to the selection instruction.
The specific operations executed by the program modules may refer to the cross-environment application publishing method embodiment of the present invention, and are not described herein again.
The invention also provides a storage medium.
The storage medium of the present invention stores a cross-environment application publishing program, and the cross-environment application publishing program implements the steps of the cross-environment application publishing method when being executed by the processor.
The method implemented when the cross-environment application publishing program running on the processor is executed may refer to various embodiments of the cross-environment application publishing method of the present invention, and details are not described here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. 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 (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (11)

1. A cross-environment application publishing method is characterized by comprising the following steps:
when an application is published in a certain subsystem of a source environment, judging whether the subsystem meets a preset cross-environment publishing rule;
if yes, acquiring a released application version and a preset release mode corresponding to the subsystem;
acquiring an application publishing packet to be synchronized according to the published application version and the publishing mode;
acquiring a publishing template example corresponding to the application publishing package to be synchronized, and submitting the application publishing package to be synchronized and the publishing template example to a preset target environment so as to enable the target environment to generate a corresponding application publishing job;
wherein, the step of obtaining the application publishing packet to be synchronized according to the published application version and the publishing mode comprises:
when the release mode is a common mode, acquiring an application release package corresponding to the released application version as an application release package to be synchronized;
when the release mode is an increment mode, acquiring each application instance of the subsystem in the target environment;
calculating a to-be-released version path corresponding to each application instance of the subsystem in the target environment according to a preset rule;
and acquiring an application publishing packet corresponding to the application version contained in the path of the version to be published as the application publishing packet to be synchronized.
2. The cross-environment application publishing method according to claim 1, wherein the step of calculating, according to preset rules, to-be-published version paths corresponding to the application instances of the subsystem in the target environment comprises:
acquiring a historical release version path of each application instance of the subsystem in the source environment;
carrying out duplicate removal and merging processing on the historical release version paths of the application instances of the subsystem in the source environment to obtain a longest public path;
acquiring the current version of each application instance of the subsystem in the target environment;
and in the longest public path, taking the current version as a starting point, and taking a historical release version path after the starting point as a to-be-released version path corresponding to each application instance of the subsystem in the target environment.
3. The cross-environment application publishing method according to any one of claims 1 or 2, wherein the step of determining whether a subsystem satisfies a preset cross-environment publishing rule when publishing the application in the subsystem of the source environment comprises:
when an application is published in a certain subsystem of a source environment, detecting whether versions of all application instances of the subsystem in the source environment are consistent, and if so, judging that the subsystem meets a preset cross-environment publishing rule;
or when an application is published in a certain subsystem of a source environment, detecting whether the version of the application instance of the subsystem in the source environment is changed, and if the version of any application instance of the subsystem in the source environment is changed, judging that the subsystem meets a preset cross-environment publishing rule.
4. The cross-environment application publishing method according to any of claims 1 or 2, further comprising:
acquiring an execution state of the application release job in the target environment, and writing the execution state into a preset release record table;
polling the issuing record table, and judging whether a record in an unexecuted completion state exists in the issuing record table;
if the record exists, the current execution state of the application release operation corresponding to the record in the unexecuted completion state is requested from the target environment regularly, and the current execution state is written back to the release record table until the record in the unexecuted completion state does not exist in the release record table.
5. The cross-environment application publishing method of claim 4, wherein the step of writing back the current execution state to the publish record table until no record in the unexecuted complete state exists in the publish record table further comprises:
summarizing all release information recorded in the release record table within a preset time length to generate a release report;
and sending the release report to the front end of the source environment for displaying.
6. The cross-environment application publishing method according to any of claims 1 or 2, wherein the step of submitting the application publishing package to be synchronized and the publishing template instance to a preset target environment comprises:
associating the application publishing packet to be synchronized with the publishing template instance and then adding the application publishing packet to be synchronized into a preset publishing queue;
and calling an application programming interface of the target environment regularly to submit the application publishing packet to be synchronized and the publishing template instance in the publishing queue to a preset target environment.
7. The cross-environment application publishing method according to any one of claims 1 or 2, wherein before the step of determining whether a subsystem satisfies a preset cross-environment publishing rule when an application is published in the subsystem of a source environment, the method further comprises:
setting an automatic synchronization release switch of the subsystem in a configuration management database of the source environment;
when receiving a starting instruction triggered based on the automatic synchronous release switch, displaying a selection list comprising a common mode and an incremental mode;
and receiving a selection instruction triggered based on the selection list, and setting an issuing mode corresponding to the subsystem according to the selection instruction.
8. A cross-environment application publishing device, comprising:
the system comprises a judging module, a processing module and a processing module, wherein the judging module is used for judging whether a subsystem meets a preset cross-environment publishing rule when an application is published in a subsystem of a source environment;
the first acquisition module is used for acquiring an application version to be published and a preset publishing mode corresponding to the subsystem if the subsystem meets a preset cross-environment publishing rule;
the second acquisition module is used for acquiring the application release package to be synchronized according to the released application version and the release mode;
the submitting module is used for acquiring a publishing template instance corresponding to the application publishing package to be synchronized, and submitting the application publishing package to be synchronized and the publishing template instance to a preset target environment so as to enable the target environment to generate a corresponding application publishing job;
wherein the second obtaining module further comprises:
a first obtaining unit, configured to obtain, when the release mode is a normal mode, an application release package corresponding to the released application version as an application release package to be synchronized;
a second obtaining unit, configured to obtain, when the publishing mode is an incremental mode, each application instance of the subsystem in the target environment; calculating a to-be-released version path corresponding to each application instance of the subsystem in the target environment according to a preset rule; and acquiring an application publishing packet corresponding to the application version contained in the path of the version to be published as the application publishing packet to be synchronized.
9. The cross-environment application publishing device of claim 8, wherein the second obtaining unit is further to:
acquiring a historical release version path of each application instance of the subsystem in the source environment;
carrying out duplicate removal and merging processing on the historical release version paths of the application instances of the subsystem in the source environment to obtain a longest public path;
acquiring the current version of each application instance of the subsystem in the target environment;
and in the longest public path, taking the current version as a starting point, and taking a historical release version path after the starting point as a to-be-released version path corresponding to each application instance of the subsystem in the target environment.
10. A cross-environment application publishing device, the cross-environment application publishing device comprising: a memory, a processor, and a cross-environment application publishing program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the cross-environment application publishing method of any of claims 1 to 7.
11. A storage medium having stored thereon a cross-environment application publishing program which, when executed by a processor, implements the steps of the cross-environment application publishing method of any of claims 1 to 7.
CN201811617268.4A 2018-12-27 2018-12-27 Cross-environment application release method, device, equipment and storage medium Active CN109739539B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811617268.4A CN109739539B (en) 2018-12-27 2018-12-27 Cross-environment application release method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811617268.4A CN109739539B (en) 2018-12-27 2018-12-27 Cross-environment application release method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109739539A CN109739539A (en) 2019-05-10
CN109739539B true CN109739539B (en) 2021-10-19

Family

ID=66361622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811617268.4A Active CN109739539B (en) 2018-12-27 2018-12-27 Cross-environment application release method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109739539B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941446B (en) * 2019-11-06 2021-06-18 深圳市云网万店科技有限公司 Version release method and device based on multi-environment offline task
CN111796863B (en) * 2020-07-10 2024-04-05 四川中电启明星信息技术有限公司 Cross-environment project version management method
CN112650815B (en) * 2021-01-19 2023-06-16 青岛海尔科技有限公司 Method and device for synchronizing environment data, storage medium and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104991790A (en) * 2015-06-09 2015-10-21 北京奇虎科技有限公司 Upgrade release method and apparatus of file
CN104991791A (en) * 2015-06-09 2015-10-21 北京奇虎科技有限公司 Incremental quantity upgrade release method and apparatus of file
CN105867941A (en) * 2016-04-18 2016-08-17 深圳市永兴元科技有限公司 Software upgrading system and realization method thereof
CN107463362A (en) * 2016-06-03 2017-12-12 北京京东尚科信息技术有限公司 The method and system of lasting deployment based on multiple Jenkins
CN107870772A (en) * 2017-10-09 2018-04-03 深圳前海微众银行股份有限公司 Application dispositions method, platform, system and the readable storage medium storing program for executing of Cross-environment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ES2371995T3 (en) * 2007-12-13 2012-01-12 Telefonaktiebolaget Lm Ericsson (Publ) UPDATE OF THE FIRMWARE OF AN ELECTRONIC DEVICE.

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104991790A (en) * 2015-06-09 2015-10-21 北京奇虎科技有限公司 Upgrade release method and apparatus of file
CN104991791A (en) * 2015-06-09 2015-10-21 北京奇虎科技有限公司 Incremental quantity upgrade release method and apparatus of file
CN105867941A (en) * 2016-04-18 2016-08-17 深圳市永兴元科技有限公司 Software upgrading system and realization method thereof
CN107463362A (en) * 2016-06-03 2017-12-12 北京京东尚科信息技术有限公司 The method and system of lasting deployment based on multiple Jenkins
CN107870772A (en) * 2017-10-09 2018-04-03 深圳前海微众银行股份有限公司 Application dispositions method, platform, system and the readable storage medium storing program for executing of Cross-environment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Lightweight incremental application upgrade;Tijs van der Storm;《Software Engineering SEN》;20060412;第1-9页 *
基于Android平台的智能手机多包连续升级技术改进与实现;张宇杰;《中国优秀博硕学位论文全文数据库(硕士) 信息科技辑》;20180415(第4期);I138-1765 *

Also Published As

Publication number Publication date
CN109739539A (en) 2019-05-10

Similar Documents

Publication Publication Date Title
US11106455B2 (en) Integration of containers with external elements
US10949194B2 (en) Updating dependent services
US7898679B2 (en) Method and system for scheduling jobs in a computer system
WO2017050146A1 (en) Loading method and device for terminal application (app)
CN109739539B (en) Cross-environment application release method, device, equipment and storage medium
CN108874558B (en) Message subscription method of distributed transaction, electronic device and readable storage medium
JP6140145B2 (en) Tenant data recovery across tenant migration
US20140380265A1 (en) Software change process orchestration
CN110825399B (en) Deployment method and device of application program
CN111752581A (en) Distributed system upgrading method and device and computer system
CN117693734A (en) Front-end item processing method, device, equipment, management system and storage medium
US9971611B2 (en) Monitoring a mobile device application
US20130117749A1 (en) Provisioning and Managing an Application Platform
CN111144804A (en) Order processing method, device and system
US20230126168A1 (en) Scalable visualization of a containerized application in a multiple-cluster and multiple deployment application environment
US10992733B1 (en) Workload management in hybrid clouds
US20060271929A1 (en) Method and system for providing job forecasting in a computer system
US9519470B2 (en) Information processing system, information processing apparatus, device, software installation method, and storage medium for executing software installation
US8707307B2 (en) Creating jobs by replacing execution attributes within job definition when a job activation request is received with execution attributes based on predetermined conditions being satisfied
US11275574B2 (en) Recovering the last successful device update on a computing system
US11281444B2 (en) Application update monitoring computer systems
CN112015534A (en) Configurated platform scheduling method, system and storage medium
US10798181B2 (en) Storage medium containing a program, information processing device, and processing method for deploying an application generated to a cloud environment
CN112947951A (en) Software installation method and related equipment
CN111147291A (en) Service maintenance method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant