CN112306525B - Rolling upgrading method, device, equipment and storage medium of application instance - Google Patents

Rolling upgrading method, device, equipment and storage medium of application instance Download PDF

Info

Publication number
CN112306525B
CN112306525B CN202011185433.0A CN202011185433A CN112306525B CN 112306525 B CN112306525 B CN 112306525B CN 202011185433 A CN202011185433 A CN 202011185433A CN 112306525 B CN112306525 B CN 112306525B
Authority
CN
China
Prior art keywords
deployed
deployment
upgrading
batch
upgraded
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
CN202011185433.0A
Other languages
Chinese (zh)
Other versions
CN112306525A (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.)
Kangjian Information Technology Shenzhen Co Ltd
Original Assignee
Kangjian Information Technology Shenzhen 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 Kangjian Information Technology Shenzhen Co Ltd filed Critical Kangjian Information Technology Shenzhen Co Ltd
Priority to CN202011185433.0A priority Critical patent/CN112306525B/en
Publication of CN112306525A publication Critical patent/CN112306525A/en
Application granted granted Critical
Publication of CN112306525B publication Critical patent/CN112306525B/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/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

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

Abstract

The invention relates to the technical field of big data, and discloses a rolling upgrading method, a rolling upgrading device, rolling upgrading equipment and a storage medium of an application instance, which are used for improving the efficiency and the accuracy of system upgrading. The rolling upgrading method of the application instance comprises the following steps: acquiring and checking task parameters to be upgraded to obtain a checking result; when the verification result is that the verification is passed, setting a version number sequence to be upgraded, a deployed version number sequence and target deployment times according to the total number of containers to be deployed; upgrading the application instance in batches based on the version number sequence to be upgraded, the deployed version number sequence and the target deployment times; obtaining deployment results corresponding to each upgrading batch; when the deployment result is deployment failure, carrying out early warning processing on upgrade batches with the deployment failure, and carrying out deployment operation on the rest upgrade batches; and when the deployment result is that the deployment is successful, determining that the task upgrading is completed. In addition, the invention also relates to a blockchain technology, and the version number sequence to be upgraded, the deployed version number sequence and the target deployment times can be stored in a blockchain node.

Description

