Service switching method and device, electronic equipment and storage medium
By sending lock instructions in the elastic scaling service to pause the service and issuing manual deployment operations, the problem of difficulty in manually deploying elastic scaling products is solved, and automatic and smooth switching to manual deployment mode is achieved.
Patent Information
- Application Number
- CN202411708341.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-07
AI Technical Summary
Elastic telescopic products are not easy to deploy manually, resulting in the inability to automatically and smoothly switch to manual deployment mode during elastic telescopic.
When the current service deployment mode is an elastic scaling service, in response to receiving the deployment operation request, a locking instruction is sent to the elastic scaling service model, suspending the elastic scaling service, and issuing a manual deployment operation to switch to the manual deployment mode.
It realizes automatic and smooth switching to manual deployment mode during elastic scaling, alleviating the inconvenience of being unable to pause or need to manually pause elastic scaling services and the user has no perception of switching.
Smart Images

Figure CN119576498A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, in particular to the field of Internet of Things technology, and more specifically to a service switching method, device, electronic device and storage medium. Background Art
[0002] Elastic Scaling Service (ESS), also known as Auto Scaling, can automatically adjust the number of computing resources, that is, the number of instances required for the business, according to the policies set by users. It helps users cope with fluctuations in business traffic while improving resource utilization and effectively reducing costs.
[0003] In the process of implementing the concept of the present disclosure, the inventors discovered that there are at least the following problems in the related art: elastic scaling products are not easy to deploy manually. Summary of the invention
[0004] In view of this, the present disclosure provides a service switching method, device, electronic device and storage medium.
[0005] One aspect of the present disclosure provides a service switching method, comprising: in a case where the current service deployment mode is an elastic scaling service, in response to receiving a deployment operation request sent by a console, sending a locking instruction to the elastic scaling service model, wherein the elastic scaling service includes an automatic expansion service and an automatic reduction service; in a case where it is determined that the current execution state of the elastic scaling service is that the automatic expansion and reduction has been successful, responding to the locking instruction, suspending the elastic scaling service; and in response to determining that the elastic scaling service has been suspended, responding to the deployment operation request, issuing a manual deployment operation, so as to automatically switch the current service deployment mode from the elastic scaling service to the manual deployment.
[0006] According to an embodiment of the present disclosure, the service switching method also includes: in response to determining that the current execution state is that automatic scaling has failed, starting a patch program, wherein the patch program is configured to continue to perform automatic scaling operations on a first automatic scaling task that has failed in automatic scaling based on an elastic scaling service until the first automatic scaling task has been successfully executed; and in response to determining that the first automatic scaling task has been successfully executed, changing the current execution state to automatic scaling has succeeded.
[0007] According to an embodiment of the present disclosure, the service switching method further includes: in response to determining that the current execution state is in automatic scaling execution, waiting for the second automatic scaling task in automatic scaling execution to be successfully executed, and changing the current execution state to automatic scaling succeeded.
[0008] According to an embodiment of the present disclosure, at least one of a target operation deployment time and a target operation delay time is pre-configured for a manual deployment operation; the service switching method also includes: in response to determining that the delay queue is empty, writing at least one of the target operation deployment time and the target operation delay time into the delay queue; in response to determining that the delay queue includes an initial operation deployment time and an initial operation delay time, updating the initial operation deployment time using the target operation deployment time, and updating the initial operation delay time using the target operation delay time; and in response to expiration of the target operation deployment time or the target operation delay time in the delay queue, automatically switching the current service deployment mode from manual deployment to elastic scaling service.
[0009] According to an embodiment of the present disclosure, in response to expiration of a target operation deployment time or a target operation delay time in a delay queue, automatically switching the current service deployment mode from manual deployment to an elastic scaling service includes: in response to detecting that the manual operation time of the manual deployment operation has reached the target operation deployment time, sending an unlock instruction to the elastic scaling service model to automatically switch the current service deployment mode from manual deployment to an elastic scaling service.
[0010] According to an embodiment of the present disclosure, in response to expiration of a target operation deployment time or a target operation delay time in a delay queue, automatically switching the current service deployment mode from manual deployment to an elastic scaling service includes: in response to detecting that the waiting time without performing a manual deployment operation after switching to manual deployment has reached the target operation delay time, sending an unlock instruction to the elastic scaling service model to automatically switch the current service deployment mode from manual deployment to an elastic scaling service.
[0011] Another aspect of the present disclosure provides a service switching device, including: a locking instruction sending module, which is used to send a locking instruction to the elastic scaling service model in response to receiving a deployment operation request sent by a console when the current service deployment mode is an elastic scaling service, wherein the elastic scaling service includes an automatic expansion service and an automatic reduction service; an elastic scaling suspension module, which is used to respond to the locking instruction and suspend the elastic scaling service when it is determined that the current execution state of the elastic scaling service is that the automatic expansion and reduction has been successful; and a manual deployment switching module, which is used to respond to the deployment operation request in response to determining that the elastic scaling service has been suspended, and issue a manual deployment operation to automatically switch the current service deployment mode from the elastic scaling service to the manual deployment.
[0012] Another aspect of the present disclosure provides an electronic device, including: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the service switching method of the present disclosure.
[0013] Another aspect of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the service switching method of the present disclosure when executed.
[0014] Another aspect of the present disclosure provides a computer program product, which includes computer executable instructions, and the instructions are used to implement the service switching method of the present disclosure when executed.
[0015] According to the embodiments of the present disclosure, because a locking instruction is sent to the elastic scaling service model in response to receiving a deployment operation request sent by a console when the current service deployment mode is an elastic scaling service, wherein the elastic scaling service includes an automatic expansion service and an automatic reduction service; when it is determined that the current execution state of the elastic scaling service is that the automatic expansion and contraction has been successful, the elastic scaling service is suspended in response to the locking instruction; and in response to determining that the elastic scaling service has been suspended, a manual deployment operation is issued in response to the deployment operation request to automatically switch the current service deployment mode from the elastic scaling service to the manual deployment. Since a locking instruction for suspending the elastic scaling service can be automatically sent when a deployment operation request for requesting to perform a manual deployment operation is received, and a manual deployment operation is issued when the elastic scaling service has been suspended, the inconvenience of not being able to suspend or needing to manually suspend the elastic scaling service in the related art is at least partially alleviated, and automatic and smooth switching between elastic scaling and manual deployment can be achieved during the elastic scaling process, and the user is unaware of the switching process. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0017] Figure 1 An exemplary system architecture to which the service switching method according to an embodiment of the present disclosure can be applied is schematically shown;
[0018] Figure 2 A flow chart of a service switching method according to an embodiment of the present disclosure is schematically shown;
[0019] Figure 3 A system architecture diagram schematically illustrates a method for implementing a service switching method according to an embodiment of the present disclosure;
[0020] Figure 4 The overall flow chart of the service switching method according to the embodiment of the present disclosure is schematically shown;
[0021] Figure 5 A block diagram schematically shows a service switching device according to an embodiment of the present disclosure; and
[0022] Figure 6A block diagram of an electronic device suitable for implementing a service switching method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0023] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0024] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0025] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.
[0026] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0027] In the embodiments of the present disclosure, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc. of the data involved (for example, including but not limited to user personal information) are in compliance with the provisions of relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and maintain information security.
[0028] In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's personal information.
[0029] Serverless architecture means that developers do not need to manage the underlying infrastructure and can focus more on application logic and user experience. As a hot topic in the cloud native field, more and more companies and organizations are beginning to adopt serverless architecture to improve application performance and save server resource costs.
[0030] Elastic scaling is an important technology in the field of cloud computing. It dynamically adjusts the scale of computing resources to meet the changing needs of business load. As one of the core features of serverless architecture, elastic scaling has gradually become an indispensable part of modern applications. It allows applications to automatically increase or decrease resource usage according to their needs, thereby reducing resource costs.
[0031] However, the traditional manual resource deployment method is also irreplaceable. Deployment methods such as blue-green deployment, AB testing, gray release, canary release, and rolling release all involve manual deployment. How to smoothly switch between elastic scaling and manual deployment and avoid concurrent operation risks has become a difficult problem for traditional manual deployment applications to promote serverless architecture. Currently, there are two main types of serverless architecture elastic scaling products: pure elastic scaling products, which can only achieve simple version releases. You cannot stop elastic scaling and perform manual deployment. For products that support pausing elastic scaling, when manual deployment is required, you need to suspend elastic scaling first.
[0032] In the process of implementing the concept of the present disclosure, the inventors found that pure elastic scaling products do not have the ability to stop elastic scaling and perform manual deployment. Products that are manually deployed by pausing elastic scaling capabilities must manually suspend elastic scaling before manual deployment can be performed; if the elastic scaling process is in progress when the suspension occurs, the suspension must wait until the elastic scaling is completed before it can actually take effect. The entire switching process cannot be automatic, smooth, and imperceptible.
[0033] The embodiments of the present disclosure provide a service switching method, device, electronic device and storage medium. The method includes: when the current service deployment mode is an elastic scaling service, in response to receiving a deployment operation request sent by a console, sending a locking instruction to the elastic scaling service model, wherein the elastic scaling service includes an automatic expansion service and an automatic reduction service; when it is determined that the current execution state of the elastic scaling service is that the automatic expansion and reduction has been successful, responding to the locking instruction, suspending the elastic scaling service; and in response to determining that the elastic scaling service has been suspended, responding to the deployment operation request, issuing a manual deployment operation to automatically switch the current service deployment mode from the elastic scaling service to the manual deployment.
[0034] Figure 1 The exemplary system architecture 100 to which the service switching method according to the embodiment of the present disclosure can be applied is schematically shown. It should be noted that: Figure 1What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0035] like Figure 1 As shown, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0036] The user may use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (only for example).
[0037] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
[0038] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.
[0039] It should be noted that the service switching method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the service switching device provided in the embodiment of the present disclosure can generally be set in the server 105. The service switching method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Correspondingly, the service switching device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Alternatively, the service switching method provided in the embodiment of the present disclosure can also be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103, or can also be executed by other terminal devices that are different from the first terminal device 101, the second terminal device 102 or the third terminal device 103. Accordingly, the service switching device provided in the embodiment of the present disclosure may also be arranged in the first terminal device 101, the second terminal device 102 or the third terminal device 103, or in other terminal devices different from the first terminal device 101, the second terminal device 102 or the third terminal device 103.
[0040] For example, the current service deployment mode may be originally stored in any one of the first terminal device 101, the second terminal device 102 or the third terminal device 103 (for example, the first terminal device 101, but not limited thereto), or stored on an external storage device and may be imported into the first terminal device 101. Then, the first terminal device 101 may locally execute the service switching method provided by the embodiment of the present disclosure, or send the current service deployment mode to other terminal devices, servers, or server clusters, and the other terminal devices, servers, or server clusters that receive the current service deployment mode may execute the service switching method provided by the embodiment of the present disclosure.
[0041] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.
[0042] Figure 2 The flowchart of the service switching method according to the embodiment of the present disclosure is schematically shown.
[0043] like Figure 2 As shown, the method includes operations S201 to S203.
[0044] In operation S201, when the current service deployment mode is an elastic scaling service, in response to receiving a deployment operation request sent by a console, a locking instruction is sent to the elastic scaling service model, wherein the elastic scaling service includes an automatic expansion service and an automatic reduction service.
[0045] According to an embodiment of the present disclosure, the elastic scaling service may implement an automatic capacity expansion service or an automatic capacity reduction service based on the elastic scaling technology, and may not be limited to the capacity expansion and reduction service.
[0046] According to an embodiment of the present disclosure, a deployment operation request may represent a request for triggering a manual deployment operation. Compared with elastic scaling that automatically controls the number of application copies, manual deployment refers to manually controlling the version, configuration, number of copies, and other operational behaviors of an application through a console or Open API (Open Application Programming Interface). Specifically, a manual deployment operation may include, for example, at least one of the following operations: updating an image, updating a configuration file, updating, rolling back, deleting, expanding or shrinking a pod (a unit consisting of one or more containers) as a whole or as specified, injecting a sidecar (sidecar container), etc., and may not be limited thereto.
[0047] According to an embodiment of the present disclosure, a service lock field LOCK may be pre-set in the elastic scaling service model to control whether the elastic scaling service is locked or unlocked. For example, when the field value of the LOCK field is 1 or on, it can be represented that the elastic scaling service is locked, and the elastic scaling service cannot be used. When the field value of the LOCK field is 0 or off, it can be represented that the elastic scaling service is not locked, and the elastic scaling service can run normally. The locking instruction can represent sending an instruction to LOCK to control the LOCK field value to change to 1 or on to suspend the elastic scaling service.
[0048] It should be noted that the limitation on the LOCK field value is not limited to this.
[0049] In operation S202, when it is determined that the current execution state of the elastic scaling service is that automatic scaling has been successful, the elastic scaling service is suspended in response to the locking instruction.
[0050] According to an embodiment of the present disclosure, when the elastic scaling service includes an automatic capacity expansion service and an automatic capacity reduction service, the current execution status may include a successful, failed, or executing status.
[0051] According to an embodiment of the present disclosure, the elastic scaling task currently being executed is an automatic expansion task, an automatic reduction task, and automatic expansion and reduction tasks are performed on different pods at the same time. The success of automatic expansion and reduction can represent that automatic expansion has been successful, automatic reduction has been successful, or both automatic expansion and automatic reduction have been successful.
[0052] In operation S203, in response to determining that the elastic scaling service has been suspended, in response to the deployment operation request, a manual deployment operation is issued to automatically switch the current service deployment mode from the elastic scaling service to manual deployment.
[0053] According to the embodiments of the present disclosure, the processes of the above operations S201 to S203 can be implemented using Webhook or other APIs with interception, judgment, suspension, and delivery functions. Webhook is an HTTP (HyperText TransferProtocol) callback that can trigger an HTTP POST (used to submit data to a specified resource to create or update a resource) request under certain conditions and send a simple event notification via HTTP POST. A WebHook implemented based on a web (World Wide Web) application can send a message to a specific URL (Universal Resource Locator) when a specific event occurs.
[0054] According to an embodiment of the present disclosure, the received deployment operation may act on a Workload (i.e., Pod) controller to control the deployment container resources.
[0055] For example, after a user issues a deployment operation request based on the console, it can be intercepted by the webhook and forwarded to the elastic switch service. The elastic switch service can first determine the current execution status of the elastic scaling service, including: determining whether the elastic scaling service has been suspended. If it has been suspended, directly send a manual deployment operation to the Workload controller to perform manual deployment; if it has not been suspended, determine whether the elastic scaling service is in the process of scaling up or down. If the status is that the automatic scaling has been successful, that is, it is not in execution, you can send a manual deployment operation to the Workload controller to perform manual deployment after pausing the elastic scaling service.
[0056] It should be noted that the elastic switch service can be built independently of the webhook, or it can be implemented directly based on the webhook. The latter can be called the elastic switch webhook service.
[0057] Through the above-mentioned embodiments of the present disclosure, since a locking instruction for suspending the elastic scaling service can be automatically sent when a deployment operation request for requesting to perform a manual deployment operation is received, and a manual deployment operation can be issued when the elastic scaling service is already suspended, the inconvenience of the elastic scaling service in the related art that cannot be suspended or needs to be manually suspended is at least partially alleviated, and automatic and smooth switching between elastic scaling and manual deployment can be achieved during the elastic scaling process, and the user is unaware of the switching process.
[0058] In conjunction with specific embodiments, Figure 2 The method shown is further explained.
[0059] According to an embodiment of the present disclosure, the service switching method may further include: in response to determining that the current execution state is that the automatic expansion and contraction has failed, starting a patch program. Wherein, the patch program is configured to continue the automatic expansion and contraction operation on the first automatic expansion and contraction task that has failed in the automatic expansion and contraction based on the elastic scaling service until the first automatic expansion and contraction task has been successfully executed. In response to determining that the first automatic expansion and contraction task has been successfully executed, the current execution state is changed to the automatic expansion and contraction has been successfully executed.
[0060] According to an embodiment of the present disclosure, the patch program can be affected by the state of the failure of the first automatic scaling task. For example, no matter at which stage the first automatic scaling task fails, the patch instruction can trigger the elastic scaling service to continue to execute the remaining first automatic scaling tasks towards the task goal according to the final task goal of the first automatic scaling task until the first automatic scaling task has been successfully executed.
[0061] It should be noted that if the first automatic expansion task has failed, the patch program will be automatically started to continue the first automatic expansion task until the task is successfully executed. Therefore, when the current execution status is that the automatic expansion has failed, the elastic scaling service will still be in execution.
[0062] According to an embodiment of the present disclosure, the above-mentioned service switching method may further include: in response to determining that the current execution state is in automatic scaling execution, waiting for the second automatic scaling task in automatic scaling execution to be successfully executed, and changing the current execution state to automatic scaling succeeded.
[0063] According to an embodiment of the present disclosure, for an elastic scaling service in execution, it is necessary to wait for the automatic scaling task to be completed, and then suspend the elastic scaling before sending a manual deployment operation to the workload controller to perform manual deployment.
[0064] Through the above embodiments of the present disclosure, automatic, smooth, and imperceptible switching from elastic scaling to manual deployment can be more comprehensively achieved.
[0065] According to an embodiment of the present disclosure, at least one of a target operation deployment time and a target operation delay time may be pre-configured for a manual deployment operation.
[0066] According to an embodiment of the present disclosure, the target operation deployment time may represent the total time required to complete the manual deployment operation preset for the manual deployment operation. The target operation delay time may be used to define that if the manual deployment is not performed for a certain number of times, the manual deployment is deemed to be completed.
[0067] According to an embodiment of the present disclosure, before each manual deployment, at least one of a target operation deployment time and a target operation delay time of this manual deployment may be configured as needed.
[0068] According to an embodiment of the present disclosure, the service switching method may further include: in response to determining that the delay queue is empty, writing at least one of the target operation deployment time and the target operation delay time into the delay queue. In response to determining that the delay queue includes the initial operation deployment time and the initial operation delay time, updating the initial operation deployment time using the target operation deployment time, and updating the initial operation delay time using the target operation delay time. In response to the expiration of the target operation deployment time or the target operation delay time in the delay queue, the current service deployment mode is automatically switched from manual deployment to elastic scaling service.
[0069] According to an embodiment of the present disclosure, the delay queue can be used to store the target operation deployment time and target operation delay time of the latest manual deployment operation, so that the elastic scaling service can be automatically started according to the content stored in the delay queue when it is determined that the manual deployment operation has expired.
[0070] For example, when switching to manual deployment, you can check whether there is a workload deployment time in the delay queue, that is, whether there is an initial operation deployment time and an initial operation delay time. If so, you can update the expiration time of the received deployment based on the target operation deployment time and target operation delay time of the current manual deployment; if not, you can directly put the target operation deployment time and target operation delay time into the delay queue. Waiting for any time in the delay queue to expire triggers an automatic switching event and enables the elastic scaling capability of the elastic scaling controller.
[0071] According to an embodiment of the present disclosure, the delay time for automatically starting the elastic scaling service may be calculated according to the target operation deployment time and the target operation delay time in the delay queue.
[0072] For example, in the case of performing manual deployment, the above-mentioned response to the expiration of the target operation deployment time and the target operation delay time in the delay queue, automatically switching the current service deployment mode from manual deployment to elastic scaling service may include: in response to detecting that the manual operation time of the manual deployment operation has reached the target operation deployment time, sending an unlocking instruction to the elastic scaling service model to automatically switch the current service deployment mode from manual deployment to elastic scaling service.
[0073] For example, in the case where manual deployment is not performed, the above-mentioned response to the expiration of the target operation deployment time and the target operation delay time in the delay queue to automatically switch the current service deployment mode from manual deployment to elastic scaling service may include: in response to detecting that the waiting time without performing a manual deployment operation after switching to manual deployment has reached the target operation delay time, sending an unlocking instruction to the elastic scaling service model to automatically switch the current service deployment mode from manual deployment to elastic scaling service.
[0074] According to an embodiment of the present disclosure, the unlock instruction may represent sending an instruction to LOCK to change the value of the LOCK field to 0 or off, so as to start the elastic scaling service.
[0075] Through the above embodiments of the present disclosure, automatic, smooth, and imperceptible switching from manual deployment to elastic scaling can be more comprehensively achieved.
[0076] Figure 3 A system architecture diagram for implementing the service switching method of an embodiment of the present disclosure is schematically shown.
[0077] like Figure 3 As shown, the system 300 includes a console 310 , an elastic switch Webhook service 320 , a workload controller 330 , and an elastic scaling controller 340 .
[0078] According to an embodiment of the present disclosure, in the switching stage from elastic scaling to manual deployment, during the elastic scaling process, manual deployment can be directly issued without manual pause and other operations. This process can be implemented by the elastic switch Webhook service 320 sequentially executing operations S321-S322.
[0079] In operation S321, elastic scaling is suspended.
[0080] In operation S322 , the manual deployment is sent to the workload controller 330 so that the workload controller 330 performs the manual deployment.
[0081] According to an embodiment of the present disclosure, in the switching stage from manual deployment to elastic scaling, operations S311 to S312 may be performed on the console 310 before manual deployment.
[0082] In operation S311 , an operation deployment time and / or an operation delay time is configured.
[0083] In operation S312, a manual deployment operation is performed to generate a deployment operation request.
[0084] Then, the elastic switch Webhook service 320 automatically calculates the elastic scaling start time based on the sequential execution of operations S321 to S322 according to the configuration of operation S311 and executes operation S323.
[0085] In operation S323 , the manual deployment is waited to expire, and elastic scaling is automatically enabled so that the elastic scaling controller 340 can perform the elastic scaling service.
[0086] Figure 4 The overall flow chart of the service switching method according to the embodiment of the present disclosure is schematically shown.
[0087] like Figure 4 As shown, the method includes operations S401 to S413.
[0088] In operation S401, the operation deployment time and / or operation delay time of this manual deployment is configured.
[0089] In operation S402, the console sends a manual deployment operation Workload.
[0090] In operation S403, the elastic switch Webhook service detects whether elastic scaling has been suspended. If so, operation S407 is executed; if not, operation S404 is executed.
[0091] In operation S404, it is determined whether the elastic controller is in the process of scaling up or down. If so, operation S405 is executed; if not, operation S406 is executed.
[0092] In operation S405, the process waits for the expansion and contraction to be completed.
[0093] In operation S406 , elastic scaling is suspended.
[0094] In operation S407, a manual deployment operation on the workload is issued.
[0095] In operation S408, the expiration time of this manual deployment is calculated.
[0096] In operation S409, it is determined whether there is a workload deployment time in the delay queue. If yes, operation S411 is executed; if no, operation S410 is executed.
[0097] In operation S410, the current workload deployment time is put into a delay queue.
[0098] In operation S411, the expiration time is updated.
[0099] In operation S412, a delay queue triggering event is waited for.
[0100] In operation S413, elastic scaling is enabled.
[0101] Through the above embodiments of the present disclosure, in the elastic scaling process, combined with the Webhook technology, the elastic switch Webhook service can be used to control the automatic pause of the elastic scaling controller and realize the automatic switching of manual deployment. By configuring the operation deployment time and the operation delay time, the elastic scaling can be started at a scheduled time. Thus, the automatic, smooth and imperceptible switching between elastic scaling and manual deployment can be realized.
[0102] Figure 5 The block diagram schematically shows a service switching device according to an embodiment of the present disclosure.
[0103] like Figure 5 As shown, the service switching device 500 includes a locking instruction sending module 510, an elastic scaling suspension module 520 and a manual deployment switching module 530.
[0104] The locking instruction sending module 510 is used to send a locking instruction to the elastic scaling service model in response to receiving a deployment operation request sent by the console when the current service deployment mode is an elastic scaling service, wherein the elastic scaling service includes an automatic expansion service and an automatic reduction service.
[0105] The elastic scaling suspension module 520 is used to respond to the locking instruction and suspend the elastic scaling service when it is determined that the current execution state of the elastic scaling service is that the automatic expansion and contraction has been successful.
[0106] The manual deployment switching module 530 is used to respond to the deployment operation request in response to determining that the elastic scaling service has been suspended, and issue a manual deployment operation to automatically switch the current service deployment mode from the elastic scaling service to manual deployment.
[0107] According to an embodiment of the present disclosure, the service switching device further includes a patch program startup module and a state change module.
[0108] A patch program startup module is used to start the patch program in response to determining that the current execution state is that the automatic scaling has failed, wherein the patch program is configured to continue the automatic scaling operation on the first automatic scaling task that has failed in the automatic scaling based on the elastic scaling service until the first automatic scaling task is successfully executed.
[0109] The state changing module is used to change the current execution state to the automatic expansion and contraction has been successful in response to determining that the first automatic expansion and contraction task has been successfully executed.
[0110] According to an embodiment of the present disclosure, the service switching device further includes a waiting module.
[0111] The waiting module is used for, in response to determining that the current execution state is in the process of automatic expansion and contraction execution, waiting for the second automatic expansion and contraction task in the process of automatic expansion and contraction execution to be successfully executed, and changing the current execution state to the automatic expansion and contraction has been successfully executed.
[0112] According to an embodiment of the present disclosure, at least one of a target operation deployment time and a target operation delay time is pre-configured for a manual deployment operation. The service switching device further includes a time writing module, a time updating module and an elastic scaling switching module.
[0113] The time writing module is used to write at least one of the target operation deployment time and the target operation delay time into the delay queue in response to determining that the delay queue is empty.
[0114] The time updating module is used for updating the initial operation deployment time with the target operation deployment time and updating the initial operation delay time with the target operation delay time in response to determining that the delay queue includes the initial operation deployment time and the initial operation delay time.
[0115] The elastic scaling switching module is used to automatically switch the current service deployment mode from manual deployment to elastic scaling service in response to the expiration of the target operation deployment time or the target operation delay time in the delay queue.
[0116] According to an embodiment of the present disclosure, the elastic telescopic switching module includes a first automatic switching unit.
[0117] The first automatic switching unit is used to send an unlock instruction to the elastic scaling service model in response to detecting that the manual operation time of the manual deployment operation has reached the target operation deployment time, so as to automatically switch the current service deployment mode from manual deployment to elastic scaling service.
[0118] According to an embodiment of the present disclosure, the elastic telescopic switching module includes a second automatic switching unit.
[0119] The second automatic switching unit is used to send an unlock instruction to the elastic scaling service model in response to detecting that the waiting time for no manual deployment operation after switching to manual deployment has reached the target operation delay time, so as to automatically switch the current service deployment mode from manual deployment to elastic scaling service.
[0120] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging circuits, or can be implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0121] For example, any of the locking instruction sending module 510, the elastic scaling pause module 520, and the manual deployment switching module 530 can be combined in one module / unit / sub-unit for implementation, or any of the modules / units / sub-units can be split into multiple modules / units / sub-units. Alternatively, at least part of the functions of one or more of these modules / units / sub-units can be combined with at least part of the functions of other modules / units / sub-units and implemented in one module / unit / sub-unit. According to an embodiment of the present disclosure, at least one of the locking instruction sending module 510, the elastic scaling pause module 520, and the manual deployment switching module 530 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the locking instruction sending module 510, the elastic scaling pause module 520, and the manual deployment switching module 530 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be executed.
[0122] It should be noted that the service switching device part in the embodiment of the present disclosure corresponds to the service switching method part in the embodiment of the present disclosure. The description of the service switching device part specifically refers to the service switching method part, which will not be repeated here.
[0123] Figure 6A block diagram of an electronic device suitable for implementing a service switching method according to an embodiment of the present disclosure is schematically shown. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0124] like Figure 6 As shown, the electronic device 600 according to an embodiment of the present disclosure includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include an onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0125] In RAM 603, various programs and data required for the operation of electronic device 600 are stored. Processor 601, ROM 602 and RAM 603 are connected to each other via bus 604. Processor 601 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 602 and / or RAM 603. It should be noted that the program can also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0126] According to an embodiment of the present disclosure, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to the bus 604. The electronic device 600 may further include one or more of the following components connected to the input / output (I / O) interface 605: an input portion 606 including a keyboard, a mouse, etc.; an output portion 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 608 including a hard disk, etc.; and a communication portion 609 including a network interface card such as a LAN card, a modem, etc. The communication portion 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage portion 608 as needed.
[0127] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0128] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the service switching method according to the embodiment of the present disclosure is implemented.
[0129] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0130] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 602 and / or the RAM 603 described above and / or one or more memories other than the ROM 602 and the RAM 603 .
[0131] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains a program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the service switching method provided by the embodiment of the present disclosure.
[0132] When the computer program is executed by the processor 601, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0133] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 609, and / or installed from a removable medium 611. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0134] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0135] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions. It can be understood by those skilled in the art that the features recorded in the various embodiments of the present disclosure can be combined and / or combined in a variety of ways, even if such a combination or combination is not explicitly recorded in the present disclosure. In particular, without departing from the spirit and teaching of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0136] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A service switching method, comprising: In the case where the current service deployment mode is an elastic scaling service, in response to receiving a deployment operation request sent by the console, sending a locking instruction to the elastic scaling service model, wherein the elastic scaling service includes an automatic expansion service and an automatic reduction service; When it is determined that the current execution state of the elastic scaling service is that the automatic expansion and contraction has been successful, responding to the locking instruction, suspending the elastic scaling service; and In response to determining that the elastic scaling service has been suspended, in response to the deployment operation request, a manual deployment operation is issued to automatically switch the current service deployment mode from the elastic scaling service to manual deployment.
2. The method according to claim 1, further comprising: In response to determining that the current execution state is that the automatic scaling has failed, starting a patch program, wherein the patch program is configured to continue to perform the automatic scaling operation on the first automatic scaling task in which the automatic scaling has failed, based on the elastic scaling service, until the first automatic scaling task is successfully executed; and In response to determining that the first automatic scaling task has been executed successfully, the current execution state is changed to that the automatic scaling has been successful.
3. The method according to claim 1, further comprising: In response to determining that the current execution state is in automatic scaling execution, waiting for a second automatic scaling task in the automatic scaling execution to be successfully executed, the current execution state is changed to the automatic scaling has been successfully executed.
4. The method according to any one of claims 1 to 3, wherein: At least one of a target operation deployment time and a target operation delay time is pre-configured for the manual deployment operation; the method further includes: In response to determining that the delay queue is empty, writing at least one of the target operation deployment time and the target operation delay time into the delay queue; In response to determining that the delay queue includes an initial operation deployment time and an initial operation delay time, updating the initial operation deployment time using the target operation deployment time, and updating the initial operation delay time using the target operation delay time; and In response to expiration of the target operation deployment time or the target operation delay time in the delay queue, the current service deployment mode is automatically switched from the manual deployment to the elastic scaling service.
5. The method according to claim 4, wherein: In response to the expiration of the target operation deployment time or the target operation delay time in the delay queue, automatically switching the current service deployment mode from the manual deployment to the elastic scaling service includes: In response to detecting that the manual operation time of the manual deployment operation has reached the target operation deployment time, an unlock instruction is sent to the elastic scaling service model to automatically switch the current service deployment mode from the manual deployment to the elastic scaling service.
6. The method according to claim 4, wherein: In response to the expiration of the target operation deployment time or the target operation delay time in the delay queue, automatically switching the current service deployment mode from the manual deployment to the elastic scaling service includes: In response to detecting that the waiting time after switching to the manual deployment without performing the manual deployment operation has reached the target operation delay time, an unlock instruction is sent to the elastic scaling service model to automatically switch the current service deployment mode from the manual deployment to the elastic scaling service.
7. A service switching device, comprising: A locking instruction sending module, used for sending a locking instruction to the elastic scaling service model in response to receiving a deployment operation request sent by the console when the current service deployment mode is an elastic scaling service, wherein the elastic scaling service includes an automatic expansion service and an automatic reduction service; an elastic scaling suspension module, configured to respond to the locking instruction and suspend the elastic scaling service when it is determined that the current execution state of the elastic scaling service is that the automatic expansion and contraction has been successful; and The manual deployment switching module is used to respond to the deployment operation request in response to determining that the elastic scaling service has been suspended, and issue a manual deployment operation to automatically switch the current service deployment mode from the elastic scaling service to manual deployment.
8. An electronic device, comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.