Rolling upgrading method, device, equipment and storage medium of application instance
Technical Field
The present invention relates to the field of big data technologies, and in particular, to a method, an apparatus, a device, and a storage medium for rolling upgrade of an application instance.
Background
In recent years, the field of internet technology has changed greatly, and various new technologies and new concepts emerge. The internet technology infrastructure deducts from the traditional physical machine and virtual machine to cloud computing; the application program is evolved from the original monomer model and layering model to the micro-service; with the popularity of containerization and container orchestration systems kubernetes, the development and deployment of applications has also changed tremendously, with the original application deployment evolving into a delivery container image in the form of delivery code.
In the era when the architecture of micro services is popular, the user wants the application program to be available at any time, and in order to meet the new service which is continuously changed, the application program needs to be continuously updated, and sometimes frequent release versions may be required. The realization of continuous integration and continuous delivery or deployment of "zero shutdown", "zero perception" applications has always been a difficult and painful point that software upgrades have to face.
In the prior art, the application program is upgraded by adopting a rolling update upgrade mode of kubernetes, wherein the rolling update mode is a native service upgrade strategy provided by kubernetes, and the application program can be updated on the premise of not stopping the application program from an external service legal person by adopting the rolling update mode, but after the upgrade of all the application programs is finished, the upgraded application programs are verified to be abnormal, the application programs need to be totally rolled back, and the problems of low system upgrade accuracy and low efficiency exist.
Disclosure of Invention
The invention provides a rolling upgrading method, a rolling upgrading device, rolling upgrading equipment and a rolling upgrading storage medium for improving system upgrading efficiency and accuracy and reducing system resource consumption.
To achieve the above object, a first aspect of the present invention provides a method for rolling upgrade of an application instance, including: receiving a task deployment request, acquiring task parameters to be upgraded from the task deployment request, and checking the task parameters to be upgraded to obtain a checking result; when the verification result is that verification is passed, the total number of containers to be deployed is obtained, a preset deployment system is called, and a version number sequence to be upgraded, a deployed version number sequence and target deployment times are respectively set according to the total number of the containers to be deployed; the to-be-upgraded version number sequence, the deployed version number sequence and the target deployment times are used for batchwise obtaining to-be-deployed object files corresponding to each upgrading batch and deployed object files corresponding to each upgrading batch, and upgrading application instances batchwise according to the to-be-deployed object files corresponding to each upgrading batch and the deployed object files corresponding to each upgrading batch; when upgrading the application examples in batches, obtaining deployment results corresponding to each upgrading batch through a preset polling task; when the deployment result corresponding to any upgrade batch is deployment failure, generating early warning information for the upgrade batch which is deployment failure, sending the early warning information to a terminal, and continuing deployment operation for the rest upgrade batch, wherein the rest upgrade batch is not executed yet; when the deployment results corresponding to all the upgrading batches are deployment success, setting the task state corresponding to the task deployment request as a success state, deleting the deployed object file corresponding to the task deployment request, and determining that the task upgrading is completed.
Optionally, in a first implementation manner of the first aspect of the present invention, the receiving a task deployment request, obtaining a task parameter to be upgraded from the task deployment request, and verifying the task parameter to be upgraded to obtain a verification result, includes: receiving a task deployment request, and carrying out parameter analysis on the task deployment request to obtain task parameters to be upgraded, wherein the task parameters to be upgraded comprise application copy information and task identification information, and the application copy information comprises versions of medical application programs to be upgraded, types of the medical application programs to be upgraded and the number of the medical application programs to be upgraded; and acquiring a preset task parameter verification rule, and verifying the task parameters to be processed according to the preset task parameter verification rule to obtain a verification result, wherein the verification result comprises verification passing and verification failing.
Optionally, in a second implementation manner of the first aspect of the present invention, when the verification result is that verification passes, obtaining a total number of containers to be deployed, calling a preset deployment system, and setting a version number sequence to be upgraded, a deployed version number sequence, and a target deployment number according to the total number of containers to be deployed, where the method includes: when the verification result is that verification passes, reading the total number of containers to be deployed according to the task identification information; invoking a preset deployment system, and determining the number of containers corresponding to each upgrading batch according to a preset coefficient and the total number of the containers to be deployed; calculating target deployment times according to the total number of the containers to be deployed and the number of the containers corresponding to each upgrading batch; and setting a version number sequence to be upgraded and a deployed version number sequence based on the target deployment times and the number of containers corresponding to each upgrading batch, wherein the version number sequence to be upgraded is used for storing ascending sequence data, and the deployed version number sequence is used for storing descending sequence data.
Optionally, in a third implementation manner of the first aspect of the present invention, the calculating the target deployment number according to the total number of containers to be deployed and the number of containers corresponding to each upgrade lot includes: dividing the total number of the containers to be deployed by the number of the containers corresponding to each upgrading batch to obtain an operation value corresponding to each upgrading batch, wherein the operation value comprises a target quotient and a target remainder; judging whether the target remainder is a preset value or not; if the target remainder is a preset value, setting the target quotient as target deployment times; and if the target remainder is not a preset value, performing self-increasing operation on the target quotient to obtain an operation result, and setting the operation result as target deployment times.
Optionally, in a fourth implementation manner of the first aspect of the present invention, the batch obtaining, based on the to-be-upgraded version number sequence, the deployed version number sequence, and the target deployment number, the to-be-deployed object files corresponding to each upgrade batch and the deployed object files corresponding to each upgrade batch, and batch upgrading application instances according to the to-be-deployed object files corresponding to each upgrade batch and the deployed object files corresponding to each upgrade batch, includes: acquiring deployed times, and sequentially reading the number of application instances to be upgraded and the number of deployed application instances corresponding to each upgrading batch from the version number sequence to be upgraded and the version number sequence to be deployed respectively according to the deployed times by the preset deployment system, wherein the initial value of the deployed times is 0; when detecting that the version of the application instance is not abnormal, calling a preset control system, and setting object files to be deployed corresponding to each upgrading batch according to the number of the application instances to be upgraded corresponding to each upgrading batch, so that the object files to be deployed corresponding to each upgrading batch control the application copy set to be upgraded and create the application instance, thereby obtaining a creation result; when the creation result is that the creation is successful, updating the version of the application instance and adding the application copy set to be upgraded; when the application copy set to be upgraded is the number of application instances to be upgraded corresponding to each upgrading batch, updating the deployed application copy set in the deployed object file corresponding to each upgrading batch according to the number of deployed application instances corresponding to each upgrading batch, and obtaining deployment results corresponding to each upgrading batch.
Optionally, in a fifth implementation manner of the first aspect of the present invention, when upgrading an application instance in batches, obtaining deployment results corresponding to each upgrading batch through a preset polling task includes: when upgrading application examples in batches, acquiring application copy sets to be upgraded in object files to be deployed corresponding to each upgrading batch through a preset polling task, and judging whether the application copy sets to be upgraded corresponding to each upgrading batch are equal to the number of the application examples to be upgraded corresponding to each upgrading batch or not within a preset timeout period; if the number of the application copy sets to be upgraded corresponding to each upgrading batch is equal to the number of the application instances to be upgraded corresponding to each upgrading batch, determining that the deployment result corresponding to each upgrading batch is successful deployment; if the number of the application copy sets to be upgraded corresponding to each upgrading batch is not equal to the number of the application instances to be upgraded corresponding to each upgrading batch, determining that the deployment result corresponding to each upgrading batch is deployment failure; acquiring polling time length corresponding to each upgrading batch, and determining deployment results corresponding to each upgrading batch as deployment failure when the polling time length is greater than a preset timeout time length range.
Optionally, in a sixth implementation manner of the first aspect of the present invention, when deployment results corresponding to all upgrade batches are deployment success, setting a task state corresponding to the task deployment request to a success state, deleting a deployed object file corresponding to the task deployment request, and determining that after task upgrade is completed, the rolling upgrade method of the application instance further includes: when the deployment result corresponding to any upgrade batch is deployment failure, setting the copy set of the application to be upgraded in the corresponding object file to be deployed as 0, setting the copy set of the application to be deployed in the corresponding object file to be deployed as the total number of containers to be deployed, and executing task upgrade rollback operation.
The second aspect of the present invention provides a rolling upgrade apparatus for an application instance, including: the verification module is used for receiving a task deployment request, acquiring task parameters to be upgraded from the task deployment request, and verifying the task parameters to be upgraded to obtain a verification result; the setting module is used for acquiring the total number of containers to be deployed when the verification result is that verification is passed, calling a preset deployment system, and respectively setting a version number sequence to be upgraded, a deployed version number sequence and target deployment times according to the total number of the containers to be deployed; the batch upgrading module is used for obtaining the object files to be deployed corresponding to each upgrading batch and the object files to be deployed corresponding to each upgrading batch in batches based on the version number sequence to be upgraded, the deployed version number sequence and the target deployment times, and upgrading the application instances in batches according to the object files to be deployed corresponding to each upgrading batch and the object files to be deployed corresponding to each upgrading batch; the system comprises an acquisition module, a configuration module and a configuration module, wherein the acquisition module is used for acquiring deployment results corresponding to upgrading batches through a preset polling task when upgrading application examples in batches; the early warning module is used for generating early warning information for the upgrade batch which is failed to be deployed when the deployment result corresponding to any upgrade batch is failed to be deployed, sending the early warning information to the terminal, and continuing the deployment operation for the rest upgrade batch, wherein the rest upgrade batch is not executed yet; and the determining module is used for setting the task state corresponding to the task deployment request as a successful state when the deployment results corresponding to all the upgrading batches are successful in deployment, deleting the deployed object file corresponding to the task deployment request and determining that the task upgrading is completed.
Optionally, in a first implementation manner of the second aspect of the present invention, the verification module is specifically configured to: receiving a task deployment request, and carrying out parameter analysis on the task deployment request to obtain task parameters to be upgraded, wherein the task parameters to be upgraded comprise application copy information and task identification information, and the application copy information comprises versions of medical application programs to be upgraded, types of the medical application programs to be upgraded and the number of the medical application programs to be upgraded; and acquiring a preset task parameter verification rule, and verifying the task parameters to be processed according to the preset task parameter verification rule to obtain a verification result, wherein the verification result comprises verification passing and verification failing.
Optionally, in a second implementation manner of the second aspect of the present invention, the setting module includes: the reading unit is used for reading the total number of the containers to be deployed according to the task identification information when the verification result is that the verification is passed; the determining unit is used for calling a preset deployment system and determining the number of the containers corresponding to each upgrading batch according to the preset coefficient and the total number of the containers to be deployed; the computing unit is used for computing the target deployment times according to the total number of the containers to be deployed and the number of the containers corresponding to each upgrading batch; the setting unit is used for respectively setting a version number sequence to be upgraded and a deployed version number sequence based on the target deployment times and the number of containers corresponding to each upgrading batch, wherein the version number sequence to be upgraded is used for storing ascending sequence data, and the deployed version number sequence is used for storing descending sequence data.
Optionally, in a third implementation manner of the second aspect of the present invention, the calculating unit is specifically configured to: dividing the total number of the containers to be deployed by the number of the containers corresponding to each upgrading batch to obtain an operation value corresponding to each upgrading batch, wherein the operation value comprises a target quotient and a target remainder; judging whether the target remainder is a preset value or not; if the target remainder is a preset value, setting the target quotient as target deployment times; and if the target remainder is not a preset value, performing self-increasing operation on the target quotient to obtain an operation result, and setting the operation result as target deployment times.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the batch upgrade module is specifically configured to: acquiring deployed times, and sequentially reading the number of application instances to be upgraded and the number of deployed application instances corresponding to each upgrading batch from the version number sequence to be upgraded and the version number sequence to be deployed respectively according to the deployed times by the preset deployment system, wherein the initial value of the deployed times is 0; when detecting that the version of the application instance is not abnormal, calling a preset control system, and setting object files to be deployed corresponding to each upgrading batch according to the number of the application instances to be upgraded corresponding to each upgrading batch, so that the object files to be deployed corresponding to each upgrading batch control the application copy set to be upgraded and create the application instance, thereby obtaining a creation result; when the creation result is that the creation is successful, updating the version of the application instance and adding the application copy set to be upgraded; when the application copy set to be upgraded is the number of application instances to be upgraded corresponding to each upgrading batch, updating the deployed application copy set in the deployed object file corresponding to each upgrading batch according to the number of deployed application instances corresponding to each upgrading batch, and obtaining deployment results corresponding to each upgrading batch.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the acquiring module is specifically configured to: when upgrading application examples in batches, acquiring application copy sets to be upgraded in object files to be deployed corresponding to each upgrading batch through a preset polling task, and judging whether the application copy sets to be upgraded corresponding to each upgrading batch are equal to the number of the application examples to be upgraded corresponding to each upgrading batch or not within a preset timeout period; if the number of the application copy sets to be upgraded corresponding to each upgrading batch is equal to the number of the application instances to be upgraded corresponding to each upgrading batch, determining that the deployment result corresponding to each upgrading batch is successful deployment; if the number of the application copy sets to be upgraded corresponding to each upgrading batch is not equal to the number of the application instances to be upgraded corresponding to each upgrading batch, determining that the deployment result corresponding to each upgrading batch is deployment failure; acquiring polling time length corresponding to each upgrading batch, and determining deployment results corresponding to each upgrading batch as deployment failure when the polling time length is greater than a preset timeout time length range.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the rolling upgrade device of the application example further includes: and the rollback operation module is used for setting the copy set of the application to be upgraded in the corresponding object file to be deployed to 0, setting the copy set of the application to be deployed in the corresponding object file to be the total number of the containers to be deployed when the deployment result corresponding to any upgrading batch is deployment failure, and executing task upgrading rollback operation.
A third aspect of the present invention provides a scroll upgrade apparatus for an application instance, including: a memory and at least one processor, the memory having instructions stored therein; the at least one processor invokes the instructions in the memory to cause the scroll upgrade apparatus of the application instance to perform the scroll upgrade method of the application instance described above.
A fourth aspect of the present invention provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the scroll upgrade method of an application instance described above.
In the technical scheme provided by the invention, a task deployment request is received, task parameters to be upgraded are obtained from the task deployment request, and the task parameters to be upgraded are checked to obtain a check result; when the verification result is that verification is passed, the total number of containers to be deployed is obtained, a preset deployment system is called, and a version number sequence to be upgraded, a deployed version number sequence and target deployment times are respectively set according to the total number of the containers to be deployed; the to-be-upgraded version number sequence, the deployed version number sequence and the target deployment times are used for batchwise obtaining to-be-deployed object files corresponding to each upgrading batch and deployed object files corresponding to each upgrading batch, and upgrading application instances batchwise according to the to-be-deployed object files corresponding to each upgrading batch and the deployed object files corresponding to each upgrading batch; when upgrading the application examples in batches, obtaining deployment results corresponding to each upgrading batch through a preset polling task; when the deployment result corresponding to any upgrade batch is deployment failure, generating early warning information for the upgrade batch which is deployment failure, sending the early warning information to a terminal, and continuing deployment operation for the rest upgrade batch, wherein the rest upgrade batch is not executed yet; when the deployment results corresponding to all the upgrading batches are deployment success, setting the task state corresponding to the task deployment request as a success state, deleting the deployed object file corresponding to the task deployment request, and determining that the task upgrading is completed. In the embodiment of the invention, the application program is upgraded and released in batches through the deployment task, and the number of containers of new version is controlled to be continuously increased based on the number columns of the new version and the old version until the total number of the containers is reached; the number of the containers of the old version is controlled to be continuously reduced until the number of the containers is 0, so that the total number of the containers of the new version and the old version is consistent with the total number of the containers before deployment in the whole deployment process, external service is not influenced by application, smooth upgrading can be controlled, the efficiency and the accuracy of system upgrading are improved, and the resource consumption of the system is reduced.
Drawings
FIG. 1 is a schematic diagram of an embodiment of a method for rolling upgrade of an application instance in an embodiment of the present invention;
FIG. 2 is a schematic diagram of another embodiment of a method for rolling upgrade of an application instance in an embodiment of the present invention;
FIG. 3 is a schematic diagram of an embodiment of a scroll upgrade apparatus for an application example in an embodiment of the present invention;
FIG. 4 is a schematic diagram of another embodiment of a scroll upgrade apparatus for an application example in an embodiment of the present invention;
FIG. 5 is a schematic diagram of an embodiment of a scroll upgrade apparatus for an application example in an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a rolling upgrading method, device, equipment and storage medium for an application instance, which are used for upgrading and publishing application programs in batches through deployment tasks, controlling the total number of new and old version containers to be consistent with the total number of containers before deployment based on new and old version number columns, ensuring that the application is not influenced by external service, controlling smooth upgrading, and improving the efficiency and accuracy of system upgrading.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
For easy understanding, the following describes a specific flow of an embodiment of the present invention, referring to fig. 1, and one embodiment of a rolling upgrade method of an application example in the embodiment of the present invention includes:
101. and receiving a task deployment request, acquiring task parameters to be upgraded from the task deployment request, and checking the task parameters to be upgraded to obtain a checking result.
It should be noted that, the same task deployment request may be used to instruct the server to deploy one application micro-service, or may be used to instruct the server to deploy two or more application micro-services, which is not limited herein. The pre-conditions of rolling update release include that the application version before upgrading and the application version after upgrading can be compatible and can coexist; the application image is compiled and packaged each time, and the image label can update and upgrade changes instead of being covered. Thus, the task release deployment may also be redefined as an application upgrade.
The verification result comprises verification passing and verification failing. For example, the server determines whether the number of application copies is greater than 0. It should be noted that, the server may pass the 1 id check, and the server may fail the 0 id check. Further, the server judges whether the verification result is equal to a preset target value, if so, the server determines that the verification result is passed, and the server executes step 102; if the checking result is not equal to the preset target value, the server determines that the checking result is not passed, the server generates prompt information, the server sends the prompt information to the terminal, and the prompt information is used for indicating that the task parameters are abnormal. Optionally, the server may also perform parameter verification on the task deployment request through facet-oriented programming, which is not limited herein.
It can be understood that the execution body of the present invention may be a rolling upgrade device of an application instance, and may also be a terminal or a server, which is not limited herein. The embodiment of the invention is described by taking a server as an execution main body as an example.
102. When the verification result is that verification is passed, the total number of containers to be deployed is obtained, a preset deployment system is called, and the version number sequence to be upgraded, the deployed version number sequence and the target deployment times are respectively set according to the total number of the containers to be deployed.
The value range of the target deployment times is a positive integer. Specifically, the server obtains the number of containers currently applied to the machine room according to the task parameters. The server is divided into a version number sequence to be upgraded and a deployed version number sequence according to a gray scale batch rule, wherein data in the version number sequence to be upgraded is used for indicating the total number of containers from batch capacity to the total number of containers, the data in the deployed version number sequence is used for indicating the total number of containers to 0, and the data in the deployed version number sequence is used for indicating the total number of containers to be the descending sequence. The server controls the containers using the application images of the version to be upgraded to gradually reach the total number of the containers through the new version number column and the old version number column, and the server gradually reduces the total number of the containers to 0 by using the containers of the application images of the old version, so that the gray level of the application is realized, and the upgrade release is controlled.
103. And batchwise acquiring the object files to be deployed corresponding to each upgrading batch and the object files to be deployed corresponding to each upgrading batch based on the version number sequence to be upgraded, the deployed version number sequence and the target deployment times, and batchwise upgrading the application instances according to the object files to be deployed corresponding to each upgrading batch and the object files to be deployed corresponding to each upgrading batch.
In order to realize the gray scale and controllable upgrade release of the application, the server uses two arrays (the array of the version to be upgraded and the array of the deployed version) to upgrade the application instance, for example, the server uses array A to store the deployment batch data of the new version of the application, and controls the number of containers of the new version to be from less to more, so as to gradually reach the total number of the containers; the array B stores deployment batch data of an old version (namely a current running version), and the number of containers of the old version is controlled to be gradually reduced to 0 from more to less. That is, the server divides the total number of containers to be deployed into a plurality of batches based on the version number sequence to be upgraded, the deployed version number sequence and the target deployment times, the server deploys one batch each time after upgrading, the server reissues the next batch, and finally, the release of all the batches is completed. During the whole scrolling process, the server ensures that available application instances are running all the time, so that a new version is released smoothly, and a release mode with zero shutdown and zero perception of a user is realized.
104. When the application examples are upgraded in batches, the deployment results corresponding to the upgrade batches are obtained through a preset polling task.
The deployment results corresponding to the upgrade batches comprise deployment success and deployment failure. When the server polls the copy number of each upgrading batch to reach the expected value through the preset polling task, the server determines that the upgrading of the batch is successful and immediately enters the upgrading of the next batch. It can be understood that the server adopts a preset polling task to periodically poll the corresponding object files to be deployed and the corresponding object files deployed according to a preset interval; when the server judges that the to-be-upgraded application copy set in the corresponding to-be-deployed object file or the deployed application copy set in the corresponding deployed object file does not meet the preset condition, the server determines that the preset polling task still needs to continue polling and waiting.
105. When the deployment result corresponding to any upgrade batch is deployment failure, generating early warning information for the upgrade batch which is deployment failure, sending the early warning information to the terminal, and continuing deployment operation for the rest upgrade batches, wherein the rest upgrade batches are not executed yet.
It should be noted that, when the deployment result corresponding to any upgrade batch is deployment failure, the server stops deploying the task corresponding to the upgrade batch. But still the next batch of task upgrades can be performed and the server performs steps 103 and 104.
Further, the server counts the number of containers with failed deployment from the upgrade batch with failed deployment; the server judges whether the number of containers failed to be deployed is greater than a preset value, wherein the preset value can be 50% of the total number of containers to be deployed, or can be 60% of the total number of containers to be deployed, and the method is not limited in the specific point; if the number of containers with failed deployment is larger than the preset value, the server determines that the task deployment fails and stops deploying all the tasks.
106. When the deployment results corresponding to all the upgrading batches are deployment success, setting the task state corresponding to the task deployment request as a success state, deleting the deployed object file corresponding to the task deployment request, and determining that the task upgrading is completed.
It can be understood that when the server detects that the deployed application copy set in the deployed object file is 0 and the object file to be deployed controls the application copy set to be upgraded to be the total number of containers to be deployed, the server determines that the deployment results corresponding to all upgrading batches are deployment success respectively, and the server deletes the corresponding deployed object file (deployment) by the deployment system with the preset deployment result synchronization value, and the release of the whole application program is finished. Further, the version number sequence to be upgraded, the deployed version number sequence, and the target deployment number are stored in the blockchain database, which is not limited herein.
In the embodiment of the invention, the application program is upgraded and released in batches through the deployment task, and the number of containers of new version is controlled to be continuously increased based on the number columns of the new version and the old version until the total number of the containers is reached; the number of the containers of the old version is controlled to be continuously reduced until the number of the containers is 0, so that the total number of the containers of the new version and the old version is consistent with the total number of the containers before deployment in the whole deployment process, external service is not influenced by application, smooth upgrading can be controlled, the efficiency and the accuracy of system upgrading are improved, and the resource consumption of the system is reduced.
Referring to fig. 2, another embodiment of a rolling upgrade method of an application example in an embodiment of the present invention includes:
201. and receiving a task deployment request, acquiring task parameters to be upgraded from the task deployment request, and checking the task parameters to be upgraded to obtain a checking result.
The task parameters to be upgraded may include application copy information and task identification information, may include environment information to be deployed and submitting personnel information, and may also include remaining parameters, which are not limited herein. The application copy information includes a version (e.g., ver 2) of the medical application to be upgraded, a type (e.g., clinic-like application) of the medical application to be upgraded, and the number (e.g., 3) of the medical application to be upgraded. Optionally, the server receives a task deployment request, and performs parameter analysis on the task deployment request to obtain task parameters to be upgraded, wherein the task parameters to be upgraded comprise application copy information and task identification information, and the application copy information comprises versions of medical application programs to be upgraded, types of the medical application programs to be upgraded and the number of the medical application programs to be upgraded; the server acquires a preset task parameter verification rule, verifies the task parameters to be processed according to the preset task parameter verification rule to obtain a verification result, wherein the verification result comprises that verification passes and verification fails.
202. And when the verification result is that the verification passes, reading the total number of the containers to be deployed according to the task identification information.
Specifically, when the verification result is that the verification passes, the server acquires task identification information; the server sets a query statement according to the task identification information and the grammar rule of the structured query language; after the server is successfully connected with the database, executing a query statement to obtain a query result; the server reads the total number of containers to be deployed from the query results.
203. And calling a preset deployment system, and determining the number of the containers corresponding to each upgrading batch according to the preset coefficient and the total number of the containers to be deployed.
The value range of the preset coefficient is between 0 and 1, for example, the total number of containers required to be deployed in a machine room is S by a server; the method comprises the steps that a server obtains a preset coefficient of 0.2, the server determines that the number of initial containers of each upgrading batch is 0.2S in batch, and performs downward rounding operation on 0.2S to obtain an operation result; and the server acquires the minimum value between the operation result and 10 to obtain the number V of the containers corresponding to each upgrading batch. Further, the number of containers corresponding to each upgrade lot may be the same value.
204. And calculating the target deployment times according to the total number of the containers to be deployed and the number of the containers corresponding to each upgrading batch.
Specifically, the server divides the total number of containers to be deployed by the number of containers corresponding to each upgrade batch to obtain an operation value corresponding to each upgrade batch, where the operation value includes a target quotient and a target remainder, and the data type of the operation value may be integer or floating point, and is not limited herein; the server judges whether the target remainder is a preset value, wherein the preset value is 0; if the target remainder is a preset value, the server sets the target quotient as the target deployment number, for example, a calculation formula of the target deployment number is n=s/V, where N is the target deployment number, S is the total number of containers to be deployed, and V is the number of containers corresponding to each upgrade lot; if the target remainder is not the preset value, the server performs self-increasing operation on the target quotient (i.e., adds 1 to the target quotient) to obtain an operation result, and sets the operation result as the target deployment number, and further, the server performs downward rounding calculation on the operation value (S/V) to obtain a rounding result, adds 1 to the rounding result to obtain an operation result (n+1), and sets the operation result as the target deployment number.
205. And setting a version number sequence to be upgraded and a deployed version number sequence based on the target deployment times and the number of containers corresponding to each upgrading batch, wherein the version number sequence to be upgraded is used for storing ascending sequence data, and the deployed version number sequence is used for storing descending sequence data.
For example, if the target remainder is a preset value, the server determines that the version number column to be upgraded is { V,2V,3V, …, NV }, the deployed version number column is { (N-1) V, (N-2) V, (N-3) V, …, V,0}; if the target remainder is not the preset value, the server determines that the version number column to be upgraded is { V,2V,3V, …, NV, S }, the deployed version number column is { (N-1) V, (N-2) V, (N-3) V, …, V, (S-NV), 0}. It can be understood that the preset deployment system controls the version number sequence to be upgraded and the deployed version number sequence in the rolling upgrading of the rolling batch and the application instance, and the cluster processing capability is ensured under the condition that the number of clusters is fixed. The server provides a preset control system k8s to finish the confirmation of the number of new and old copies expected by the preset deployment system and the application version information and the state information interaction of a certain pod application instance.
206. And batchwise acquiring the object files to be deployed corresponding to each upgrading batch and the object files to be deployed corresponding to each upgrading batch based on the version number sequence to be upgraded, the deployed version number sequence and the target deployment times, and batchwise upgrading the application instances according to the object files to be deployed corresponding to each upgrading batch and the object files to be deployed corresponding to each upgrading batch.
That is, the preset control system (e.g., k8 s) replaces the existing replica controller with a new replica controller at a time, thereby replacing the old Pod template with a new Pod template. The k8s copy creation application program adopts a mode of deploying an object (replyment), the deploying object automatically creates a copy set (replicaSet), and the copy set can accurately control the number of pod replaced each time, so that rolling update can be well realized.
Optionally, acquiring deployed times, and sequentially reading the number of to-be-upgraded application instances corresponding to each upgrade batch and the number of deployed application instances corresponding to each upgrade batch from the to-be-upgraded version number sequence and the deployed version number sequence according to the deployed times through a preset deployment system, wherein the initial value of the deployed times is 0; when detecting that the version of the application instance is not abnormal, the server calls a preset control system, and sets object files to be deployed corresponding to each upgrading batch according to the number of the application instances to be upgraded corresponding to each upgrading batch, so that the object files to be deployed corresponding to each upgrading batch control the application copy set to be upgraded and create the application instance, and a creation result is obtained; when the creation result is that the creation is successful, the server updates the version of the application instance and increases the application copy set to be upgraded, in the upgrading process, the server confirms the pod state of the application instance through a k8s probe, and once the pod is abnormal, the server responds to the failure of deployment to a preset deployment system, so that a target person can process in time; when the application copy set to be upgraded is the number of application instances to be upgraded corresponding to each upgrading batch, the server updates the deployed application copy set in the deployed object file corresponding to each upgrading batch according to the number of deployed application instances corresponding to each upgrading batch, and a deployment result corresponding to each upgrading batch is obtained.
207. When the application examples are upgraded in batches, the deployment results corresponding to the upgrade batches are obtained through a preset polling task.
The deployment result comprises deployment success and deployment failure. Optionally, when upgrading the application instances in batches, the server obtains application copy sets to be upgraded in the object files to be deployed corresponding to each upgrading batch through a preset polling task, and judges whether the application copy sets to be upgraded corresponding to each upgrading batch are equal to the number of the application instances to be upgraded corresponding to each upgrading batch within a preset timeout period; if the number of the application copy sets to be upgraded corresponding to each upgrading batch is equal to the number of the application instances to be upgraded corresponding to each upgrading batch, the server determines that the deployment result corresponding to each upgrading batch is successful deployment; if the number of the application copy sets to be upgraded corresponding to each upgrading batch is not equal to the number of the application instances to be upgraded corresponding to each upgrading batch, the server determines that the deployment result corresponding to each upgrading batch is deployment failure; the server acquires the polling time length corresponding to each upgrading batch, and determines deployment results corresponding to each upgrading batch as deployment failures when the polling time length is longer than a preset timeout time length range.
When the deployment result is that the deployment fails, the server initiates new reissue through a preset deployment system, the preset deployment system calculates the copy number of the new version and the old version, and continues to issue according to the last failure condition. For example, after each batch of deployment tasks are submitted to a downstream system, a polling thread is newly started, the task state is queried for 1 time every 5 seconds, whether the tasks are completed or not is judged, and if the tasks are completed, the deployment of the next batch is entered; if not, waiting for the next polling, and if not, marking the batch of deployment tasks as overtime (deployment failure).
208. When the deployment result corresponding to any upgrade batch is deployment failure, generating early warning information for the upgrade batch which is deployment failure, sending the early warning information to the terminal, and continuing deployment operation for the rest upgrade batches, wherein the rest upgrade batches are not executed yet.
The step 208 is similar to the step 105, and is not described here.
Further, when the deployment result corresponding to any upgrade batch is deployment failure, setting the application copy set to be upgraded in the corresponding object file to be deployed to 0, setting the deployed application copy set in the corresponding object file to be deployed to the total number of containers to be deployed, and executing task upgrade rollback operation. That is, if an application abnormality occurs in the application publishing process, the application deployment system can be controlled to suspend application deployment, the copy of the resource object to be deployed is quickly set to zero, and the old version of the copy is set to the desired copy number, that is, the quick recovery function is achieved.
209. When the deployment results corresponding to all the upgrading batches are deployment success, setting the task state corresponding to the task deployment request as a success state, deleting the deployed object file corresponding to the task deployment request, and determining that the task upgrading is completed.
The execution of step 209 is similar to that of step 106, and detailed description thereof will not be repeated here.
In the embodiment of the invention, the application program is upgraded and released in batches through the deployment task, and the number of containers of new version is controlled to be continuously increased based on the number columns of the new version and the old version until the total number of the containers is reached; the number of the containers of the old version is controlled to be continuously reduced until the number of the containers is 0, so that the total number of the containers of the new version and the old version is consistent with the total number of the containers before deployment in the whole deployment process, external service is not influenced by application, smooth upgrading can be controlled, the efficiency and the accuracy of system upgrading are improved, and the resource consumption of the system is reduced.
The above describes a method for upgrading the application instance by scrolling in the embodiment of the present invention, and the following describes a device for upgrading the application instance by scrolling in the embodiment of the present invention, referring to fig. 3, an embodiment of the device for upgrading the application instance by scrolling in the embodiment of the present invention includes:
The verification module 301 is configured to receive a task deployment request, obtain a task parameter to be upgraded from the task deployment request, and verify the task parameter to be upgraded to obtain a verification result;
the setting module 302 is configured to obtain the total number of containers to be deployed when the verification result is that the verification is passed, call a preset deployment system, and set the version number sequence to be upgraded, the deployed version number sequence and the target deployment times according to the total number of containers to be deployed;
the batch upgrade module 303 is configured to obtain, in batches, to-be-deployed object files corresponding to each upgrade batch and deployed object files corresponding to each upgrade batch based on the to-be-upgraded version number array, the deployed version number array, and the target deployment number, and batch upgrade application instances according to the to-be-deployed object files corresponding to each upgrade batch and the deployed object files corresponding to each upgrade batch;
the acquiring module 304 is configured to acquire deployment results corresponding to each upgrading batch through a preset polling task when upgrading the application instance in batches;
the early warning module 305 is configured to generate early warning information for an upgrade batch that fails to be deployed when a deployment result corresponding to any upgrade batch is that the deployment fails, send the early warning information to the terminal, and continue deployment operation for the remaining upgrade batches, where the remaining upgrade batches are upgrade batches that have not been executed yet;
And the determining module 306 is configured to set the task state corresponding to the task deployment request as a successful state when the deployment results corresponding to all the upgrade batches are deployment success, delete the deployed object file corresponding to the task deployment request, and determine that the task upgrade is completed.
Further, the version number sequence to be upgraded, the deployed version number sequence, and the target deployment number are stored in the blockchain database, which is not limited herein.
In the embodiment of the invention, the application program is upgraded and released in batches through the deployment task, and the number of containers of new version is controlled to be continuously increased based on the number columns of the new version and the old version until the total number of the containers is reached; the number of the containers of the old version is controlled to be continuously reduced until the number of the containers is 0, so that the total number of the containers of the new version and the old version is consistent with the total number of the containers before deployment in the whole deployment process, external service is not influenced by application, smooth upgrading can be controlled, the efficiency and the accuracy of system upgrading are improved, and the resource consumption of the system is reduced.
Referring to fig. 4, another embodiment of a rolling upgrade apparatus for an application example in an embodiment of the present invention includes:
the verification module 301 is configured to receive a task deployment request, obtain a task parameter to be upgraded from the task deployment request, and verify the task parameter to be upgraded to obtain a verification result;
The setting module 302 is configured to obtain the total number of containers to be deployed when the verification result is that the verification is passed, call a preset deployment system, and set the version number sequence to be upgraded, the deployed version number sequence and the target deployment times according to the total number of containers to be deployed;
the batch upgrade module 303 is configured to obtain, in batches, to-be-deployed object files corresponding to each upgrade batch and deployed object files corresponding to each upgrade batch based on the to-be-upgraded version number array, the deployed version number array, and the target deployment number, and batch upgrade application instances according to the to-be-deployed object files corresponding to each upgrade batch and the deployed object files corresponding to each upgrade batch;
the acquiring module 304 is configured to acquire deployment results corresponding to each upgrading batch through a preset polling task when upgrading the application instance in batches;
the early warning module 305 is configured to generate early warning information for an upgrade batch that fails to be deployed when a deployment result corresponding to any upgrade batch is that the deployment fails, send the early warning information to the terminal, and continue deployment operation for the remaining upgrade batches, where the remaining upgrade batches are upgrade batches that have not been executed yet;
and the determining module 306 is configured to set the task state corresponding to the task deployment request as a successful state when the deployment results corresponding to all the upgrade batches are deployment success, delete the deployed object file corresponding to the task deployment request, and determine that the task upgrade is completed.
Optionally, the verification module 301 may be further specifically configured to:
receiving a task deployment request, and carrying out parameter analysis on the task deployment request to obtain task parameters to be upgraded, wherein the task parameters to be upgraded comprise application copy information and task identification information, and the application copy information comprises versions of medical application programs to be upgraded, types of the medical application programs to be upgraded and the number of the medical application programs to be upgraded;
and acquiring a preset task parameter verification rule, and verifying the task parameters to be processed according to the preset task parameter verification rule to obtain a verification result, wherein the verification result comprises verification passing and verification failing.
Optionally, the setting module 302 further includes:
a reading unit 3021, configured to read the total number of containers to be deployed according to the task identification information when the verification result is that the verification is passed;
a determining unit 3022, configured to invoke a preset deployment system, and determine the number of containers corresponding to each upgrade batch according to the preset coefficient and the total number of containers to be deployed;
a calculating unit 3023 configured to calculate a target deployment number according to the total number of containers to be deployed and the number of containers corresponding to each upgrade lot;
a setting unit 3024, configured to set a version number sequence to be upgraded and a deployed version number sequence, based on the target deployment number and the number of containers corresponding to each upgrade batch, respectively, where the version number sequence to be upgraded is used to store ascending sequence data, and the deployed version number sequence is used to store descending sequence data.
Optionally, the computing unit 3023 may be further specifically configured to:
dividing the total number of the containers to be deployed by the number of the containers corresponding to each upgrading batch to obtain an operation value corresponding to each upgrading batch, wherein the operation value comprises a target quotient and a target remainder;
judging whether the target remainder is a preset value or not;
if the target remainder is a preset value, setting the target quotient as the target deployment times;
if the target remainder is not the preset value, performing self-increasing operation on the target quotient to obtain an operation result, and setting the operation result as the target deployment times.
Optionally, the batch upgrade module 303 may also be specifically configured to:
acquiring deployed times, and sequentially reading the number of application instances to be upgraded corresponding to each upgrading batch and the number of deployed application instances corresponding to each upgrading batch from a version number sequence to be upgraded and a version number sequence to be deployed respectively according to the deployed times by a preset deployment system, wherein the initial value of the deployed times is 0;
when detecting that the version of the application instance is not abnormal, calling a preset control system, and setting object files to be deployed corresponding to each upgrading batch according to the number of the application instances to be upgraded corresponding to each upgrading batch, so that the object files to be deployed corresponding to each upgrading batch control the application copy set to be upgraded and create the application instance, thereby obtaining a creation result;
When the creation result is that the creation is successful, updating the version of the application instance and adding an application copy set to be upgraded;
when the application copy set to be upgraded is the number of application instances to be upgraded corresponding to each upgrading batch, updating the deployed application copy set in the deployed object file corresponding to each upgrading batch according to the number of deployed application instances corresponding to each upgrading batch, and obtaining the deployment result corresponding to each upgrading batch.
Optionally, the obtaining module 304 may be further specifically configured to:
when upgrading application examples in batches, acquiring application copy sets to be upgraded in object files to be deployed corresponding to each upgrading batch through a preset polling task, and judging whether the application copy sets to be upgraded corresponding to each upgrading batch are equal to the number of the application examples to be upgraded corresponding to each upgrading batch or not within a preset timeout period;
if the number of the application copy sets to be upgraded corresponding to each upgrading batch is equal to the number of the application instances to be upgraded corresponding to each upgrading batch, determining that the deployment result corresponding to each upgrading batch is successful deployment;
if the number of the application copy sets to be upgraded corresponding to each upgrading batch is not equal to the number of the application instances to be upgraded corresponding to each upgrading batch, determining that the deployment result corresponding to each upgrading batch is deployment failure;
Acquiring polling time length corresponding to each upgrading batch, and determining deployment results corresponding to each upgrading batch as deployment failure when the polling time length is longer than a preset timeout time length range.
Optionally, the rolling upgrade device of the application example further includes:
and a rolling operation module 307, configured to set the to-be-upgraded application copy set in the corresponding to-be-deployed object file to 0, set the deployed application copy set in the corresponding deployed object file to the total number of to-be-deployed containers, and execute task upgrading rollback operation when the deployment result corresponding to any one upgrade batch is deployment failure.
In the embodiment of the invention, the application program is upgraded and released in batches through the deployment task, and the number of containers of new version is controlled to be continuously increased based on the number columns of the new version and the old version until the total number of the containers is reached; the number of the containers of the old version is controlled to be continuously reduced until the number of the containers is 0, so that the total number of the containers of the new version and the old version is consistent with the total number of the containers before deployment in the whole deployment process, external service is not influenced by application, smooth upgrading can be controlled, the efficiency and the accuracy of system upgrading are improved, and the resource consumption of the system is reduced.
The scroll upgrading device of the application example in the embodiment of the present invention is described in detail from the viewpoint of modularization in fig. 3 and fig. 4, and the scroll upgrading device of the application example in the embodiment of the present invention is described in detail from the viewpoint of hardware processing.
Fig. 5 is a schematic structural diagram of a rolling upgrade apparatus for an application example, where the rolling upgrade apparatus 500 for the application example may have a relatively large difference due to different configurations or performances, and may include one or more processors (central processing units, CPU) 510 (e.g., one or more processors) and a memory 520, and one or more storage media 530 (e.g., one or more mass storage devices) storing application programs 533 or data 532. Wherein memory 520 and storage medium 530 may be transitory or persistent storage. The program stored on the storage medium 530 may include one or more modules (not shown), each of which may include a series of instruction operations in the scroll upgrade apparatus 500 for an application instance. Still further, the processor 510 may be configured to communicate with the storage medium 530 to execute a series of instruction operations in the storage medium 530 on the scroll upgrade apparatus 500 of an application instance.
The scroll upgrade apparatus 500 of an application instance may also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input/output interfaces 560, and/or one or more operating systems 531, such as Windows Serve, mac OS X, unix, linux, freeBSD, and the like. It will be appreciated by those skilled in the art that the scroll upgrade apparatus structure of the application example illustrated in fig. 5 does not constitute a limitation of the scroll upgrade apparatus of the application example, and may include more or fewer components than illustrated, or may combine certain components, or may be a different arrangement of components.
The present invention also provides a computer readable storage medium, which may be a non-volatile computer readable storage medium, and may also be a volatile computer readable storage medium, where instructions are stored in the computer readable storage medium, when the instructions are executed on a computer, cause the computer to perform the steps of the rolling upgrade method of the application instance.
The invention also provides a rolling upgrade device of the application example, which comprises a memory and a processor, wherein the memory stores instructions which, when executed by the processor, cause the processor to execute the steps of the rolling upgrade method of the application example in the above embodiments.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform 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 (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. The rolling upgrading method of the application instance is characterized by comprising the following steps of:
receiving a task deployment request, acquiring task parameters to be upgraded from the task deployment request, and checking the task parameters to be upgraded to obtain a checking result;
when the verification result is that verification is passed, the total number of containers to be deployed is obtained, a preset deployment system is called, and a version number sequence to be upgraded, a deployed version number sequence and target deployment times are respectively set according to the total number of the containers to be deployed;
the to-be-upgraded version number sequence, the deployed version number sequence and the target deployment times are used for batchwise obtaining to-be-deployed object files corresponding to each upgrading batch and deployed object files corresponding to each upgrading batch, and upgrading application instances batchwise according to the to-be-deployed object files corresponding to each upgrading batch and the deployed object files corresponding to each upgrading batch;
When upgrading the application examples in batches, obtaining deployment results corresponding to each upgrading batch through a preset polling task;
when the deployment result corresponding to any upgrade batch is deployment failure, generating early warning information for the upgrade batch which is deployment failure, sending the early warning information to a terminal, and continuing deployment operation for the rest upgrade batch, wherein the rest upgrade batch is not executed yet;
when the deployment results corresponding to all the upgrading batches are deployment success, setting the task state corresponding to the task deployment request as a success state, deleting the deployed object file corresponding to the task deployment request, and determining that the task upgrading is completed;
the batch obtaining, based on the version number sequence to be upgraded, the deployed version number sequence and the target deployment frequency, the object files to be deployed corresponding to each upgrade batch and the deployed object files corresponding to each upgrade batch, and batch upgrading application instances according to the object files to be deployed corresponding to each upgrade batch and the deployed object files corresponding to each upgrade batch, including:
acquiring deployed times, and sequentially reading the number of application instances to be upgraded and the number of deployed application instances corresponding to each upgrading batch from the version number sequence to be upgraded and the version number sequence to be deployed respectively according to the deployed times by the preset deployment system, wherein the initial value of the deployed times is 0;
When detecting that the version of the application instance is not abnormal, calling a preset control system, and setting object files to be deployed corresponding to each upgrading batch according to the number of the application instances to be upgraded corresponding to each upgrading batch, so that the object files to be deployed corresponding to each upgrading batch control the application copy set to be upgraded and create the application instance, thereby obtaining a creation result;
when the creation result is that the creation is successful, updating the version of the application instance and adding the application copy set to be upgraded;
when the application copy set to be upgraded is the number of application instances to be upgraded corresponding to each upgrading batch, updating the deployed application copy set in the deployed object file corresponding to each upgrading batch according to the number of deployed application instances corresponding to each upgrading batch, and obtaining deployment results corresponding to each upgrading batch.
2. The method for rolling up the application instance according to claim 1, wherein the receiving the task deployment request, obtaining the task parameters to be upgraded from the task deployment request, and verifying the task parameters to be upgraded, to obtain a verification result, includes:
receiving a task deployment request, and carrying out parameter analysis on the task deployment request to obtain task parameters to be upgraded, wherein the task parameters to be upgraded comprise application copy information and task identification information, and the application copy information comprises versions of medical application programs to be upgraded, types of the medical application programs to be upgraded and the number of the medical application programs to be upgraded;
Acquiring a preset task parameter verification rule, and verifying the task parameters to be processed according to the preset task parameter verification rule to obtain a verification result, wherein the verification result comprises verification passing and verification failing.
3. The rolling upgrade method of the application instance according to claim 2, wherein when the verification result is that verification passes, obtaining the total number of containers to be deployed, calling a preset deployment system, and setting the version number sequence to be upgraded, the deployed version number sequence and the target deployment number according to the total number of containers to be deployed, respectively, including:
when the verification result is that verification passes, reading the total number of containers to be deployed according to the task identification information;
invoking a preset deployment system, and determining the number of containers corresponding to each upgrading batch according to a preset coefficient and the total number of the containers to be deployed;
calculating target deployment times according to the total number of the containers to be deployed and the number of the containers corresponding to each upgrading batch;
and setting a version number sequence to be upgraded and a deployed version number sequence based on the target deployment times and the number of containers corresponding to each upgrading batch, wherein the version number sequence to be upgraded is used for storing ascending sequence data, and the deployed version number sequence is used for storing descending sequence data.
4. The rolling upgrade method of application instances according to claim 3, wherein calculating the target deployment times according to the total number of containers to be deployed and the number of containers corresponding to each upgrade lot comprises:
dividing the total number of the containers to be deployed by the number of the containers corresponding to each upgrading batch to obtain an operation value corresponding to each upgrading batch, wherein the operation value comprises a target quotient and a target remainder;
judging whether the target remainder is a preset value or not;
if the target remainder is a preset value, setting the target quotient as target deployment times;
and if the target remainder is not a preset value, performing self-increasing operation on the target quotient to obtain an operation result, and setting the operation result as target deployment times.
5. The method for rolling up the application instance according to claim 1, wherein when the application instance is upgraded in batches, the deploying results corresponding to each upgrade batch are obtained through a preset polling task, including:
when upgrading application examples in batches, acquiring application copy sets to be upgraded in object files to be deployed corresponding to each upgrading batch through a preset polling task, and judging whether the application copy sets to be upgraded corresponding to each upgrading batch are equal to the number of the application examples to be upgraded corresponding to each upgrading batch or not within a preset timeout period;
If the number of the application copy sets to be upgraded corresponding to each upgrading batch is equal to the number of the application instances to be upgraded corresponding to each upgrading batch, determining that the deployment result corresponding to each upgrading batch is successful deployment;
if the number of the application copy sets to be upgraded corresponding to each upgrading batch is not equal to the number of the application instances to be upgraded corresponding to each upgrading batch, determining that the deployment result corresponding to each upgrading batch is deployment failure;
acquiring polling time length corresponding to each upgrading batch, and determining deployment results corresponding to each upgrading batch as deployment failure when the polling time length is greater than a preset timeout time length range.
6. The method for rolling and upgrading an application instance according to any one of claims 1 to 5, wherein when deployment results corresponding to all upgrade batches are deployment success, setting a task state corresponding to the task deployment request to be a success state, deleting a deployed object file corresponding to the task deployment request, and determining that task upgrading is completed, the method for rolling and upgrading an application instance further comprises:
when the deployment result corresponding to any upgrade batch is deployment failure, setting the copy set of the application to be upgraded in the corresponding object file to be deployed as 0, setting the copy set of the application to be deployed in the corresponding object file to be deployed as the total number of containers to be deployed, and executing task upgrade rollback operation.
7. A scroll upgrade apparatus for an application instance, the scroll upgrade apparatus for an application instance comprising:
the verification module is used for receiving a task deployment request, acquiring task parameters to be upgraded from the task deployment request, and verifying the task parameters to be upgraded to obtain a verification result;
the setting module is used for acquiring the total number of containers to be deployed when the verification result is that verification is passed, calling a preset deployment system, and respectively setting a version number sequence to be upgraded, a deployed version number sequence and target deployment times according to the total number of the containers to be deployed;
the batch upgrading module is used for obtaining the object files to be deployed corresponding to each upgrading batch and the object files to be deployed corresponding to each upgrading batch in batches based on the version number sequence to be upgraded, the deployed version number sequence and the target deployment times, and upgrading the application instances in batches according to the object files to be deployed corresponding to each upgrading batch and the object files to be deployed corresponding to each upgrading batch;
the system comprises an acquisition module, a configuration module and a configuration module, wherein the acquisition module is used for acquiring deployment results corresponding to upgrading batches through a preset polling task when upgrading application examples in batches;
the early warning module is used for generating early warning information for the upgrade batch which is failed to be deployed when the deployment result corresponding to any upgrade batch is failed to be deployed, sending the early warning information to the terminal, and continuing the deployment operation for the rest upgrade batch, wherein the rest upgrade batch is not executed yet;
The determining module is used for setting the task state corresponding to the task deployment request as a successful state when the deployment results corresponding to all the upgrading batches are deployment success, deleting the deployed object file corresponding to the task deployment request and determining that the task upgrading is completed;
the batch upgrade module is specifically configured to:
acquiring deployed times, and sequentially reading the number of application instances to be upgraded and the number of deployed application instances corresponding to each upgrading batch from the version number sequence to be upgraded and the version number sequence to be deployed respectively according to the deployed times by the preset deployment system, wherein the initial value of the deployed times is 0;
when detecting that the version of the application instance is not abnormal, calling a preset control system, and setting object files to be deployed corresponding to each upgrading batch according to the number of the application instances to be upgraded corresponding to each upgrading batch, so that the object files to be deployed corresponding to each upgrading batch control the application copy set to be upgraded and create the application instance, thereby obtaining a creation result;
when the creation result is that the creation is successful, updating the version of the application instance and adding the application copy set to be upgraded;
When the application copy set to be upgraded is the number of application instances to be upgraded corresponding to each upgrading batch, updating the deployed application copy set in the deployed object file corresponding to each upgrading batch according to the number of deployed application instances corresponding to each upgrading batch, and obtaining deployment results corresponding to each upgrading batch.
8. The apparatus for rolling upgrade of application instances according to claim 7, wherein the verification module is specifically configured to:
receiving a task deployment request, and carrying out parameter analysis on the task deployment request to obtain task parameters to be upgraded, wherein the task parameters to be upgraded comprise application copy information and task identification information, and the application copy information comprises versions of medical application programs to be upgraded, types of the medical application programs to be upgraded and the number of the medical application programs to be upgraded;
acquiring a preset task parameter verification rule, and verifying the task parameters to be processed according to the preset task parameter verification rule to obtain a verification result, wherein the verification result comprises verification passing and verification failing.
9. A scroll upgrade apparatus for an application instance, the scroll upgrade apparatus for an application instance comprising: a memory and at least one processor, the memory having instructions stored therein;
The at least one processor invoking the instructions in the memory to cause the scroll upgrade apparatus of the application instance to perform the scroll upgrade method of the application instance of any one of claims 1-6.
10. A computer readable storage medium having instructions stored thereon, which when executed by a processor, implement a rolling upgrade method of an application instance according to any of claims 1-6.
CN202011185433.0A 2020-10-30 2020-10-30 Rolling upgrading method, device, equipment and storage medium of application instance Active CN112306525B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011185433.0A CN112306525B (en) 2020-10-30 2020-10-30 Rolling upgrading method, device, equipment and storage medium of application instance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011185433.0A CN112306525B (en) 2020-10-30 2020-10-30 Rolling upgrading method, device, equipment and storage medium of application instance

Publications (2)

Publication Number Publication Date
CN112306525A CN112306525A (en) 2021-02-02
CN112306525B true CN112306525B (en) 2023-10-20

Family

ID=74330771

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011185433.0A Active CN112306525B (en) 2020-10-30 2020-10-30 Rolling upgrading method, device, equipment and storage medium of application instance

Country Status (1)

Country Link
CN (1) CN112306525B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338533B (en) * 2021-12-30 2024-05-28 广东明创软件科技有限公司 Adjustment method, electronic equipment and computer storage medium
CN116954685B (en) * 2023-09-20 2023-12-26 浪潮通用软件有限公司 Gray scale rolling upgrading method, system, equipment and medium for low-code application system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108491214A (en) * 2018-02-08 2018-09-04 北京中科江南信息技术股份有限公司 The management method and management system of application system upgrading deployment
CN111258609A (en) * 2020-01-19 2020-06-09 北京百度网讯科技有限公司 Upgrading method and device of Kubernetes cluster, electronic equipment and medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10318279B2 (en) * 2017-05-30 2019-06-11 Microsoft Technology Licensing, Llc Autonomous upgrade of deployed resources in a distributed computing environment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108491214A (en) * 2018-02-08 2018-09-04 北京中科江南信息技术股份有限公司 The management method and management system of application system upgrading deployment
CN111258609A (en) * 2020-01-19 2020-06-09 北京百度网讯科技有限公司 Upgrading method and device of Kubernetes cluster, electronic equipment and medium

Also Published As

Publication number Publication date
CN112306525A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
CN112306525B (en) Rolling upgrading method, device, equipment and storage medium of application instance
CN110825399B (en) Deployment method and device of application program
CN110417613B (en) Distributed performance testing method, device, equipment and storage medium based on Jmeter
CN106341244B (en) Configuration file updating method, client, server and system
EP1875345A1 (en) Program version management taking into account system stability
CN111400102B (en) Method, device, equipment and storage medium for monitoring change of application program
CN109324815B (en) Monitoring method, device and equipment for upgrading unmanned vehicle system
CN112486629A (en) Micro-service state detection method and device, electronic equipment and storage medium
CN111752822A (en) Containerization pressure measurement scheduling method, computer equipment and readable storage medium
CN108874425A (en) Configuration file update method, device, baseboard management controller and storage medium
CN101079758A (en) Data check method, device and system
CN113961199A (en) Model deployment system, method, device and storage medium
CN115080093B (en) Distributed system upgrading method, device, server and medium
US20220374528A1 (en) Evaluation apparatus, evaluation system, evaluation method, and program
CN115437674B (en) Firmware upgrading method, device, medium and electronic equipment
CN114567617B (en) IP address allocation method, system, electronic equipment and storage medium
CN114510297B (en) Satellite data reprocessing method and device and electronic equipment
CN112667255B (en) Updating method, updating device, electronic equipment and storage medium
CN109032643A (en) The method and apparatus of software upgrading
CN114328065A (en) Interrupt verification method and device and electronic equipment
CN103942129A (en) Data center baseboard management controller (BMC) management system and method
WO2008048581A1 (en) A processing device operation initialization system
CN114327673A (en) Task starting method and device, electronic equipment and storage medium
CN110673869B (en) Library file loading method, device and system
CN113703804A (en) System upgrading method, system, device and storage medium

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